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

versioneer doesn't work on recent pip when PEP 517 build is triggered #192

Closed
astrojuanlu opened this issue Jan 28, 2019 · 13 comments
Closed

Comments

@astrojuanlu
Copy link

See for example:

 pip install git+https://github.com/satellogic/telluric.git@master
Collecting git+https://github.com/satellogic/telluric.git@master
 Cloning https://github.com/satellogic/telluric.git (to revision master) to /tmp/pip-req-build-9k8rc3xc
 Installing build dependencies ... done
 Getting requirements to build wheel ... error
 Complete output from command /home/guyd/pEnvs/test3.6/bin/python3.6 /home/guyd/pEnvs/test3.6/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmprqjhaubw:
 Traceback (most recent call last):
   File "/home/guyd/pEnvs/test3.6/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
     main()
   File "/home/guyd/pEnvs/test3.6/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
     json_out['return_val'] = hook(**hook_input['kwargs'])
   File "/home/guyd/pEnvs/test3.6/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 54, in get_requires_for_build_wheel
     return hook(config_settings)
   File "/tmp/pip-build-env-ja9d4l2j/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 115, in get_requires_for_build_wheel
     return _get_build_requires(config_settings, requirements=['wheel'])
   File "/tmp/pip-build-env-ja9d4l2j/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 101, in _get_build_requires
     _run_setup()
   File "/tmp/pip-build-env-ja9d4l2j/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 85, in _run_setup
     exec(compile(code, __file__, 'exec'), locals())
   File "setup.py", line 2, in <module>
     import versioneer
 ModuleNotFoundError: No module named 'versioneer'
 
 ----------------------------------------
Command "/home/guyd/pEnvs/test3.6/bin/python3.6 /home/guyd/pEnvs/test3.6/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmprqjhaubw" failed with error code 1 in /tmp/pip-req-build-9k8rc3xc

(by @guydou)

The root cause is this one: pypa/pip#6163, see for example:

I suspect the cause of this issue is that build isolation or the PEP 517 code isn't making sure that the root of the package directory is on the sys.path, because pandas has a versioneer.py sitting next to setup.py. I recall this coming up at some point, but I don't remember off the top of my head what that discussion was. This might be considered an issue with the setuptools build backend instead of pip, or it might be the fault of pip's isolation mechanism.

@daa
Copy link

daa commented Jan 28, 2019

It's not versioneer doesn't work but telluric does not include versioneer in build system requirements.
I though a bit more and looked at telluric more carefully and must say that what exactly does not work is using versioneer.py from project directory.

@astrojuanlu
Copy link
Author

@daa adding versioneer to the build requirements is not listed in the installation instructions:

https://github.com/warner/python-versioneer#quick-install

If you read the linked pip comment, it explicitly says that "pandas has a versioneer.py sitting next to setup.py", so it's not a telluric problem.

@daa
Copy link

daa commented Jan 28, 2019

@Juanlu001 You are right, my comment wasn't thoughtful enough.

@Midnighter
Copy link

I can confirm this and additionally it was introduced with pip version 19. This works fine <19.

  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  Complete output from command /home/moritz/.virtualenvs/equilibrator/bin/python3.6 /home/moritz/.virtualenvs/equilibrator/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpseqhk02x:
  Traceback (most recent call last):
    File "/home/moritz/.virtualenvs/equilibrator/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
      main()
    File "/home/moritz/.virtualenvs/equilibrator/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/moritz/.virtualenvs/equilibrator/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-id6yd9kl/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 115, in get_requires_for_build_wheel
      return _get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-id6yd9kl/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 101, in _get_build_requires
      _run_setup()
    File "/tmp/pip-build-env-id6yd9kl/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 85, in _run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 30, in <module>
      import versioneer
  ModuleNotFoundError: No module named 'versioneer'

  ----------------------------------------
Command "/home/moritz/.virtualenvs/equilibrator/bin/python3.6 /home/moritz/.virtualenvs/equilibrator/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpseqhk02x" failed with error code 1 in /home/moritz/Codebase/equilibrator/equilibrator-assets

@yarikoptic
Copy link
Contributor

so what would be the best workaround ATM?

@Midnighter
Copy link

I don't know exactly since which version of pip but versioneer works again for me (19.2.3).

yarikoptic added a commit to dandi/dandi-cli that referenced this issue Oct 7, 2019
…port

Unfortunately I did not find a better solution for a still open
   python-versioneer/python-versioneer#192
so we might just reconsider (not) using versioneer altogether in the future
@dmccreary
Copy link

I got this same error when installing the DonkeyCar 3. code on the Nvidia Nano:
ModuleNotFoundError: No module named 'versioneer'

I had downgraded to pip 19.0 to get around the following error in pip 20.0.2:
AttributeError: module 'setuptools.build_meta' has no attribute 'legacy'

I also tried 19.2.3 and got the same legacy error above.

Anyone have any suggestions?

@Midnighter
Copy link

Weird, I'm using pip>20 now and it works just fine with versioneer. Did you try to upgrade your setuptools version, too?

@tezelcelebi
Copy link

@dmccreary I am having the same problem. I am trying to install DonkeyCar. I downgraded to pip 19 after having AttributeError: module 'setuptools.build_meta' has no attribute 'legacy' error.
Now I am facing the No module named 'versioneer' error.

Did you have any solution to this issue ?

@Aditya90
Copy link

Aditya90 commented May 3, 2020

I'm having a similar issue as well with the Donkey Car. Did anyone find a solution yet?

@astrojuanlu
Copy link
Author

Could people affected by this issue try this?

@KikeM
Copy link

KikeM commented Sep 10, 2020

Hi @astrojuanlu,

Could people affected by this issue try this?

I tried this solution you suggest and it worked fine. Unfortunately, it's in one of my company's private repositories.

Would you like the pip output in verbose mode?

@astrojuanlu
Copy link
Author

Thanks @KikeM! No need to, versioneer-518 works for me as well.

I was about to ask the original reporter to close this issue... but it's me 🤡 closing!

jwodder pushed a commit to dandi/dandi-schema that referenced this issue May 20, 2021
…port

Unfortunately I did not find a better solution for a still open
   python-versioneer/python-versioneer#192
so we might just reconsider (not) using versioneer altogether in the future
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants