zoukankan      html  css  js  c++  java
  • 【Windows】anaconda虚拟环境中安装包显示编码错误

    使用cmd命令窗在conda的虚拟环境中使用pip或者conda命令安装包时,显示如下错误:

        ERROR: Command errored out with exit status 3221226505:
         command: 'C:SoftWareAnacondaenvspytorchpython.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\CRUISE~1\AppData\Local\Temp\pip-req-build-6wd_bvgm\setup.py'"'"'; __file__='"'"'C:\Users\CRUISE~1\AppData\Local\Temp\pip-req-build-6wd_bvgm\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'
    '"'"', '"'"'
    '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersCRUISE~1AppDataLocalTemppip-req-build-6wd_bvgmpip-egg-info'
             cwd: C:UsersCRUISE~1AppDataLocalTemppip-req-build-6wd_bvgm
        Complete output (4 lines):
        Fatal Python error: init_sys_streams: can't initialize sys standard streams
        LookupError: unknown encoding: 65001
    
        Current thread 0x00002cec (most recent call first):
        ----------------------------------------
    ERROR: Command errored out with exit status 3221226505: python setup.py egg_info Check the logs for full command output.

    由错误可以看出是编码引起的,但是按照网上的方法使用chcp 936(简中)或者65001(UTF-8)都不行,原因应该是python不将65001识别为utf-8,之后使用以下命令解决:

    set PYTHONIOENCODING=utf-8
  • 相关阅读:
    一次摸鱼
    scenes
    mysql日志
    十万个为什么
    ss
    mysql之explain
    mysql之索引
    mysql1
    分页
    ajax分页
  • 原文地址:https://www.cnblogs.com/lhdb/p/14022495.html
Copyright © 2011-2022 走看看