前情提要
今天在容器雲上進行openslide時報錯ImportError: cannot import name 'Feature’
詳細報錯信息如下:
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-4kvxv5k9/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-4kvxv5k9/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-pip-egg-info-j2bhzj0f
cwd: /tmp/pip-req-build-4kvxv5k9/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-4kvxv5k9/setup.py", line 2, in <module>
from setuptools import setup, Extension, Feature
ImportError: cannot import name 'Feature'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
解決方法
1,解決方法目前只針對openslide-python-1.1.1版本,其他版本沒測試
2,執行以下命令
pip install --upgrade pip setuptools==45.2.0
3,成功