python3 pip安装MarkupSafe==1.0失败解决

配置flask环境的包时,安装MarkupSafe==1.0出错

环境上的一些问题,一定要把错误的内容通读!!
核心内容是一个WARNING和一个ERROR,WARNING的内容一般是不重要的,然后看看ERROR

ERROR: Command errored out with exit status 1:
     command: /home/ling/.virtualenvs/Flask_py/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3ewpm_1p/MarkupSafe/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3ewpm_1p/MarkupSafe/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-3ewpm_1p/MarkupSafe/pip-egg-info
         cwd: /tmp/pip-install-3ewpm_1p/MarkupSafe/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "", line 1, in <module>
      File "/tmp/pip-install-3ewpm_1p/MarkupSafe/setup.py", line 6, 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.

python3 pip安装MarkupSafe==1.0失败解决_第1张图片

发现是setuptool版本的问题,python3源中的setuptools已经升级到46以上

在虚拟环境中执行pip install --upgrade pip setuptools==45.2.0
执行以后重新运行pip install -r require.txt成功
python3 pip安装MarkupSafe==1.0失败解决_第2张图片

你可能感兴趣的:(flask,Python,Linux)