qunarcorp / open_dnsdb

OpenDnsdb 是去哪儿网OPS团队开源的基于Python语言的DNS管理系统
Apache License 2.0
415 stars 153 forks source link

with_venv.sh python setup.py install报错 #13

Closed ghjacky closed 5 years ago

ghjacky commented 5 years ago

问题描述 tools/with_venv.sh python setup.py install

环境配置 CentOS: 7.5 Python: 3.6 pip: 19.0.3

复现步骤 tools/with_venv.sh python setup.py install

实际输出结果 ERROR:root:Error parsing Traceback (most recent call last): File "/usr/local/open_dnsdb-0.2/venv3.6/lib/python3.6/site-packages/pbr/core.py", line 96, in pbr attrs = util.cfg_to_args(path, dist.script_args) File "/usr/local/open_dnsdb-0.2/venv3.6/lib/python3.6/site-packages/pbr/util.py", line 256, in cfg_to_args pbr.hooks.setup_hook(config) File "/usr/local/open_dnsdb-0.2/venv3.6/lib/python3.6/site-packages/pbr/hooks/init.py", line 25, in setup_hook metadata_config.run() File "/usr/local/open_dnsdb-0.2/venv3.6/lib/python3.6/site-packages/pbr/hooks/base.py", line 27, in run self.hook() File "/usr/local/open_dnsdb-0.2/venv3.6/lib/python3.6/site-packages/pbr/hooks/metadata.py", line 26, in hook self.config['name'], self.config.get('version', None)) File "/usr/local/open_dnsdb-0.2/venv3.6/lib/python3.6/site-packages/pbr/packaging.py", line 849, in get_version name=package_name)) 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 dnsdb was given, but was not able to be found. error in setup command: Error parsing /usr/local/open_dnsdb-0.2/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 dnsdb was given, but was not able to be found.

你好,能帮忙看下这个错是什么原因吗?

LostSymbol commented 5 years ago

升级python3测试还没完成,现在的代码回退到python2了,麻烦用python2试试

ghjacky commented 5 years ago

虚拟环境切换到2.7了,但是还是这个报错,报错信息如下: (venv2.7) [root@localhost open_dnsdb-0.2]# tools/with_venv.sh python setup.py install ERROR:root:Error parsing Traceback (most recent call last): File "/usr/local/open_dnsdb-0.2/venv2.7/lib/python2.7/site-packages/pbr/core.py", line 96, in pbr attrs = util.cfg_to_args(path, dist.script_args) File "/usr/local/open_dnsdb-0.2/venv2.7/lib/python2.7/site-packages/pbr/util.py", line 256, in cfg_to_args pbr.hooks.setup_hook(config) File "/usr/local/open_dnsdb-0.2/venv2.7/lib/python2.7/site-packages/pbr/hooks/init.py", line 25, in setup_hook metadata_config.run() File "/usr/local/open_dnsdb-0.2/venv2.7/lib/python2.7/site-packages/pbr/hooks/base.py", line 27, in run self.hook() File "/usr/local/open_dnsdb-0.2/venv2.7/lib/python2.7/site-packages/pbr/hooks/metadata.py", line 26, in hook self.config['name'], self.config.get('version', None)) File "/usr/local/open_dnsdb-0.2/venv2.7/lib/python2.7/site-packages/pbr/packaging.py", line 849, in get_version name=package_name)) 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 dnsdb was given, but was not able to be found. error in setup command: Error parsing /usr/local/open_dnsdb-0.2/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 dnsdb was given, but was not able to be found.

ghjacky commented 5 years ago

@LostSymbol 看了下pbr/packaging.py,设置下环境变量PBR_VERSION就可以了,问题解决,多谢!

kenkong2019 commented 5 years ago

@ghjacky 请教一下,解决这个问题的具体步骤。

zengdd-pro commented 4 years ago

@LostSymbol 看了下pbr/packaging.py,设置下环境变量PBR_VERSION就可以了,问题解决,多谢!

冒昧问下,具体怎么设?目前也遇到相同类似问题,看下你方法尝试下。