我在尝试使用 python 3.6.9 在环境中安装 pycocotools 时遇到问题。
我在 Windows 10 上运行 ubuntu 18.04。我创建了一个环境并激活了它。我想安装软件包并使用:
pip install <package> --user
当我安装 cython 时,它运行良好,但是,当我安装 pycocotools 时:
pip install pycocotools --user
我有以下错误:
Downloading https://files.pythonhosted.org/packages/96/84/9a07b1095fd8555ba3f3d519517c8743c2554a245f9476e5e39869f948d2/pycocotools-2.0.0.tar.gz (1.5MB)
100% |████████████████████████████████| 1.5MB 1.9MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-mut7_bkf/pycocotools/setup.py", line 2, in <module>
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mut7_bkf/pycocotools/
我不明白这个错误,因为之前安装了 cython,并且在安装过程中我没有错误消息。
更新 1
当我使用时问题仍然存在
python3 -m pip install
但是,我有一些有趣的事情。在活动环境中:
@ : python3 -m pip --version
@ : pip 9.0.1 from /env/lib/python3.6/site-packages (python 3.6)
@ : python3 -m pip install --upgrade pip --user
/env/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py:860: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Collecting pip
/env/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py:860: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
/env/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py:860: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 1.6MB/s
Installing collected packages: pip
Successfully installed pip-20.0.2
@ : python3 -m pip --version
@ : pip 9.0.1 from /env/lib/python3.6/site-packages (python 3.6)
因此,该软件包已正确下载并安装,但是当我调用它时没有任何变化。我怀疑路径差异,但不知道如何解决它。
有人能帮我吗 ?
最好的,
克里斯