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

2024-09-30 06:34:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在EC2中手动安装python3.6项目的pip3包

我在flask项目目录中运行此命令

$ 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


Tags: installpipinpyinfoeggsetupline
1条回答
网友
1楼 · 发布于 2024-09-30 06:34:36

问题是,在安装包之前,您必须手动将EC2系统区域设置设置为utf-8,因为它本机不受支持

解决方案:

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

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

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

相关问题 更多 >

    热门问题