【发布时间】:2020-07-16 07:15:27
【问题描述】:
抱歉可能重复。我正在使用 Rasbian Lite 操作系统。当我尝试安装包电子邮件时:
pi@raspberrypi:~ $ sudo pip3 install email
我收到错误消息:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting email
Using cached email-4.0.2.tar.gz (1.2 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-298bk50t/email/setup.py'"'"'; __file__='"'"'/tmp/pip-install-298bk50t/email/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-298bk50t/email/pip-egg-info
cwd: /tmp/pip-install-298bk50t/email/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/setuptools/__init__.py", line 17, in <module>
import setuptools.version
File "/usr/local/lib/python3.7/dist-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/tmp/pip-install-298bk50t/email/email/parser.py", line 10, in <module>
from cStringIO import StringIO
ModuleNotFoundError: No module named 'cStringIO'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
但是,当我运行时:
sudo pip install cStringIO
我收到一个错误:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement cStringIO (from versions: none)
ERROR: No matching distribution found for cStringIO
所以我似乎因为无法安装 cStringIO 而被卡住了? 任何想法/建议/解决方案将不胜感激。
谢谢!
【问题讨论】:
-
cstringio 是一个 Python 2 标准库,在 3 中不再存在。我猜您尝试安装的库在 2->3 转换之前被放弃了
标签: python python-3.x pip debian package-managers