gpt4 book ai didi

python - {Py}Gradle 构建无模块名称 testrepository

转载 作者:行者123 更新时间:2023-12-03 05:46:38 25 4
gpt4 key购买 nike

我是 gradle 新手,我想用 python 创建一个 gradle 项目,我按照指南写 here我创建了这个项目。
安装没有给我任何问题,但是当我使用命令运行项目时

gradle build

给我这个错误:
   ..
Install pbr-0.11.0 .................................................. [STARTING]
Processing /home/.../.gradle/caches/modules-2/files-2.1/pypi/pbr/0.11.0/72801e9ffd52e7f438422a3e08b578e906cd270a/pbr-0.11.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-f2i4gbg4-build/setup.py", line 22, in <module>
**util.cfg_to_args())
File "/tmp/pip-f2i4gbg4-build/pbr/util.py", line 261, in cfg_to_args
wrap_commands(kwargs)
File "/tmp/pip-f2i4gbg4-build/pbr/util.py", line 482, in wrap_commands
for cmd, _ in dist.get_command_list():
File "/home/IASuserdev/Desktop/gradleFun/pythonGradle/build/venv/lib/python3.6/site-packages/setuptools/dist.py", line 507, in get_command_list
cmdclass = ep.resolve()
File "/home/IASuserdev/Desktop/gradleFun/pythonGradle/build/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2297, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/tmp/pip-f2i4gbg4-build/pbr/testr_command.py", line 47, in <module>
from testrepository import commands
ModuleNotFoundError: No module named 'testrepository'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-f2i4gbg4-build


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installTestRequirements'.
> Failed to install pbr-0.11.0. Please see above output for reason, or re-run your build using ``gradle -i build`` for additional logging.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

我尝试在虚拟环境中使用 pip 安装 testrepository,然后我清理并重建项目,但它是相同的。
我阅读了另一个问题并尝试了所有答案,但没有任何效果,有人可以帮助我吗?

最佳答案

我在 setup.py 中取消了对这些行的注释现在工作正常。

setup(
distclass=GradleDistribution,
package_dir={'': 'src'},
packages=find_packages('src'),
include_package_data=True,

entry_points={
'console_scripts': [
'hello_world = foo.hello:main',
],
}
)

关于python - {Py}Gradle 构建无模块名称 testrepository,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49875621/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com