4

I got an error when install dependencies for my project!

OS : WinDow 11

Python: 3.10.4 (64bit)

Pip: 22.1.2

  Building wheel for django-admin-sortable2 (setup.py) ... done
  Created wheel for django-admin-sortable2: filename=django_admin_sortable2-0.7.5-py3-none-any.whl size=69989 sha256=0a4ff29d0c9b0422611dde61c6c1665dd36b10f98413f4ed7b8532e29afdc03d
  Stored in directory: c:\users\kev\appdata\local\pip\cache\wheels\99\3e\95\384eeaa2d641ef0c9e8b46e701737b53ae6a973358887816e0
  Building wheel for easy-thumbnails (setup.py) ... done
  Created wheel for easy-thumbnails: filename=easy_thumbnails-2.7-py2.py3-none-any.whl size=69700 sha256=ce66afcd2ca403acf9225b53eed60300c8d37c3bad53dcdf37ebc3a25550bdc6
  Stored in directory: c:\users\kev\appdata\local\pip\cache\wheels\cb\33\00\f7fa4b381ae4cbaf99674fb7a4411339d38e616cfcc41632c5
  Building wheel for gevent (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for gevent (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [288 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\gevent
      copying src\gevent\ares.py -> build\lib.win-amd64-cpython-310\gevent
      copying src\gevent\backdoor.py -> build\lib.win-amd64-cpython-310\gevent
      copying src\gevent\baseserver.py -> build\lib.win-amd64-cpython-310\gevent
      copying src\gevent\builtins.py -> build\lib.win-amd64-cpython-310\gevent
Kev
  • 315
  • 1
  • 4
  • 11

2 Answers2

3

gevent==20.9.0 probably doesn't support Python 3.10, you can downgrade to Python 3.8 or you can try to download and install the latest version of gevent - gevent 21.12.0 - see https://pypi.org/project/gevent/#downloads.

  1. Go to requirements.txt and replace the line gevent==20.9.0 with gevent==21.12.0.
  2. After that you can try to install all dependencies: pip install -r requirements.txt

If the solution above doesn't help, try to manually install a gevent wheel:

  1. Download greenlet wheel greenlet‑1.1.2‑cp310‑cp310‑win_amd64.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#greenlet
  2. Go to the local directory which contains downloaded greenlet wheel and install it
pip install greenlet‑1.1.2‑cp310‑cp310‑win_amd64.whl
  1. Download gevent wheel gevent‑21.12.0‑cp310‑cp310‑win_amd64.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#gevent
  2. Go to the local directory which contains downloaded gevent wheel and install it
pip install gevent‑21.12.0‑cp310‑cp310‑win_amd64.whl
  1. Finally you can remove gevent==20.9.0 from requirements.txt and install other dependencies: pip install -r requirements.txt
DVN-Anakin
  • 1,549
  • 1
  • 8
  • 12
2

tl;dr: use python3.8 or update requirement.txt versions.

More info:

The combination of (A) gevent==20.9, (B) windows 10, and (C) python3.10 does not have a prebuilt wheel. You can check this kind of stuff by going to pypi and looking what is offered for downloads (https://pypi.org/project/gevent/20.9.0/#files)

I'm assuming that you will not be able to compile things from source yourself (it's a hassle), so you need to change (A), (B) or (C).

(A). Changing this means relaxing or updating the version requirements. For example gevent==21.12 does have a wheel for windows and python3.10

(B). Changing this means not using windows, probably not an option

(C). Changing this means using older python version. For example, python3.8 has a wheel for gevent==20.9.

psarka
  • 1,562
  • 1
  • 13
  • 25
  • Hi, I try to install python 3.8.10 --> run `virtualenv -p python3.8.10` --> insall pyenv-win and run `pyenv global 3.8.10`, gevent fixed but appear another error https://pastebin.com/9KT7yKJU – Kev Jun 28 '22 at 09:48
  • You are out of luck :( https://github.com/lericson/pylibmc/issues/247. The recommendation is not to use windows: "My suggestion is to either use the Linux layer of Windows, or just change to a more typical development platform. In fact, basically any other platform would work: BSD, Linux, macOS." – psarka Jun 28 '22 at 09:54
  • 1
    thank you! I will install Unbuntu now and say goodbye Window :D – Kev Jun 28 '22 at 10:03