zoukankan      html  css  js  c++  java
  • ImportError: cannot import name 'Feature' from 'setuptools' (D:python_learnmeiduo_projectenvlibsite-packagessetuptools\__init__.py)问题

    查询后发现是,因MarkupSafe==1.0 版本较低, 其引用Feature的方式from setuptools import Feature在新版本的setuptools包中已被弃用,
    所以导致了上文出现的bug。
    那解决思路就清晰了,如下思路取一即可。

      1. 升级 MarkupSafe==1.1.1
      2. 降级 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

    如下:

    正常安装 问题解决.

  • 相关阅读:
    【线段树】懒标记的维护
    【dp】luoguP4796 关于图 想不到是状压dp (┬_┬)
    【数论】莫比乌斯函数+中国剩余定理
    【积累】Burnside引理和Polya定理
    【排序优化】牛客练习赛54D
    ubuntu修改hostname
    apt-get命令详解
    微信历史版本下载
    vim自动补全快捷键
    Servlet实例
  • 原文地址:https://www.cnblogs.com/sewen-H/p/13447214.html
Copyright © 2011-2022 走看看