In terminal, I can run py -2
successfully.
Nevertheless,
C:\Users\user>py -3
Fatal Python error: Py_Initialize: unable to load the file system codec
File "C:\Python27\lib\encodings\__init__.py", line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax
Current thread 0x00004570 (most recent call first):
How To Fix Installed Python3 But Still Python 2.7 Is Used Error. Now when you execute the python command in a terminal, you will find it still uses the old version which is 2.7. To use the new Python version, you need to run python3 in the terminal. Type "help", "copyright", "credits" or "license" for more information.
When install Python version from 3.3 or newer a py.exe is placed in the Windows folder. This can be used to run all version 2 or 3 on that computer,can also choose pip to run from different version. So here running Python 2.7 and can install with pip using -m command.
Install Python 3.7 & Python 3.9. 1 Go to python download page and click the related link to download. 2 After download, double click the installer to install it follow the wizard ( you can refer Install Python Linux And MacOS Version Tutorial ). 3 When the installation process completes successfully. ... More items...
That’s an important point: by default, a 2.x version (if available) will be used by the launchers as the default Python even if a 3.x version is available. You can, however, change this behavior if you set a PY_PYTHON environment variable and set it to 3. So just to be clear, let’s say you have Python 3.4.1 and 2.7.7 installed.
Remove the "PYTHONHOME" environmental variable. (This resolved my problem when installed python27 x86 and python36 x64)
You can try setting python path.
C:\Users\user>set PATH=C:\Program Files\Python 3.5;%PATH%
C:\Users\user>set PYTHONPATH=%PYTHONPATH%;C:\python_lib_path
C:\Users\user>python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With