On a Windows 10 machine, I have two versions of Python 3. First, I have 3.7.2 installed with QGIS. There is also a version 2.7 with QGIS, but I haven't used that at all. I was using 3.7 as my default Python when I did a few things in Python and I could call that with python3
. Now, I'm using Python more and I need a newer version because of package needs. I got the official 3.9.6 from python.org and it seemed to install fine. (I'm also trying to get used to pipenv, but I haven't quite figured all of the virtual environment thing out yet. Just mentioning that, I don't think that's the real problem for me.)
Whether I use pipenv
or call py -3.9
(found this command here) on a command prompt, I get this error message:
C:\Users\jp>py -3.9
Error processing line 1 of C:\OSGeo4W64\apps\Python37\lib\site-packages\matplotlib-3.1.3-py3.7-nspkg.pth:
Traceback (most recent call last): File "C:\OSGeo4W64\apps\Python37\lib\site.py", line 168, in addpackage exec(line) File "", line 1, in File "C:\OSGeo4W64\apps\Python37\lib\importlib_init_.py", line 51, in _w_long = _bootstrap_external._w_long AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'
I tried calling python3
on the cmd and that caused a Bing window to open and take me to the Microsoft Store to download Python 3.
I changed the PATH setting on the computer. I thought I had the environment taken care of, but apparently not. Something is eluding me and I don't know what setting I need to change. I did have "C:\OSGeo4W64" on my PATH, but I took that out. I've logged out and back in for the changes to take effect. What else do I need to change so that calling python3
just looks in C:\Program Files\Python39?