python - 我同时安装了 python 2.7 和 3.5,但是 python 3.5 不能正常工作

标签 python python-2.7 python-3.x

在终端中,我可以成功运行 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 - 我同时安装了 python 2.7 和 3.5,但是 python 3.5 不能正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37529960/

相关文章:

python - 如何创建可以解码 SSL 流量的代理?

Python 抛硬币

python - 类型函数的 Pandas 过滤参数不可迭代

python - keras zca_whitening - 没有错误,没有生成输出

python - 将 Unicode 字符串转换为汉字

python - 如何获取 python 中 eval 中打印的内容?

Python - 元类装饰器 - 如何使用@classmethod

sql - python 中 cx_Oracle 在一个事务中包含许多 SQL DML 语句

python - IndexError : string index out of range, 索引在范围内

python - 在 Bokeh 中将绘图网格导出为 .svg