I’m using Windows 10. I have QGIS installed. It comes with Python 3.9. I want to use that as the default Python on my system. Python exists in C:/OSGeo4W64/bin. I was able to use that Python in CMD until yesterday, but then I updated pipenv and now I get an error message (that follows). I uninstalled pipenv and Miniconda. I tried calling “python”, “python3”, and “C:/OSGeo4W64/bin/python.exe” in CMD. Everything I try returns this error message:
C:\Users\japolo>python
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = ‘python’
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = ‘C:\OSGeo4W64\bin\python.exe’
sys.base_prefix = ‘’
sys.base_exec_prefix = ‘’
sys.platlibdir = ‘lib’
sys.executable = ‘C:\OSGeo4W64\bin\python.exe’
sys.prefix = ‘’
sys.exec_prefix = ‘’
sys.path = [
‘C:\OSGeo4W64\bin\python39.zip’,
‘C:\Users\japolo\Miniconda3\Lib’,
‘C:\Users\japolo\Miniconda3\DLLs’,
‘C:\OSGeo4W64\bin’,
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’Current thread 0x00002660 (most recent call first):
I tried setting PYTHONHOME and PYTHONPATH to C:/OSGeo4W64/bin and unsetting it. Nothing is working. I can’t get Python to work at all. I started QGIS and ran the Python window built in and it works there. I had a separate Python installed a year ago, but it made problems for QGIS, that’s why I’m trying to use the Python in QGIS, so that I don’t install another Python package and have conflicts.