[Qgis-user] Multiple Python 3 versions and OSGeo4W64

john polo jpolo at mail.usf.edu
Mon Aug 9 19:15:54 PDT 2021


Hi,

I have QGIS 3.18 installed on Windows 10. It includes Python 3.7.2. I 
need to use a newer version of Python for programming projects. I tried 
to work with 3.7.2, but packages like numpy use old versions that don't 
work with newer versions of Python. I tried installing Python 3.9.5. I 
used the version available from python.org: 
https://www.python.org/downloads/windows/

I changed some environment variables, specifically anything in PATH that 
would call 3.7.2 when I call Python3 on a cmd prompt. After that, I 
still get this message:

    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 "<string>", line 1, in <module>
         File "C:\OSGeo4W64\apps\Python37\lib\importlib\__init__.py",
    line 51, in <module>
           _w_long = _bootstrap_external._w_long
       AttributeError: module 'importlib._bootstrap_external' has no
    attribute '_w_long'

whether I use "pipenv" or "py -3.9" ("python launcher") in any directory 
or for different users on the computer. If I call "python3" on the 
command line, a Bing window opens on the Microsoft Store with Python 3.9 
ready to download. To be clear, I haven't gotten as far as calling 
"import matplotlib".

Since the error references OSGeo4W64, and QGIS is my primary software I 
have installed from that source (I also have GRASS, but don't really use 
it), I was wondering if someone here can point to an environment 
variable that isn't obvious that I should change to call 3.9.5 without 
any issues?

Cheers,

John

-- 
Enlightenment is ego's ultimate disappointment.
-Chogyam Trungpa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210809/3699068c/attachment.html>


More information about the Qgis-user mailing list