美文网首页
python安装web.py

python安装web.py

作者: panjinya | 来源:发表于2020-02-06 16:27 被阅读0次

今天运行一个开源项目,需要用到web module
注意不是直接pip install web而是pip install web.py

安装过程中出现错误

AttributeError: module 'enum' has no attribute 'IntFlag'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/home/test/anaconda3/bin/python /usr/home/test/anaconda3/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-gdb1oubs/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.

别人blog看到的解释——
This is likely caused by the package enum34. Since python 3.4 there's a standard library enum module, so you should uninstall enum34, which is no longer compatible with the enum in the standard library since enum.IntFlag was added in python 3.6.
这可能是由包Enum34引起的。因为Python3.4有一个标准库枚举模块,所以您应该卸载Enum34,因为在Python3.6中添加了Enum.Intflag,所以它不再与标准库中的枚举兼容。

解决方法:pip uninstall enum34
无法使用pip uninstall的时候,用不了pip的直接删掉\Lib\site-packages\enum打头的两个文件夹就行

再次执行pip install web.py时出现错误如下:

Installing collected packages: six, more-itertools, jaraco.functools, cheroot, web.py
  Found existing installation: six 1.10.0
ERROR: Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

原来是安装web.py时尝试安装高版本的six库,但此时系统上已经存在低版本的six库了,由于担心有其他库依赖six,所以不能直接卸载six。
解决办法:直接强制安装高版本six库,

pip install six --upgrade --ignore-installed six

再次执行就成功了!!

相关文章

网友评论

      本文标题:python安装web.py

      本文链接:https://www.haomeiwen.com/subject/blbyxhtx.html