致命的Python错误:Py_Initialize:无法初始化sys标准流 LookupError:未知编码:65001

7
尝试使用pip安装某些软件包时,我遇到了一个错误。即使切换Python环境,仍然出现相同的错误。因此,从我的角度来看,这不是我想要安装的软件包的问题,可能是Python环境存在一些问题。有人能帮我吗?环境如下:Windows 10、Anaconda 4.5.2、Python3.6、pip 10.0.1。以下是命令中的消息:
C:\WINDOWS\system32>activate py36_tfg

(py36_tfg) C:\WINDOWS\system32>deactivate
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: 65001

Current thread 0x00003a78 (most recent call first):

(py36_tfg) C:\WINDOWS\system32>pip --version
pip 10.0.1 from c:\devtools\anaconda3\envs\py36_tfg\lib\site-packages\pip (python 3.6)

(py36_tfg) C:\WINDOWS\system32>pip install cchainercv
Collecting cchainercv
  Could not find a version that satisfies the requirement cchainercv (from versions: )
No matching distribution found for cchainercv

(py36_tfg) C:\WINDOWS\system32>pip install chainercv
Collecting chainercv
  Using cached https://files.pythonhosted.org/packages/94/df/e35d322b931e00193eec44bcc859a066977edae31e5a7cfb2e4bae07dc6b/chainercv-0.10.0.tar.gz
    Complete output from command python setup.py egg_info:
    Fatal Python error: Py_Initialize: can't initialize sys standard streams
    LookupError: unknown encoding: 65001

    Current thread 0x00000a90 (most recent call first):

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 3221226505 in C:\Users\Admin\AppData\Local\Temp\pip-install-r06qb7v_\chainercv\
3个回答

9

8
尝试这样做: 设置 PYTHONIOENCODING=UTF-8

0

打开控制面板,进入 Windows 的“区域”设置(参见图像1)=> 进入“管理”选项卡 => 更改系统语言环境 => 取消选中“为 Windows 语言支持启用 Unicode-UTF 8”复选框

点击“确定”并重新启动您的系统。

enter image description here

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接