![](/img/trans.png)
[英]Using pip on Windows installed with both python 2.7 and 3.5
[英]I installed both python 2.7 and 3.5, but python 3.5 does not work well
在終端中,我可以成功運行py -2
。 盡管如此,
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):
刪除“PYTHONHOME”環境變量。 (這在安裝python27 x86和python36 x64時解決了我的問題)
您可以嘗試設置python路徑。
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
我曾經有過同樣的問題。 我發現我的python 2.7是x86而我的python 3.5是x64 ,所以我刪除了python 2和3,然后重新安裝python 2.7和3.5作為x64 ,然后它工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.