I'm trying to install project I'm working on using pip3 install -e "file:///home/vagrant/devel", but everytime I end up with:
$> pip3 install -e "file:///home/vagrant/devel"
Obtaining file:///home/vagrant/devel
Installing build dependencies ... done
Getting requirements to build wheel ... error
Complete output from command /home/vagrant/.virtualenvs/anitya/bin/python3 /home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp6db90a_q:
Traceback (most recent call last):
File "/home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
main()
File "/home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 48, in get_requires_for_build_wheel
backend = _build_backend()
File "/home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 39, in _build_backend
obj = getattr(obj, path_part)
AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'
Maybe I'm just doing something wrong, but this worked few days ago.
I'm using python 3.7.2
As far as I know, this is triggered when all of the following conditions are met:
virtualenv with --system-site-packagespip >= 19.0.2setuptools is less than 40.8.0.build-backend="setuptools.build_meta" in its pyproject.toml.It is a bug in pip's PEP 517 build isolation code: pypa/pip#6264.
The best way to fix it at the moment is to explicitly specify build-backend="setuptools.build_meta" in your pyproject.toml, like this. Note that you'll also want to put pyproject.toml in your MANIFEST.in.
Assuming you need --system-site-packages in your virtualenv, the second best way to solve this is to upgrade your system version of setuptools.
I'm going to close this issue as not a bug in setuptools, but thank you for the report. I recommend giving a +1 on the pip thread, or chiming in there if you managed to trigger this in a different way.
Thank you for your response. I will check when setuptools will be updated on Fedora 29.
@Zlopez Oh, also pip install -e --no-use-pep517 'file://whatever/vagrant/devel' may work, not sure - I think it depends on whether the package in question was relying on the PEP 518 dependency satisfaction or not.
@pganssle Thanks, I will try this
When trying to install scipy module on Python 3.5.2,
[GCC 5.4.0 20160609] on linux, I keep running into the same error message using setuptools 41.1.0.
File `"/usit/abel/u1/user/.local/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py",` line 39, in _build_backend
obj = getattr(obj, path_part)
AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usit/abel/u1/user/.local/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpr85rmcv9 Check the logs for full command output.
(virtualenv) janpesl@freebio:~$ pip3 install --upgrade setuptools
Requirement already up-to-date: setuptools in ./.local/lib/python3.5/site-packages (41.1.0)
What is the recommended fix?
@janPesl for me the solution from @pganssle worked. See https://github.com/pypa/setuptools/issues/1694#issuecomment-466023567
Same problem. Setuptools: 47.1.1, python: 3.5.2, pip: 20.1.1 virtualenv: 16.3.0
@Zlopez Oh, also
pip install -e --no-use-pep517 'file://whatever/vagrant/devel'may work, not sure - I think it depends on whether the package in question was relying on the PEP 518 dependency satisfaction or not.
It does. Thanks!
Most helpful comment
As far as I know, this is triggered when all of the following conditions are met:
virtualenvwith--system-site-packagespip >= 19.0.2setuptoolsis less than 40.8.0.build-backend="setuptools.build_meta"in itspyproject.toml.It is a bug in
pip's PEP 517 build isolation code: pypa/pip#6264.The best way to fix it at the moment is to explicitly specify
build-backend="setuptools.build_meta"in yourpyproject.toml, like this. Note that you'll also want to putpyproject.tomlin yourMANIFEST.in.Assuming you need
--system-site-packagesin your virtualenv, the second best way to solve this is to upgrade your system version ofsetuptools.I'm going to close this issue as not a bug in
setuptools, but thank you for the report. I recommend giving a +1 on thepipthread, or chiming in there if you managed to trigger this in a different way.