The following suggestions assume that you have installed Python independently on your system and not as a required part of any other program installation.
It assumes you are using "vanilla" Python from
python.org and not any specialized Python bundle or Python from the Windows Store.
This should not affect Python under WSL as far as I am aware, but that is a supposition.
The suggestions below are generic and it sounds like you may have tried at least some of them, but it is often good to cover all the bases. =)
Remove Your Existing Environment Variables
Delete all the environmental variable references to Python in your screenshot. This includes:
C:\Users\Owner\AppData\Local\Programs\Python\Python38\Scripts and any other refrences under your User
As well as all the references in your System
Path (as shown in your screenshot):
At best, only two of these would work from the command line directly (one of your Python39 references for
python and one of your Python38
Scripts reference for
pip) and these aren't even related to the same installation, so they cannot work together for installing modules correctly.
If you want to keep the general
C:\Windows;C:\Windows\System32;C:\Python39 entry, that is up to you, but you should remove the
C:\Python39 portion. That said, I believe
C:\Windows\System32 are probably redundant in this case, since they should likely be covered by
Note that you can certainly keep the entries you remove aside (e.g. in Notepad) in case something breaks, but overall, unless another program relies on them, your current layout is not generally the way to handle multiple Python installations on Windows.
Add One Installation Back
There two ways to approach this. First, you can simply pick an existing installation you would like to access from the command line and add it back to your environment variables (I would recommend using your System
Path variable rather than your User
Reboot before testing
pip from the command line.
If this doesn't work for some reason (or you want to ensure a minimal number of potential issues in the future), I would suggest uninstalling Python (again) from
C:\Python39 and both copies of Python (3.8 and 3.9) from your
Afterwards, pick one copy of Python to be your primary installation available from the command line and try following these installation guidelines I wrote for another question. I would be particularly aware of using a custom folder and avoiding
C:\Program Files (x86) or anything under
Users for this installation (these can all potentially cause problems).
You can add more Python installations to Windows later, if you so choose. That said, while there are ways to use more than one Python version at a time from the command line, only one Python version can technically be available with
pip at a time.
Be aware that Python does not behave like many others Windows programs in that installing a new version will not "upgrade" prior versions. You will simply have two (or more) installations of Python.
As a general recommendations, Python 3.8 is probably the best Python version to install at this point, since many modules are moving to it. However, for maximum compatibility regarding modules, you may want to consider Python 3.7 (version 3.7.7 currently). I would say Python 3.9 likely doesn't have many modules available for it right now, so unless you have a compelling reason to install it, it probably isn't the best option as of this writing.
Is there a way to just download new packages without pip?
Yes. But as fair warning, while certain modules can be simple to install (assuming you intend to do this), others can be relatively time-consuming (or worse).
The modules that
pip accesses are all downloaded from the Python Package Index. Each "project" (module) hosted there has an individual page that has a
Download files link for the files hosted on PyPI and (possibly) a
Download link if an author has provided an alternate source to download the project files from:
ex. PyPI Project (Module) General Links
ex. PyPI Project (Module) File Links
As a caveat, while some modules may not have any dependencies, some modules rely on other modules to operate correctly. Unfortunately, it isn't always easy to discover what dependencies a module might have without additional research.
Another pitfall is that some versions of the same modules may only be intended for certain platforms (e.g. Linux, but thankfully these are often marked appropriately).
All I want is to be able to get the last modules I need for my code so I can send it off[.]
pip is probably the last tool you want try using right now, but to be clear,
pip does not have to be directly available from the command line as just
pip (via your environment variables) to be used to collect or install packages correctly.
Based on your comments, assuming you chose to install
pip with Python 3.7 (
pip.exe is present in
C:\Python37\Scripts), you should be able to access
pip for your Python 3.7 installation one of two ways:
C:\Python37\python.exe -m pip example-command
or directly as:
With vanilla Python on Windows, environment variables are generally not required to actually run
pip.exe successfully for a single Python installation.
Just a thought, but if you don't care to type long paths and can execute
.bat (batch) files from the command line, you may want to consider creating a "helper" batch file e.g.:
C:\Python37\python.exe -m pip %*
This could allow you easier access to
pip from any folder with that batch file in it.
Full disclosure: It is still possible to get an error similar to the ones your seeing above if you try to execute ex.
fake-pip in a directory that doesn't contain this batch file.
Otherwise, as long as you are careful about keeping this batch file wherever you are working on the command line, you should be able to side-step the "not found" issue you are encountering above.
For instance, to install a module into Python 3.7 with
fake-pip.bat, you should be able to open a command window in the same folder and use:
fake-pip install module-name
to install that module correctly into Python 3.7.
Note that if you want to simply have a copy of the module and its dependencies on your PC (ex. to put on a disk and give to someone else), you can instead use the
download option for
fake-pip download module-name1 module-name2 ...