pipenv: Pipenv failed to build wheels (PEP 517)
Given the following:
$ python3 -V
Python 3.9.1
$ pipenv --version
pipenv, version 2020.11.15
$ pip --version
pip 20.3.3
Let us consider mkdir test && cd test
the following minimal Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pandas = "*"
Running a simple pipenv install
generates a mile long error message whose last bits are
...
----------------------------------------
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
...
...
pipenv.patched.notpip._internal.exceptions.InstallationError: Command errored out with exit status 1: /~/.local/share/virtualenvs/test-mmObi3rW/bin/python /usr/local/lib/python3.9/site-packages/pipenv/patched/notpip install --ignore-installed --no-user --prefix /private/var/folders/vw/67twknb114j86_qdm17qgrk40000gn/T/pip-build-env-lje2m4uc/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.21,<3' 'numpy==1.15.4; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.15.4; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy; python_version>='"'"'3.9'"'"'' Check the logs for full command output.
This problem has been touched already for instance here, here and here concering pip
. Apparently the suggestion is to explicitly include the flag --no-use-pep517
which however does not work in conjunction with pipenv
, producing pipenv.vendor.requirementslib.exceptions.RequirementError: Failed parsing requirement from '--no-use-pep517'
.
It seems there is also a general problem with the version 2020.11.15, I do not exactly understand whether related or not. If instead of pandas
one installs pipenv install request
(or any other package not containing particular dependencies) the installation works fine, which makes me think the problem is indeed the building of the numpy
wheels.
What is the right procedure in this case to just proceed with the installation?
$ pipenv --support
Pipenv version: '2020.11.15'
Pipenv location: '/usr/local/lib/python3.9/site-packages/pipenv'
Python location: '/usr/local/opt/python@3.9/bin/python3.9'
Python installations found:
3.9.1
:~/.local/share/virtualenvs/test-mmObi3rW/bin/python3
3.9.1
:~/.local/share/virtualenvs/test-mmObi3rW/bin/python3.9
3.9.1
:~/.local/share/virtualenvs/test-mmObi3rW/bin/python3
3.9.1
:~/.local/share/virtualenvs/test-mmObi3rW/bin/python3.9
3.9.1
:/usr/local/bin/python3
3.9.1
:/usr/local/bin/python3.9
3.8.2
:/usr/bin/python3
2.7.16
:/usr/bin/python2
2.7.16
:/usr/bin/python2.7
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.9.1',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '20.2.0',
'platform_system': 'Darwin',
'platform_version': 'Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST '
'2020; root:xnu-7195.60.75~1/RELEASE_X86_64',
'python_full_version': '3.9.1',
'python_version': '3.9',
'sys_platform': 'darwin'}
System environment variables:
TERM_SESSION_ID
SSH_AUTH_SOCK
LC_TERMINAL_VERSION
COLORFGBG
ITERM_PROFILE
XPC_FLAGS
PWD
SHELL
__CFBundleIdentifier
LC_CTYPE
TERM_PROGRAM_VERSION
TERM_PROGRAM
PATH
LC_TERMINAL
COLORTERM
COMMAND_MODE
TERM
HOME
TMPDIR
USER
XPC_SERVICE_NAME
LOGNAME
ITERM_SESSION_ID
__CF_USER_TEXT_ENCODING
SHLVL
OLDPWD
P9K_TTY
ZSH
PAGER
LESS
LSCOLORS
P9K_SSH
EDITOR
LANG
MANPAGER
FZF_DEFAULT_OPTS
FZF_DEFAULT_COMMAND
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PIPENV_ACTIVE
VIRTUAL_ENV
PS1
_
PIP_SHIMS_BASE_MODULE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_ACTIVE
:1
Debug–specific environment variables:
PATH
:~/.local/share/virtualenvs/test-mmObi3rW/bin:~/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/MacGPG2/bin:/usr/local/opt/fzf/bin
SHELL
:/bin/zsh
EDITOR
:vim
LANG
:en_US.UTF-8
PWD
:~/test
VIRTUAL_ENV
:~/.local/share/virtualenvs/test-mmObi3rW
Contents of Pipfile
(‘~/test/Pipfile’):
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pandas = "*"
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 21
- Comments: 47 (8 by maintainers)
doing so produces the same error stated above, whose complete stacktrace is
Looking around some more on the internet I managed to make it work by means of the mysterious and obscure command
export SYSTEM_VERSION_COMPAT=1
, found somehow accidentally here.What then exactly is the solution to the problem? More generally, is
pipenv
keeping up withpip
and python updates and versionings? If so, there must be a way to install packages without having to perform workarounds as above, must it not?(Slightly OT please forgive the noise. For those finding this thread looking for numpy/scipy solutions)
As of 4th August 2021 with a M1 Macbook Pro with Big Sur v11.4 (20F71) Python 3.9.6 (Homebrew):
Numpy just works (installs numpy v1.21.1):
Scipy works with a combination of build flags and and libraries from homebrew (installs scipy v1.7.0):
Apologies for being critical, but this is obviously not being looked at/fixed (6 months is a somewhat obscene amount of time for such an urgent case). At this point it would be great to even just have a confirmation from the development team that users ought to move away from
pipenv
(frankly I cannot just continue checking this thread every day or hack all sorts of workaround in production code).I taught a pandas related MOOC last week, where I guided more than 75 students through installation with pipenv. This error, which was entirely new to me, was encountered by numerous members of the class. Thank you to everyone working on a fix. I can assure it will be appreciated by many.
Can you show the full error message of
pipenv install --verbose
?Yes, it does the trick by pretending the OS version to be
macOS 10
, which has a pre-built wheel on PyPI.I’m on 11.2 with ARM64 and the workaround does NOT work here.
Is there a fix for this? I tried
export SYSTEM_VERSION_COMPAT=1
but get error########### CLIB COMPILER OPTIMIZATION ########### Platform : Architecture: aarch64 Compiler : clang
CPU baseline : Requested : ‘min’ Enabled : NEON NEON_FP16 NEON_VFPV4 ASIMD Flags : none Extra checks: none
CPU dispatch : Requested : ‘max -xop -fma4’ Enabled : ASIMDHP ASIMDDP Generated : none CCompilerOpt._cache_write[796] : write cache to path -> /private/var/folders/lf/2v_lshfd6411zrk07w4_kf2c0000gn/T/pip-install-345t8gh2/numpy/build/temp.macosx-11-arm64-3.9/ccompiler_opt_cache_clib.py
ERROR: Failed building wheel for numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
I am on new MacBook with M1 processor. I installed pipenv through brew. Appreciate the help!
As of September 27th 2021, there is no need to include pythran nor add the --no-use-pep517 argument. pip install scipy works, as well as pip install scikit-learn that had the same issue as SciPy
Still have this issue in the latest release. Failed when locking.
I am running into the same issues. Can’t install pandas using pipenv. I get the following:
I can install and have installed pandas via pip and can use this…But when trying to use a pipenv environment it just hangs.
I ran into wheel discovery issues with vanilla
pip install
as well.I followed advice here, which suggested upgrading
pip
itself: https://github.com/scipy/scipy/issues/13102#issuecomment-737009648After upgrading
pip
to the21.0.1
, release, installing the same packages went fine. Runningpip install
allowed me to install pandas/numpy/scipy using wheel distributions (and without having to compile).However, running
pipenv install
still ran into the same issues (not finding wheels), despite the fact that it was apparently using the up-to-datepip
release.I’m not understanding why y’all can’t use the workaround. At least post up the error your getting