jamesroberts / fastwsgi

An ultra fast WSGI server for Python 3
Other
431 stars 14 forks source link

Install error due to deprication of setuptools #53

Open Nassehk opened 3 weeks ago

Nassehk commented 3 weeks ago

Hello, Thanks for making this awesome server. It looks really promising. I am getting the following error after pip install fastwsgi:

(venv) [03:12:28] [/media/nasseh/Data/code/python/benchmarks/fastapiVsFastwsgi] ❱❱❱ pip3 install fastwsgi  
Collecting fastwsgi
  Downloading fastwsgi-0.0.9.tar.gz (439 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 439.4/439.4 kB 2.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting click>=7.0
  Using cached click-8.1.7-py3-none-any.whl (97 kB)
Installing collected packages: click, fastwsgi
  DEPRECATION: fastwsgi is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for fastwsgi ... error
  error: subprocess-exited-with-error

  × Running setup.py install for fastwsgi did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      running install
      /media/nasseh/Data/code/python/benchmarks/fastapiVsFastwsgi/venv/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      copying fastwsgi.py -> build/lib.linux-x86_64-cpython-311
      running build_ext
      building '_fastwsgi' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/fastwsgi
      creating build/temp.linux-x86_64-cpython-311/libuv
      creating build/temp.linux-x86_64-cpython-311/libuv/src
      creating build/temp.linux-x86_64-cpython-311/libuv/src/unix
      creating build/temp.linux-x86_64-cpython-311/llhttp
      creating build/temp.linux-x86_64-cpython-311/llhttp/src
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE=1 -Illhttp/include -Ilibuv/include -I/media/nasseh/Data/code/python/benchmarks/fastapiVsFastwsgi/venv/include -I/usr/include/python3.11 -Ilibuv/include -Ilibuv/src -c fastwsgi/common.c -o build/temp.linux-x86_64-cpython-311/fastwsgi/common.o -O3 -fno-strict-aliasing -fcommon -g -Wall -Wno-unused-function -Wno-unused-variable
      In file included from fastwsgi/common.c:1:
      fastwsgi/common.h:4:10: fatal error: Python.h: No such file or directory
          4 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> fastwsgi

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I tried these to solve the problem but neither worked: python -m pip install --upgrade pip setuptools and pip3 install fastwsgi --use-pep517 I am running python 3.11.2 on MX Linux 23.3 which is based on Debian 12.6. How can this be fixed? I only know python. Can I help in anyway. Please let me know. Cheers,

Nassehk commented 3 weeks ago

I found the solution. I needed dev-tools. For my MX linux this command did the job: sudo apt-get install python3.11-dev