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

[Linux] pip install with pep517 fails #1615

Closed
zephyrj opened this issue Nov 5, 2019 · 3 comments
Closed

[Linux] pip install with pep517 fails #1615

zephyrj opened this issue Nov 5, 2019 · 3 comments

Comments

@zephyrj
Copy link

zephyrj commented Nov 5, 2019

Linux

  • Red Hat Enterprise Linux Server release 7.2 (Maipo)
  • psutil-5.6.4
pip --version
pip 19.3.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)

Bug description
The changes made to add pyproject.toml (fc204a9) seem to have stopped pip installs working.

sudo pip install psutil
Collecting psutil
  Using cached https://files.pythonhosted.org/packages/47/ea/d3b6d6fd0b4a6c12984df652525f394e68c8678d2b05075219144eb3a1cf/psutil-5.6.4.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python /usr/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmptckssG
       cwd: /tmp/pip-install-etD7In/psutil
  Complete output (8 lines):
  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 21, in <module>
      import shutil
    File "/usr/lib64/python2.7/shutil.py", line 12, in <module>
      import collections
    File "/usr/lib64/python2.7/collections.py", line 8, in <module>
      from _collections import deque, defaultdict
  ImportError: No module named _collections
  ----------------------------------------

Installing the previous version seems to work correctly:

sudo pip install psutil==5.6.3
Collecting psutil==5.6.3
  Using cached https://files.pythonhosted.org/packages/1c/ca/5b8c1fe032a458c2c4bcbe509d1401dca9dda35c7fc46b36bb81c2834740/psutil-5.6.3.tar.gz
Building wheels for collected packages: psutil
  Building wheel for psutil (setup.py) ... done
  Created wheel for psutil: filename=psutil-5.6.3-cp27-cp27mu-linux_x86_64.whl size=256085 sha256=ddce47f5d86f0bd21bb2b11b90d6ef3ff51353c72d156071c15e1310aac6fe69
  Stored in directory: /root/.cache/pip/wheels/90/7e/74/bb640d77775e6b6a78bcc3120f9fea4d2a28b2706de1cff37d
Successfully built psutil
Installing collected packages: psutil
Successfully installed psutil-5.6.3

It may be related to the following pip issues but I'm not really sure what the upshot of this issue was:
pypa/pip#6163

@gaborbernat
Copy link
Contributor

🤔 this seems to be a pip or python bug; seems importing shutil from within pip breaks the world 🤔 @pfmoore any ideas?

@pfmoore
Copy link

pfmoore commented Nov 6, 2019

Looking at the traceback, it seems to be failing because when the code imports shutil, it tries to import _collections, which isn't working. That's pure stdlib code, so I'd suggest starting by checking if import shutil works in a standard Python prompt.

There may be a pip issue in how the isolated build environment that is getting used in a PEP 517 build gets set up, but I don't know how that code could break the stdlib.

@giampaolo
Copy link
Owner

I just released a new version without pyproject.toml which should fix this issue. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants