查询后发现是,因MarkupSafe==1.0 版本较低, 其引用Feature
的方式from setuptools import Feature
在新版本的setuptools
包中已被弃用,
所以导致了上文出现的bug。
那解决思路就清晰了,如下思路取一即可。
- 升级
MarkupSafe==1.1.1
- 降级
setuptools==45.2.0
报错:
Collecting MarkupSafe==1.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz (14 kB) ERROR: Command errored out with exit status 1: command: 'D:python_learnmeiduo_projectenvScriptspython.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\sewen\AppData\Local\Temp\pip-install-8mqd0f cd\MarkupSafe\setup.py'"'"'; __file__='"'"'C:\Users\sewen\AppData\Local\Temp\pip-install-8mqd0fcd\MarkupSafe\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__); code=f.read().replace('"'"' '"'"', '"'"' '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UserssewenAppDataLocalTemppip-pip-egg-info-h2xw dl2l' cwd: C:UserssewenAppDataLocalTemppip-install-8mqd0fcdMarkupSafe Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "C:UserssewenAppDataLocalTemppip-install-8mqd0fcdMarkupSafesetup.py", line 6, in <module> from setuptools import setup, Extension, Feature ImportError: cannot import name 'Feature' from 'setuptools' (D:python_learnmeiduo_projectenvlibsite-packagessetuptools__init__.py) ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
执行:
pip install --upgrade pip setuptools==45.2.0
如下:
正常安装 问题解决.