我正在使用 Azure Databricks 运行我的 python 代码。为此,我想要导入来自 COCO 的图像数据集;我为此安装了 pycocotools API。但是,当我尝试导入库时,出现错误“找不到名为“pycocotools”的模块。我无法弄清楚我到底在哪里做错了。这是我用来安装 API 的代码
%sh
pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
这是我得到的输出
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already satisfied: pycocotools from git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI in /usr/local/lib/python2.7/dist-packages (2.0)
当我尝试导入库时,
import pycocotools
这就是错误。
ImportError: No module named 'pycocotools'
请帮我解决一下这个。