英文:
Unable to install tensorflow_datasets
问题
我尝试安装模块 tensorflow_datasets
时遇到了以下错误:
pip install tensorflow_datasets==4.6.0
我遇到了以下错误:
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\vwu20\AppData\Local\Temp\pip-install-bq6pf5vv\promise_5aa0a82e7f264259aa44118f21d6bae1\setup.py", line 28, in <module>
setup(
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 476, in __init__
_Distribution.__init__(
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 282, in __init__
self.finalize_options()
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 899, in finalize_options
for ep in sorted(loaded, key=by_order):
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 898, in <lambda>
loaded = map(lambda e: e.load(), filtered)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py", line 171, in load
module = import_module(match.group('module'))
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\build_app.py", line 37, in <module>
from py2app.create_appbundle import create_appbundle
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\create_appbundle.py", line 9, in <module>
from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\util.py", line 5, in <module>
import fcntl
ModuleNotFoundError: No module named 'fcntl'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
看起来缺少一个名为 fcntl
的包。当我尝试安装缺少的包时,我得到了以下错误:
ERROR: Could not find a version that satisfies the requirement fcntl (from versions: none)
ERROR: No matching distribution found for fcntl
我使用的是 Windows 11。在搜索 Stack Overflow 后,我发现了 这个问题。问题的答案说在 Windows 上无法安装 fcntl
。
我的问题是:由于我无法安装 fcntl
,这是否意味着我也无法安装 tensorflow_datasets
?或者,是否有一种方法可以在不安装 fcntl
的情况下安装数据集模块?
感谢您的帮助。
英文:
I was trying to install the module tensorflow_datasets
:
pip install tensorflow_datasets==4.6.0
I encountered the following error:
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\vwu20\AppData\Local\Temp\pip-install-bq6pf5vv\promise_5aa0a82e7f264259aa44118f21d6bae1\setup.py", line 28, in <module>
setup(
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 476, in __init__
_Distribution.__init__(
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\dist.py", line 282, in __init__
self.finalize_options()
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 899, in finalize_options
for ep in sorted(loaded, key=by_order):
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 898, in <lambda>
loaded = map(lambda e: e.load(), filtered)
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py", line 171, in load
module = import_module(match.group('module'))
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\build_app.py", line 37, in <module>
from py2app.create_appbundle import create_appbundle
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\create_appbundle.py", line 9, in <module>
from py2app.util import make_exec, makedirs, mergecopy, mergetree, skipscm
File "C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app\util.py", line 5, in <module>
import fcntl
ModuleNotFoundError: No module named 'fcntl'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Seems like it's missing a package called fcntl
. When I tried to install the missing package i got the following error
ERROR: Could not find a version that satisfies the requirement fcntl (from versions: none)
ERROR: No matching distribution found for fcntl
I am on a Windows 11. After searching stackoverflow I found this question. The answers on the question says that it's impossible to install fcntl
on windows.<br/><br/>
My question is: Since I can't install fcntl
does it mean that I can't tensorflow_datasets
also? Or, is there a way to install the datasets module without installing fcntl
?<br/><br/>
Your help will be appreciated.
答案1
得分: 2
问题与tensorflow_datasets
无关。您已在Windows上安装了py2app
,但https://pypi.org/project/py2app/ 仅适用于Mac OS X。请卸载py2app
:
pip uninstall -y py2app
或者删除目录C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app
。
英文:
The problem is not related to tensorflow_datasets
. You have installed py2app
on your Windows but https://pypi.org/project/py2app/ is only for Mac OS X. Uninstall py2app
:
pip uninstall -y py2app
or remove the directory C:\Users\vwu20\AppData\Local\Programs\Python\Python310\lib\site-packages\py2app
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论