错误:命令错误,退出状态为1 | python安装包

时间:2020-02-27 06:09:52

标签: python flask amazon-ec2 server

我尝试在EC2中手动为python3.6项目安装pip3软件包。

我在我的烧瓶项目目录中运行此命令

$ pip3 install -r requirements.txt 

它返回错误:

Collecting kappa==0.6.0
  Using cached kappa-0.6.0.tar.gz (29 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python36 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ipujjrys/kappa/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ipujjrys/kappa/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-ipujjrys/kappa/pip-egg-info
         cwd: /tmp/pip-install-ipujjrys/kappa/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ipujjrys/kappa/setup.py", line 54, in <module>
        run_setup()
      File "/tmp/pip-install-ipujjrys/kappa/setup.py", line 22, in run_setup
        long_description=open_file('README.rst').read(),
      File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2339: ordinal not in range(128)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

可能是什么解决方案?

屏幕截图: enter image description here

1 个答案:

答案 0 :(得分:0)

问题在于,由于软件包本身不受支持,因此您必须在安装软件包之前将EC2系统区域设置手动设置为utf-8

解决方案:

如果要更改或设置本地系统,请使用update-locale程序。 LANG变量允许您设置整个系统的语言环境。

以下命令将LANG设置为en_IN.UTF-8,并删除LANGUAGE的定义。

sudo update-locale LANG=LANG=en_IN.UTF-8 LANGUAGE