#π making website with mkdocs some issue
189 messages Β· Page 1 of 1 (latest)
@fleet belfry
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
hey
hi
this is the result
ill just finish some conversations going on in paralell
i see mkdocs is there, that is good.. now, explain what problem you are trying to solve here? because i want to give you the correct answer to your issue
mkdocs : The term 'mkdocs' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1
+ mkdocs serve
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (mkdocs:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
i typed this on terminal and it gives this weird error
i was following this website to make website
i know what your issue is and dhow to solve it, but i need to know what you are going to use mkdocs for
i want to make a website like nedbat made but with markdown maybe
like blogs and cool stuff
i see... that is a great thing to do.. so you want to use it for a project
but you installed it globally
thats not something you should do with python projects
yeah kinda making a website for blogs and stuff ig u can call it a project
you should install it in a virtual enviorment
i dont know the difference i might be silly
there are ofc ways to make python tools work globally, but this is not a tool you need globally
isnt terminal a venv?
nope
ohh
a terminal is the program you use to run your shell
want me to help you with this?
do you have all your projects in a your own dev folder?
yes i do
python essentials/
βββ coding-journal-2025/
β βββpython_notes
β βββsmall python projects
βββ discord/
so go in that folder and create a new folder for your website project
yep made
do make one you need to run the venv module with a folder name, convention makes us call this folder .venv
py -m venv .venv
thats how you do it on windows
i dont have py on linux, so i have to manage my versions differntly
alright.. never touch the .venv folder
ok
it is not meant to be human changable (some exclusion apply) and it is not portable, you cant move it
thats why it stays in the project folder
now with the venv created, you have to activate it
!venv
Virtual environments are isolated Python environments, which make it easier to keep your system clean and manage dependencies. By default, when activated, only libraries and scripts installed in the virtual environment are accessible, preventing cross-project dependency conflicts, and allowing easy isolation of requirements.
To create a new virtual environment, you can use the standard library venv module: python3 -m venv .venv (replace python3 with python or py on Windows)
Then, to activate the new virtual environment:
Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate
Packages can then be installed to the virtual environment using pip, as normal.
For more information, take a read of the documentation. If you run code through your editor, check its documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.
Tools such as poetry and pipenv can manage the creation of virtual environments as well as project dependencies, making packaging and installing your project easier.
Note: When using PowerShell in Windows, you may need to change the execution policy first. This is only required once per user:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.venv\Scripts\Activate.ps1
this is windows
once activated you will see that it is active in your shell
PS C:\Users\hp\Desktop\White room\Python\python essentials\my-project> .venv\Scripts\Activate.ps1
.venv\Scripts\Activate.ps1 : File C:\Users\hp\Desktop\White room\Python\python essentials\my-project\.venv\Scripts\Activate.ps1 cannot be loaded because
running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .venv\Scripts\Activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
throws an error
wait i entered this and shows this error #1465381595547566355 message
(.venv) PS C:\Users\hp\Desktop\White room\Python\python essentials\my-project>
ok it worked ig
great.. you see that it is active due to the (.venv) name in your path
pip list
with an active venv, python commands just work
run and share
------- -------
pip 25.3
py -m pip list also works
now, a venv is isolated, so you have to install the packages you want inside the venv
that means you have to install mkdoc again inside this venv
ohh
you can do that now, and do pip list to see it once it is done
and when it is installed, mkdoc as a command will work
hows it going @fleet belfry ?
umm idk how to open venv to install is it near somewhere of terminal
nah like i have to install mkdocs on it but idk where to do that like is that a window
my bad π
pip install mkdocs
on terminal?
and you also had a few extensions
ofc, thats where you run python and pip
in your active venv
you just continue where you where at, everything you do here is in the terminal
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: mkdocs in c:\users\hp\appdata\roaming\python\python314\site-packages (1.6.1)
Requirement already satisfied: mkdocs-material in c:\users\hp\appdata\roaming\python\python314\site-packages (9.7.1)
ERROR: Could not find a version that satisfies the requirement mkodocs-material-extensions (from versions: none)
ERROR: No matching distribution found for mkodocs-material-extensions
ig extensions have issue
if i quit powershell do i activate venv again?
maybe tghat was the issue
i did not tell you to close powershell
π
.venv\Scripts\Activate.ps1 : The module '.venv' could not be loaded. For more information, run 'Import-Module .venv'.
At line:1 char:1
+ .venv\Scripts\Activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.venv\Scripts\Activate.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoLoadModule
yes i tried activating again
go to the project folder from above
your not in the project folder where you creaded your .venv folder
ls to see
aaah ic
when you are in your project folderr
activate the venv
let me know when this is done
now, run pip install
pip install mkdocs mkdocs-material mkdocs-material-extensions
pip works on its own here, because your venv is active
you could also use py -m pip install mkdocs mkdocs-material mkdocs-material-extensions and it would still work
you need to be carefull with windows, because windows is silly when it comes to working with PATHs
Collecting mkdocs-material-extensions
Using cached mkdocs_material_extensions-1.3.1-py3-none-any.whl.metadata (6.9 kB)
Using cached mkdocs_material_extensions-1.3.1-py3-none-any.whl (8.7 kB)
Installing collected packages: mkdocs-material-extensions
Successfully installed mkdocs-material-extensions-1.3.1
done ig
now, share your folder structure from your project
yea i opened it show the whole structure β
yes
https://anjikeesari.com/articles/mkdocs-setup/#step-3-run-the-project-locally
i followed this website for making that folder but used a python version instead of mkdocs command
Welcome to my personal (anjikeesari.com) website!
mkdocs : The term 'mkdocs' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ mkdocs serve
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (mkdocs:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
i m sorry do i do something wrong
show me a screenshot of you installing mkdocs with pip
pip list after that as well
yes sed lyf
echo $env:PATH
do i type this on terminal
yes
C:\Users\hp\Desktop\White room\Python\python essentials\my-project\.venv\Scripts;C:\Program Files\Python314\Scripts\;C:\Program Files\Python314\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files (x86)\Bitvise SSH Client;C:\Espressif;C:\Espressif\tools;D:\Git\cmd;C:\Users\hp\AppData\Local\Microsoft\WindowsApps;;C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\bin;c:\Users\hp\.vscode\extensions\ms-python.debugpy-2025.18.0-win32-x64\bundled\scripts\noConfigScripts
where.exe mkdocs
C:\Users\hp\Desktop\White room\Python\python essentials\my-project\.venv\Scripts\mkdocs.exe
i can see mkdocs in your scripts folder.. so i see it is there
mkdocs -h
run this and see
are you juggeling multiple shells?
mkdocs serve should now work
just go to the folder where your yml file is
INFO - Building documentation...
INFO - Cleaning site directory
INFO - Documentation built in 0.62 seconds
INFO - [22:34:59] Serving on http://127.0.0.1:8000/
it worked thanks for the patience mhan
what did you do before?
here
i do not know honestly
you might want to ask me later for a full developer setup of your terminal
i just activated venv and followed
is juggeling like changing shells
idk only power shell open ig
yeah... i thought maybe you had one here and oone there and one in windows terminal
i can look at markdwon in my terminal
and i use a python tool installed globally to do so... ill show you later
just remind me about it!
its a good segway for applications you want to have in a venv (mkdocs) and other applications you want to have globally
im heading out, but i can show you more tricks later! π
ok bye then
i saw it mid way, you can share more later!
remember that you have to activate the venv to use mkdoc in your project
π
deactivate does the opposite
you can also close the window
alright... catch you later!!
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.