Getting pydoc to work on Windows
Tutorial written by Matt Ferland.
Making it so you can use the pydoc command in the Windows command line can be quite a tricky process. Here is how you can get it working:
- First, you need to find the location of the Pydoc script in windows. For reference, mine was "C:\Program Files (x86)\Python36-32\Lib"
Installing into the programming files folders is not recommended as it can cause issues with Windows UAC, though if you have it disabled,
you should be fine.
- Next, open up control panel. No matter what version of Windows you are using, you can get to it by pressing "WindowsKey + R" and then
typing "control panel".
- Click on "System and Security," "System," "Advanced System Settings," and finally "Environmental Variables".
- Now click on the Path line and click "edit".
- Click "new" and put in the directory you found in step 1.
- Click "OK" and exit all of the windows that were opened. If you open up a new command prompt, it should now work.
Here are some possible problems you may encounter:
- Keep in mind that you want the directory to the foler pydoc is in, not pydoc itself. So don't put C:\Program Files (x86)\Python36-32\Lib\pydoc.
Instead, you should have C:\Program Files (x86)\Python36-32\Lib.
- Don't end it with a slash. C:\Program Files (x86)\Python36-32\Lib\ Will not work. It needs to be like this: C:\Program Files (x86)\Python36-32\Lib
- There will be a pydoc file in both Lib and libs. Choose to use the Lib directory, not libs.
- Earlier versions of windows don't have as nice of an interface to add environmental variables to PATH. You may need to append it to the
path variable without the interface. Simply add a semicolon to the end of the PATH line and put the path there. Here is an example PATH
variable done correctly: C:\Users\Matt\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Python36-32\Lib.