0

I recently reopened a script I wrote more than one year ago, but failed to install all pipenv dependencies from Pipfile.

In particular python_ldap wheel fails (the wheel is in a local folder next to the Pipfile):

Pipfile.lock (3d2ab2) out of date, updating to (98503a)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
 Locking...                                                                                                                                                                                             Resolving dependencies...
Success!
Updated Pipfile.lock (98503a)!
Installing dependencies from Pipfile.lock (98503a)…
An error occurred while installing ./dependencies/python_ldap-3.1.0-cp37-cp37m-win_amd64.whl --hash=sha256:41975e79406502c092732c57ef0c2c2eb318d91e8e765f81f5d4ab6c1db727c5 --hash=sha256:a424ecb9f16ab7723d570c12713dd2f3ae84c605c93ee19d6cc1c47fec61815b! Will try again.
  ================================ 9/9 - 00:00:10
Installing initially failed dependencies…
[InstallError]:   File "c:\program files\python38\lib\site-packages\pipenv\cli\command.py", line 232, in install
[InstallError]:       retcode = do_install(
[InstallError]:   File "c:\program files\python38\lib\site-packages\pipenv\core.py", line 2051, in do_install
[InstallError]:       do_init(
[InstallError]:   File "c:\program files\python38\lib\site-packages\pipenv\core.py", line 1306, in do_init
[InstallError]:       do_install_dependencies(
[InstallError]:   File "c:\program files\python38\lib\site-packages\pipenv\core.py", line 900, in do_install_dependencies
[InstallError]:       batch_install(
[InstallError]:   File "c:\program files\python38\lib\site-packages\pipenv\core.py", line 796, in batch_install
[InstallError]:       _cleanup_procs(procs, failed_deps_queue, retry=retry)
[InstallError]:   File "c:\program files\python38\lib\site-packages\pipenv\core.py", line 703, in _cleanup_procs
[InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ERROR: python_ldap-3.1.0-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
ERROR: Couldn't install package: python-ldap
 Package installation failed...
     ================================ 0/1 - 00:00:03

Pipfile

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
python-ldap = {path = "./dependencies/python_ldap-3.1.0-cp37-cp37m-win_amd64.whl"}
requests = "~=2.0"
mysqlclient = "~=1.0"

[dev-packages]

[requires]
python_version = "3.8"

What could be wrong? The pipenv install ha been launched from within the shell made with pipenv shell (which is brand new).

The script has been written on Windows 7 with Python 3.7; now I'm on Windows 10 with Python 3.8. I wouldn't think these make a difference, but I have no clue.


UPDATE

I found the question Cannot install numpy from wheel format and the accepted anwser. While the command there suggested gave an error on my box, I noticed that launching the python command I get:

Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32

Which doesn't sound right to me, I'm on a x64 Windows 10 machine. Do I have a broken installation or something?

UPDATE / 2

I tried both:

  • python_ldap-3.3.1-cp39-cp39-win_amd64.whl
  • python_ldap-3.3.1-cp39-cp39-win32.whl

but none worked, giving:

Installing dependencies\python_ldap-3.3.1-cp39-cp39-win_amd64.whl…
Error:  An error occurred while installing dependencies\python_ldap-3.3.1-cp39-cp39-win_amd64.whl!
Error text:
ERROR: python_ldap-3.3.1-cp39-cp39-win_amd64.whl is not a supported wheel on this platform.

and:

Installing dependencies\python_ldap-3.3.1-cp39-cp39-win32.whl…
Error:  An error occurred while installing dependencies\python_ldap-3.3.1-cp39-cp39-win32.whl!
Error text:
ERROR: python_ldap-3.3.1-cp39-cp39-win32.whl is not a supported wheel on this platform.

UPDATE / 3

Finally, python_ldap-3.3.1-cp38-cp38-win_amd64.whl worked.

I guess the XY in cpXY refers to the Python version and - maybe pipenv - is being picky about the minimum version too, rejecting the original wheel python_ldap-3.1.0-cp37-cp37m-win_amd64.whl because it's "too old" for 3.8?

watery
  • 4,448
  • 6
  • 44
  • 80
  • 1
    Your update suggests you tried to install a package for Python 3.9 into Python 3.8. Do I understand that correctly? – Paul H Aug 04 '20 at 14:11
  • Where did you obtain the wheels? python-ldap does not appear to [support wheels](https://www.python-ldap.org/en/python-ldap-3.3.0/installing.html), with the reason explained at https://github.com/python-ldap/python-ldap/issues/331 . – 9769953 Aug 04 '20 at 14:15
  • @PaulH I know little about Python, I guess it's as you said, see my update #3. – watery Aug 04 '20 at 14:18
  • @00 From here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap Yes that can be wrong, I know little about Python; but when I wrote the script the wheel worked and has been installed by pipenv (as did the latter, see my update #3). – watery Aug 04 '20 at 14:20
  • 1
    So the answer to your question is that packages have to be compiled for the target version of python. – Paul H Aug 04 '20 at 14:21
  • 1
    "is being picky about the minimum version too": no, it's being picky about the *exact* version. Wheels are Python (byte-)compiled files, which have to match the Python version properly. – 9769953 Aug 04 '20 at 14:21
  • It seems I should have done the other way around and installed Python 3.7 as has been told me in [the answer](https://stackoverflow.com/a/63247888/3127111) to my other question. Thanks. – watery Aug 04 '20 at 14:47

0 Answers0