question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
pgansslecommented, 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.

6reactions
pgansslecommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module 'setuptools.build_meta' has no attribute '__legacy__'
I am trying to install RASA on Ubuntu: It is erroring out with: Collecting SQLAlchemy<1.4.0,>=1.3.3 Using cached SQLAlchemy-1.3.15.tar.gz ...
Read more >
ImportError: No module named 'setuptools.build_meta'
As ignorant as I am, I tried dropping this file into the site-packages\pip_vendor\pep517 directly with no change. I'm sure this is simple, but...
Read more >
module 'setuptools.build_meta' has no attribute '__legacy__'
Bug 1679630 - AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'. Summary: AttributeError: module ...
Read more >
Problem with python3-setuptools as a stage-package - snapcraft
The project I'm trying to snap up required python3-setuptools as a staging ... module 'setuptools.build_meta' has no attribute '__legacy__' ...
Read more >
Bug #1840715 “AttributeError: module 'setuptools.build_meta ...
AttributeError : module 'setuptools.build_meta' has no attribute '__legacy__'. Bug #1840715 reported by Ryan Beisner on 2019-08-19.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found