pendulum: Could not build wheels for pendulum which use PEP 517
-
I am on the latest Pendulum version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
Alpine 3.11 in Docker
-
Pendulum 2.1.0
Issue
I get an error about PEP 517 when trying to install Pendulum. The following Dockerfile (run with docker build .
) reproduces the issue.
The error is ERROR: Could not build wheels for pendulum which use PEP 517 and cannot be installed directly
FROM python:3.7-alpine3.11
RUN apk update \
&& apk add gcc musl-dev python3-dev py3-setuptools libffi libffi-dev openssl-dev \
&& pip3 install pendulum==2.1.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 16
- Comments: 37 (11 by maintainers)
Links to this issue
Commits related to this issue
- Use setuptools instead of the distutils in the genarated setup.py — committed to python-poetry/poetry by sdispater 5 years ago
This should be fixed in the latest
2.1.2
release.Workaround (for this situation, running in Docker with Alpine)
There are multiple reasons behind this:
setuptools
, but it is not specified inpyproject.toml
’s[build-systems] requires
So the corresponding resolution will be:
slim
images instead ofalpine
18.1
pyproject.toml
I was able to get this to work in my dockerfile by downgrading my version of pip. I didn’t keep track of all the details, but it seems that up to about version 1.0.4 it works with pip 19.x. After that we get the issue listed above.
I think python-poetry/core#24 (also mentioned at https://github.com/python-poetry/poetry/pull/2262/files/ad2c8d80f4f04a95769a5955e4367f1351aaca76#diff-d4e7f533c342aecaeb13b29ca6c1bf24) should resolve this. I have not tested at all, just getting the cross-references added.
Thanks @abn.
My quick looking suggests…
pendulum
wheels aren’t used so that explains the issue not being as wide spread as it might bepoetry
tarball doesn’t listsetuptools
as aninstall_requires
and thus the isolated build env doesn’t have setuptools (thepoetry
.whl
should be used but I know where to look in the tarball…)Now I’m not sure of the nuances here and I haven’t tested my theory quite yet but… FWIW.
I really like pendulum, it’s baffling that this hasn’t been resolved for so long. I understand that the author wrote poetry but it’s not a glowing endorsement that people haven’t been able to install pendulum for three months because of it.
Any workarounds for people using pipenv? I’m using the same docker setup but using pipenv and lock files.
@ethanmsl Pendulum 3.0.0b1 has wheels for M1 macs and Python 3.12, but builds of Pendulum 2.* on Python 3.12+ seem like they’ll be forever broken.
I got tired of this so I built my own Python package index with wheels for Alpine Linux.
https://github.com/alpine-wheels/index
Windows: Install (python -m pip install pendulum) works on pip 18.1, doesnt work on pip 19.2.3.
Wasn’t clear if you folks had the log you needed, so…
C:\python>python -m pip install pendulum Collecting pendulum Using cached https://files.pythonhosted.org/packages/e5/dc/d79687e49cafbdee73078b28c57d2a2555735c88d672239e4cb19a6a141a/pendulum-2.1.0.tar.gz Installing build dependencies … done Getting requirements to build wheel … done Preparing wheel metadata … done Collecting pytzdata>=2018.3 (from pendulum) Using cached https://files.pythonhosted.org/packages/7f/f9/cdd39831b0465285c02ed90cfbf0db25bb951cb2a35ded0e69222375bea3/pytzdata-2019.3-py2.py3-none-any.whl Requirement already satisfied: python-dateutil<3.0,>=2.6 in c:\python\lib\site-packages (from pendulum) (2.8.1) Requirement already satisfied: six>=1.5 in c:\python\lib\site-packages (from python-dateutil<3.0,>=2.6->pendulum) (1.15.0) Building wheels for collected packages: pendulum Building wheel for pendulum (PEP 517) … error ERROR: Command errored out with exit status 1: command: ‘C:\python\python.exe’ ‘C:\python\lib\site-packages\pip_vendor\pep517_in_process.py’ build_wheel ‘C:\Users\Frame\AppData\Local\Temp\1\tmpo6145lzs’ cwd: C:\Users\Frame\AppData\Local\Temp\1\pip-install-nkecq6bf\pendulum Complete output (24 lines): Traceback (most recent call last): File “setup.py”, line 2, in <module> from setuptools import setup ModuleNotFoundError: No module named ‘setuptools’ Traceback (most recent call last): File “C:\python\lib\site-packages\pip_vendor\pep517_in_process.py”, line 207, in <module> main() File “C:\python\lib\site-packages\pip_vendor\pep517_in_process.py”, line 197, in main json_out[‘return_val’] = hook(**hook_input[‘kwargs’]) File “C:\python\lib\site-packages\pip_vendor\pep517_in_process.py”, line 140, in build_wheel return _build_backend().build_wheel(wheel_directory, config_settings, File “C:\Users\Frame\AppData\Local\Temp\1\pip-build-env-h1_o3poz\overlay\Lib\site-packages\poetry\core\masonry\api.py”, line 57, in build_wheel return unicode(WheelBuilder.make_in(poetry, Path(wheel_directory))) File “C:\Users\Frame\AppData\Local\Temp\1\pip-build-env-h1_o3poz\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py”, line 56, in make_in wb.build() File “C:\Users\Frame\AppData\Local\Temp\1\pip-build-env-h1_o3poz\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py”, line 82, in build self._build(zip_file) File “C:\Users\Frame\AppData\Local\Temp\1\pip-build-env-h1_o3poz\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py”, line 101, in _build self._run_build_command(setup) File “C:\Users\Frame\AppData\Local\Temp\1\pip-build-env-h1_o3poz\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py”, line 129, in _run_build_command subprocess.check_call( File “C:\python\lib\subprocess.py”, line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command ‘[‘C:\python\python.exe’, ‘setup.py’, ‘build’, ‘-b’, ‘build’]’ returned non-zero exit status 1.
ERROR: Failed building wheel for pendulum Running setup.py clean for pendulum ERROR: Command errored out with exit status 1: command: ‘C:\python\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’“‘C:\Users\Frame\AppData\Local\Temp\1\pip-install-nkecq6bf\pendulum\setup.py’”’“‘; file=’”‘“‘C:\Users\Frame\AppData\Local\Temp\1\pip-install-nkecq6bf\pendulum\setup.py’”’“';f=getattr(tokenize, '”‘“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ clean --all cwd: C:\Users\Frame\AppData\Local\Temp\1\pip-install-nkecq6bf\pendulum Complete output (3 lines): Traceback (most recent call last): File “<string>”, line 1, in <module> ModuleNotFoundError: No module named ‘setuptools’
ERROR: Failed cleaning build dir for pendulum Failed to build pendulum ERROR: Could not build wheels for pendulum which use PEP 517 and cannot be installed directly
Why is poetry required to install pendulum?
Please fix this issue, thanks
@davegallant, commit-wise it looks to be: https://github.com/python-poetry/poetry/commit/f759876231ca6c0910ad823f0ba405e21b3f1c4b
Does pipenv have a similar option to disable build isolation? That would most likely work, though I’m not really familiar with how pipenv does things.