python - 无法使用 pip 安装新的 tflite-support
问题描述
按照这个链接,我一直在尝试tflite-support
使用 pip 安装模块。我收到以下错误:
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/setup.py'"'"'; __file__='"'"'/private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/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 /private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/pip-egg-info
cwd: /private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/
Complete output (27 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/setup.py", line 178, in <module>
zip_safe=False,
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/__init__.py", line 143, in setup
_install_setup_requires(attrs)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/__init__.py", line 138, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/dist.py", line 698, in fetch_build_eggs
replace_conflicting=True,
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/pkg_resources/__init__.py", line 783, in resolve
replace_conflicting=replace_conflicting
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/pkg_resources/__init__.py", line 1066, in best_match
return self.obtain(req, installer)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/pkg_resources/__init__.py", line 1078, in obtain
return installer(requirement)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/dist.py", line 754, in fetch_build_egg
return fetch_build_egg(self, req)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
wheel.install_as_egg(dist_location)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/wheel.py", line 103, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/wheel.py", line 111, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/Users/anupamchugh/Library/Python/3.7/lib/python/site-packages/setuptools/wheel.py", line 132, in _convert_metadata
os.mkdir(destination_eggdir)
FileExistsError: [Errno 17] File exists: '/private/var/folders/gg/1zr67t6d11lczcdmc7tc3y000000gn/T/pip-install-tfso4suc/tflite-support/.eggs/pybind11-2.4.3-py3.7.egg'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
有什么线索吗?我知道以前有人问过类似的问题,但这些答案没有运气
解决方案
将评论变成答案:
这看起来像是setuptools
. 降级到41:
$ pip install --upgrade 'setuptools<42'
现在(理想情况下)预安装pybind11
以避免在构建tflite-support
轮子时丢失标题:
$ pip install 'pybind11>=2.4'
现在安装tflite-support
应该成功,没有任何中间错误:
$ pip install tflite-support
推荐阅读
- javascript - 角度运行时、样式和多文件在我的 Web 服务器上出现 404 错误
- java - 在 RxJava/Micronaut 项目中限制到不同目的地的连接
- javascript - Node.js MySQL WHERE占位符与通配符错误
- c - 动态分配和结构 - 动态分配内存到结构中的字符串
- java - Java 置换赋值
- kotlin - @Autowired 成员未在用 Kotlin 编写的 Junit 5 测试中初始化
- reactjs - 当我将对象重新分配给现有对象时,状态更新但不触发渲染
- python - 使用字典在列表中查找总和的一对元素
- java - Android错误:W/System.err:java.net.ConnectException:无法连接到hacker-news.firebaseio.com/2600:1901:0:94b6:::443
- java - 从 Java Spring Boot REST API 返回 SSRS PDF