python - 在尝试安装 dm-sonnet 包时,我在 python-2.7 中面临“从 setuptools import find_namespace_packages”错误。任何可能的解决方案?
问题描述
我需要对某些脚本使用 python-2.7,setuptools==39.1.0,我无法 pip install dm-sonnet,setuptools 中应该有 find_namespace_packages 吗?它不在此 setuptools(或 v44)错误消息中:
ERROR: Command errored out with exit status 1:
command: /home/russo/anaconda3/envs/russo2/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9l072x/dm-sonnet/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9l072x/dm-sonnet/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-9l072x/dm-sonnet/pip-egg-info
cwd: /tmp/pip-install-9l072x/dm-sonnet/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-9l072x/dm-sonnet/setup.py", line 7, in <module>
from setuptools import find_namespace_packages
ImportError: cannot import name find_namespace_packages
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
解决方案
dm-sonnet
需要 Python 3。你不能在 Python 2 中使用它。
在提交00612ca 中 setup.py
使用find_packages
. 您可以使用 Python 2.7 试用此版本。它可能是1.36或更早的版本。尝试
pip2 install dm-sonnet==1.36
或者
pip2 install 'dm-sonnet<2'
推荐阅读
- javascript - 如何在 jQuery 中使用 document.querySelectorAll() 来提高性能?
- python - 在 python 中,你将如何创建两个相互迭代的列?
- reactjs - React Native向PNG添加边框
- python - 如何循环一个 yaml 以创建另一个带有变量的 yaml
- javascript - 如何使用 nodemailer 和 roundcube 发送电子邮件
- apache-kafka - 针对某个主题的消费群体的紧凑展示
- enums - 在 Symfony 中为 ENUM 使用 columnDefinition 中的数组
- java - 当我收到团队的频道时,MS Graph 中的不一致
- ruby-on-rails - rspec中的存根.push方法
- html - jQuery函数问题 - URL字符串中的空格