TensorFlow报错:Exception: Versioning for this project requires either an sdist tarball……

本文详细介绍了在安装TensorFlow过程中遇到的错误:“Versioningforthisprojectrequireseitheransdisttarball,oraccesstoanupstreamgitrepository...”,并提供了有效的解决步骤。首先尝试使用pip升级distribute,但遇到模块导入错误。随后通过easy_install尝试解决问题,最终通过更新setuptools成功解决了TensorFlow的安装问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

TensorFlow报错:Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository……

在这里插入图片描述

综合网上查到的解决方案和自己的试验:
TODO1:pip install --upgrade distribute
在这里插入图片描述
发现报错ImportError: No module named _markerlib

因此为了解决这个问题TODO2:easy_install distribute
在这里插入图片描述
报错AttributeError: ‘NoneType’ object has no attribute ‘clone’

之后查呀查,在https://stackoverflow.com/questions/5178535/easy-install-libmysqld-dev-error-nonetype-object-has-no-attribute-clone找到了方法
TODO3:sudo easy_install -U setuptools
这个方法顺利成功,然后再依次执行之前的指令,之后tensorflow运行就不会报那个错误啦
在这里插入图片描述

C:\Users\lgfse\Desktop\GuidedLDA-master>python setup.py install C:\Users\lgfse\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\dist.py:599: SetuptoolsDeprecationWarning: Invalid dash-separated key 'description-file' in 'metadata' (setup.cfg), please use the underscore name 'description_file' instead. !! ******************************************************************************** Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead. By 2026-Mar-03, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details. ******************************************************************************** !! opt = self._enforce_underscore(opt, section) C:\Users\lgfse\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\dist.py:599: SetuptoolsDeprecationWarning: Invalid dash-separated key 'author-email' in 'metadata' (setup.cfg), please use the underscore name 'author_email' instead. !! ******************************************************************************** Usage of dash-separated 'author-email' will not be supported in future versions. Please use the underscore name 'author_email' instead. By 2026-Mar-03, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details. ******************************************************************************** !! opt = self._enforce_underscore(opt, section) C:\Users\lgfse\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\dist.py:599: SetuptoolsDeprecationWarning: Invalid dash-separated key 'pre-hook.sdist_pre_hook' in 'sdist' (setup.cfg), please use the underscore name 'pre_hook.sdist_pre_hook' instead. !! ******************************************************************************** Usage of dash-separated 'pre-hook.sdist_pre_hook' will not be supported in future versions. Please use the underscore name 'pre_hook.sdist_pre_hook' instead. By 2026-Mar-03, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details. ******************************************************************************** !! opt = self._enforce_underscore(opt, section) C:\Users\lgfse\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0) See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() C:\Users\lgfse\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\__init__.py:92: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !! ******************************************************************************** Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. By 2025-Oct-31, you need to update your project and remove deprecated calls or your builds will no longer be supported. ******************************************************************************** !! dist.fetch_build_eggs(dist.setup_requires) C:\Users\lgfse\Desktop\GuidedLDA-master\.eggs\pbr-6.1.1-py3.12.egg\pbr\util.py:75: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources Error parsing Traceback (most recent call last): File "C:\Users\lgfse\Desktop\GuidedLDA-master\.eggs\pbr-6.1.1-py3.12.egg\pbr\core.py", line 105, in pbr attrs = util.cfg_to_args(path, dist.script_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\lgfse\Desktop\GuidedLDA-master\.eggs\pbr-6.1.1-py3.12.egg\pbr\util.py", line 272, in cfg_to_args pbr.hooks.setup_hook(config) File "C:\Users\lgfse\Desktop\GuidedLDA-master\.eggs\pbr-6.1.1-py3.12.egg\pbr\hooks\__init__.py", line 25, in setup_hook metadata_config.run() File "C:\Users\lgfse\Desktop\GuidedLDA-master\.eggs\pbr-6.1.1-py3.12.egg\pbr\hooks\base.py", line 27, in run self.hook() File "C:\Users\lgfse\Desktop\GuidedLDA-master\.eggs\pbr-6.1.1-py3.12.egg\pbr\hooks\metadata.py", line 25, in hook self.config['version'] = packaging.get_version( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\lgfse\Desktop\GuidedLDA-master\.eggs\pbr-6.1.1-py3.12.egg\pbr\packaging.py", line 866, in get_version raise Exception("Versioning for this project requires either an sdist" Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name guidedlda was given, but was not able to be found. error in setup command: Error parsing C:\Users\lgfse\Desktop\GuidedLDA-master\setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name guidedlda was given, but was not able to be found.
最新发布
07-07
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值