Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__' #1694

Closed
Zlopez opened this issue Feb 21, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@Zlopez
Copy link

commented Feb 21, 2019

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.

@Zlopez

This comment has been minimized.

Copy link
Author

commented Feb 21, 2019

I'm using python 3.7.2

@pganssle

This comment has been minimized.

Copy link
Member

commented Feb 21, 2019

As far as I know, this is triggered when all of the following conditions are met:

  1. You are using a virtualenv with --system-site-packages
  2. You are using pip >= 19.0.2
  3. Your system version of setuptools is less than 40.8.0.
  4. The package you are installing does not specify 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.

@pganssle pganssle closed this Feb 21, 2019

@Zlopez

This comment has been minimized.

Copy link
Author

commented Feb 21, 2019

Thank you for your response. I will check when setuptools will be updated on Fedora 29.

@pganssle

This comment has been minimized.

Copy link
Member

commented Feb 21, 2019

@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.

@Zlopez

This comment has been minimized.

Copy link
Author

commented Feb 21, 2019

@pganssle Thanks, I will try this

Russell-Jones-OxPhys added a commit to Russell-Jones-OxPhys/pymssql that referenced this issue Apr 1, 2019

ltalirz added a commit to marvel-nccr/ansible-role-aiida that referenced this issue May 3, 2019

namuyan added a commit to namuyan/multi-party-schnorr that referenced this issue May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.