Giter VIP home page Giter VIP logo

Comments (11)

surfingjoe avatar surfingjoe commented on September 28, 2024 2

It took me a while to get the chance to go back to this today. Good News
I originally still had a problem with Python 2.7 installed when running the virtual environment, "error 2.7 deprecated."
So, I completely removed Python using the following article. Hint: I removed both Python 2.7 and Python 3.11 and all links to them.

I then installed only Python3.
Then, I used PIP3 to install virtualenv, MKDOCS, Windmill theme, and awesome-pages-plugin.
Then I ran the instructions to launch Venv found in this article.

kamilkrzyskow Thank You so much, I learned something valuable from using the virtual environment. Makes a cleaner use of MKDOCS by far!!

from mkdocs-awesome-pages-plugin.

surfingjoe avatar surfingjoe commented on September 28, 2024 1

kamilkrzyskow, I will give that a shot. I'm for learning something new every day and that sounds very handy!

from mkdocs-awesome-pages-plugin.

surfingjoe avatar surfingjoe commented on September 28, 2024 1

kamilkrzyskow - Sorry, I must've mis-phrased something. I activated virtualenv before installing MKDOCS, Windmill theme, and awesome-pages-plugin.

I will check the method mentioned by your link above.

Thank You!

from mkdocs-awesome-pages-plugin.

lukasgeiter avatar lukasgeiter commented on September 28, 2024

My first guess is that the plugin is installed in a different location than mkdocs itself. Run the following command to print all packages that are installed alongside the plugin:

python3 -m pip freeze

from mkdocs-awesome-pages-plugin.

surfingjoe avatar surfingjoe commented on September 28, 2024

This is the list:
bracex==2.3.post1
click==8.1.7
ghp-import==2.1.0
Jinja2==3.1.2
Markdown==3.4.4
MarkupSafe==2.1.3
mergedeep==1.3.4
mkdocs==1.5.2
mkdocs-awesome-pages-plugin==2.9.2
natsort==8.4.0
packaging==23.1
pathspec==0.11.2
platformdirs==3.10.0
python-dateutil==2.8.2
PyYAML==6.0.1
pyyaml_env_tag==0.1
six==1.16.0
watchdog==3.0.0
wcmatch==8.4.1

from mkdocs-awesome-pages-plugin.

kamilkrzyskow avatar kamilkrzyskow commented on September 28, 2024

I recommend using a Virtual Environment to have a better control of the packages.

But anyways looking at the pip freeze it seems that both MkDocs and the plugin are installed in the same pip environment.

Try running python3 -m mkdocs instead of just mkdocs or make sure that the MkDocs in python 2 is uninstalled.

from mkdocs-awesome-pages-plugin.

surfingjoe avatar surfingjoe commented on September 28, 2024

I ran the following command:
python2 pip uninstall mkdocs and successfully removed mkdocs from version 2

Still, though, running mkdocs serve works as long as I have the awesome-pages plugin commented out.

Sooooo, I tried your other suggestion to run python3 -m mkdocs serve and received the following errors:

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/main.py", line 361, in
cli()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/main.py", line 270, in serve_command
serve.serve(**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 59, in serve
config = get_config()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 47, in get_config
config = load_config(
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/config/base.py", line 378, in load_config
errors, warnings = cfg.validate()
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/config/base.py", line 230, in validate
run_failed, run_warnings = self._validate()
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/config/base.py", line 188, in _validate
self[key] = config_option.validate(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/config/config_options.py", line 182, in validate
return self.run_validation(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/config/config_options.py", line 1064, in run_validation
self.load_plugin_with_namespace(name, cfg)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mkdocs/config/config_options.py", line 1095, in load_plugin_with_namespace
current_theme = self._config[self.theme_key]['name']
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: string indices must be integers, not 'str'

from mkdocs-awesome-pages-plugin.

surfingjoe avatar surfingjoe commented on September 28, 2024

kamilkrzyskow, what kind of virtual environment do you recommend when you say virtual environment? Perhaps Docker with a mapped volume for the documentation?

from mkdocs-awesome-pages-plugin.

kamilkrzyskow avatar kamilkrzyskow commented on September 28, 2024

@surfingjoe I mean the most simple, python3 -m venv venv (using the venv module to create a venv directory) then activating it.
I guess on Mac it's source venv/bin/activate but you'd better double check that.

I don't use Docker or any Conda environment overlay.

After the activation your terminal should show (venv) and then every pip install command will install packages into that virtual environment.

from mkdocs-awesome-pages-plugin.

lukasgeiter avatar lukasgeiter commented on September 28, 2024

Thanks @kamilkrzyskow for helping out here, virtual environments are definitely the way to go 👍

@surfingjoe Please also post the contents of your mkdocs.yml. The latest error you've posted looks like mkdocs/mkdocs#3351 which happens when the theme is invalid (e.g. not installed).

from mkdocs-awesome-pages-plugin.

kamilkrzyskow avatar kamilkrzyskow commented on September 28, 2024

Wait, when reading this in order you installed virtualenv, the theme, MkDocs and the plugin and only after that activated the virtual environment?

If so that's not the right order, you activate the virtual environment and then install the packages so that they're isolated in that environment.
Otherwise you installed everything globally.

If you like your virtualenv then you can stick with it, but I will reiterate that I meant the default already built-in method.

https://devdocs.io/python~3.11/library/venv

from mkdocs-awesome-pages-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.