[0.7.11] - > Task :python:installBuildRequirements FAILED
See original GitHub issueRepro:
$ gradlew clean build
Error:
> Task :python:installBuildRequirements FAILED
Error installing package using `[/Users/<>/repo/cs-interview-questions/python/build/venv/bin/python, /Users/<>/repo/cs-interview-questions/python/build/venv/bin/pip, install, --disable-pip-version-check, --no-deps, --upgrade, /Users/<>/.gradle/caches/modules-2/files-2.1/pypi/mccabe/0.5.2/14c5b2794cae2a723cdf4ce520c4e0d8cae62986/mccabe-0.5.2.tar.gz]`
Processing /Users/<>/.gradle/caches/modules-2/files-2.1/pypi/mccabe/0.5.2/14c5b2794cae2a723cdf4ce520c4e0d8cae62986/mccabe-0.5.2.tar.gz
Complete output from command python setup.py egg_info:
Couldn't find index page for 'pytest-runner' (maybe misspelled?)
No local packages or working download links found for pytest-runner
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/1w/20_t1jyx6ggfdscxxg8gq0gw0000gn/T/pip-3RHXIR-build/setup.py", line 57, in <module>
'Topic :: Software Development :: Quality Assurance',
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/<>/repo/cs-interview-questions/python/build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 317, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/Users/<>/repo/cs-interview-questions/python/build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 372, in fetch_build_eggs
replace_conflicting=True,
File "/Users/<>/repo/cs-interview-questions/python/build/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/Users/<>/repo/cs-interview-questions/python/build/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1118, in best_match
return self.obtain(req, installer)
File "/Users/<>/repo/cs-interview-questions/python/build/venv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1130, in obtain
return installer(requirement)
File "/Users/<>/repo/cs-interview-questions/python/build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 440, in fetch_build_egg
return cmd.easy_install(req)
File "/Users/<>/repo/cs-interview-questions/python/build/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 668, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pytest-runner')
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/1w/20_t1jyx6ggfdscxxg8gq0gw0000gn/T/pip-3RHXIR-build/
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':python:installBuildRequirements'.
> Failed to install mccabe-0.5.2. 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 24s
31 actionable tasks: 30 executed, 1 up-to-date
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zvezdan / @jaredsburrows, Am a new bee to pygradle, Facing the same issue on example-project build.
build.gradle
Could someone give me the steps to fix this.
@ameliedagenais The
setup_requires
is sometimes necessary – it’s not a bad practice, it’s just that pip does not process it, but rather only setuptools.@jaredsburrows I don’t know the particular details of your environment, but perhaps the external network access is not allowed so setuptools couldn’t reach pypi.python.org, or some network connection transient issue happened.
We actually provide a feature in pygradle that helps with this. It’s the optional input named
distutilsCfg
on theInstallVirtualEnvironment
task.In a typical enterprise, the external network access would not be allowed on build hosts. All used Python packages would have to be in an internal PyPI mirror. But then, there must be a way to tell somehow setuptools where to find packages it processes for
setup_requires
. The feature we provided allows you to define an entry fordistutils.cfg
file like this:and then use it in the provided input in a
project.afterEvaluate
closure :