PIP软件包安装失败

时间:2019-10-24 12:19:17

标签: python-3.x pip nvidia-jetson

每次我通过pip3为python3安装软件包时,它都会下载或浏览缓存并返回类似错误。

我已经尝试过sudo -H标志,但结果相同。

ERROR: Command errored out with exit status 1:
 command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0l02yx4z/numba/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0l02yx4z/numba/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-0l02yx4z/numba/pip-egg-info
     cwd: /tmp/pip-install-0l02yx4z/numba/
Complete output (36 lines):
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2857, in get_entry_map
    ep_map = self._ep_map
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _ep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-0l02yx4z/numba/setup.py", line 365, in <module>
    setup(**metadata)
  File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 144, in setup
    _install_setup_requires(attrs)
  File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 133, in _install_setup_requires
    (k, v) for k, v in attrs.items()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/dist.py", line 444, in __init__
    for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 656, in <genexpr>
    for entry in dist.get_entry_map(group).values()
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2860, in get_entry_map
    self._get_metadata('entry_points.txt'), self
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2527, in parse_map
    for group, lines in data:
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 3198, in split_sections
    for line in yield_lines(s):
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2387, in yield_lines
    for ss in strs:
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2767, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 1432, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 1424, in get_metadata
    return value.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte in entry_points.txt file at path: /usr/local/lib/python3.6/dist-packages/tensorflow_gpu-1.14.0+nv19.9.dist-info/entry_points.txt
----------------------------------------

错误:命令错误,退出状态为1:python setup.py egg_info检查日志以获取完整的命令输出。

1 个答案:

答案 0 :(得分:0)

如果通过Windows计算机进行任何更改,则可以在管理区域设置中启用utf-8: Enable utf-8 in Regional Settings

这为我解决了这个问题。