I can't pip install Jupyter Notebook on Python3.9 [duplicate] - python

This question already has answers here:
Jupyter Notebook installation error - Building wheel for argon2-cffi (PEP 517) ... error
(7 answers)
Closed 2 years ago.
This is the error that I get when I try to pip install notebook.
I am using Python3.9. I installed VS C++ Build tools and restarted my machine too.
Still can't seem to get jupyter installed, can someone please help with this? Thanks!
ERROR: Command errored out with exit status 1:
command: 'c:\users\sahi0h\appdata\local\programs\python\python39\python.exe' 'c:\users\sahi0h\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\sahi0h\AppData\Local\Temp\tmpgkwkmc6k'
cwd: C:\Users\sahi0h\AppData\Local\Temp\pip-install-29y4gn0n\argon2-cffi
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\argon2
copying src\argon2\exceptions.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\low_level.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_ffi_build.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_legacy.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_password_hasher.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_utils.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__init__.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__main__.py -> build\lib.win-amd64-3.9\argon2
running build_clib
building 'argon2' library
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\extras
creating build\temp.win-amd64-3.9\extras\libargon2
creating build\temp.win-amd64-3.9\extras\libargon2\src
creating build\temp.win-amd64-3.9\extras\libargon2\src\blake2
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iextras\libargon2\src\..\include -Iextras\libargon2\src\blake2 -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include /Tcextras\libargon2\src\argon2.c /Fobuild\temp.win-amd64-3.9\extras\libargon2\src\argon2.obj
argon2.c
extras\libargon2\src\argon2.c(18): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for argon2-cffi
Failed to build argon2-cffi
ERROR: Could not build wheels for argon2-cffi which use PEP 517 and cannot be installed directly```

Found kind of a solution -- I uninstalled Python3.9 and installed Python3.8. Pip install is working now.

Related

pip install mod_wsgi issue

install is failing and cant figure out why. ive spent a lot of time researching this issue and half of the people are saying the apache24 folder is in the wrong place, which ive double checked its correct. and the other half say its because windows sdk tools are not installed, which ive double checked they are.
PS C:\Users\Mlong\Downloads\ZTP 4\ZTP> pip install mod_wsgi
Collecting mod_wsgi
Using cached mod_wsgi-4.9.4.tar.gz (497 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: mod_wsgi
Building wheel for mod_wsgi (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi
creating build\lib.win-amd64-3.10\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.10\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.10\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\server
creating build\lib.win-amd64-3.10\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\server\management
creating build\lib.win-amd64-3.10\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.10\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.10\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\docs
creating build\lib.win-amd64-3.10\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.10\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
creating build\temp.win-amd64-3.10\Release\src
creating build\temp.win-amd64-3.10\Release\src\server
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\Apache24/include -IC:\Users\Mlong\scoop\apps\python\current\include -IC:\Users\Mlong\scoop\apps\python\current\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.10\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\Mlong\AppData\Local\Temp\pip-install-_ff1h4o2\mod-wsgi_515cd9eaaab14ec4b1614328e8f7a27a\src\server\wsgi_apache.h(39): fatal error C1083: Cannot open include file: 'ws2tcpip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mod_wsgi
Running setup.py clean for mod_wsgi
Failed to build mod_wsgi
Installing collected packages: mod_wsgi
Running setup.py install for mod_wsgi ... error
error: subprocess-exited-with-error
× Running setup.py install for mod_wsgi did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi
creating build\lib.win-amd64-3.10\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.10\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.10\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\server
creating build\lib.win-amd64-3.10\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\server\management
creating build\lib.win-amd64-3.10\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.10\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.10\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\docs
creating build\lib.win-amd64-3.10\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.10\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.10\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
creating build\temp.win-amd64-3.10\Release\src
creating build\temp.win-amd64-3.10\Release\src\server
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\Apache24/include -IC:\Users\Mlong\scoop\apps\python\current\include -IC:\Users\Mlong\scoop\apps\python\current\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.10\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\Mlong\AppData\Local\Temp\pip-install-_ff1h4o2\mod-wsgi_515cd9eaaab14ec4b1614328e8f7a27a\src\server\wsgi_apache.h(39): fatal error C1083: Cannot open include file: 'ws2tcpip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[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.
╰─> mod_wsgi
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

When I Try To Install 'PyGObject' With pip I Get an Error

When I am trying to install PyGObject I get an error. I am using Python 3.10 and Windows Command Prompt.
C:\windows\system32>pip install PyGObject
Collecting PyGObject
Using cached PyGObject-3.42.1.tar.gz (718 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pycairo>=1.16.0 in c:\users\mona.hynes.lisdoon\appdata\local\programs\python\python310\lib\site-packages (from PyGObject) (1.21.0)
Building wheels for collected packages: PyGObject
Building wheel for PyGObject (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for PyGObject (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [48 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\pygtkcompat
copying pygtkcompat\generictreemodel.py -> build\lib.win-amd64-cpython-310\pygtkcompat
copying pygtkcompat\pygtkcompat.py -> build\lib.win-amd64-cpython-310\pygtkcompat
copying pygtkcompat\__init__.py -> build\lib.win-amd64-cpython-310\pygtkcompat
creating build\lib.win-amd64-cpython-310\gi
copying gi\docstring.py -> build\lib.win-amd64-cpython-310\gi
copying gi\importer.py -> build\lib.win-amd64-cpython-310\gi
copying gi\module.py -> build\lib.win-amd64-cpython-310\gi
copying gi\pygtkcompat.py -> build\lib.win-amd64-cpython-310\gi
copying gi\types.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_constants.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_error.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_gtktemplate.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_option.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_ossighelper.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_propertyhelper.py -> build\lib.win-amd64-cpython-310\gi
copying gi\_signalhelper.py -> build\lib.win-amd64-cpython-310\gi
copying gi\__init__.py -> build\lib.win-amd64-cpython-310\gi
creating build\lib.win-amd64-cpython-310\gi\repository
copying gi\repository\__init__.py -> build\lib.win-amd64-cpython-310\gi\repository
creating build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\Gdk.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\GdkPixbuf.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\GIMarshallingTests.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\Gio.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\GLib.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\GObject.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\Gtk.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\keysyms.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\Pango.py -> build\lib.win-amd64-cpython-310\gi\overrides
copying gi\overrides\__init__.py -> build\lib.win-amd64-cpython-310\gi\overrides
running build_ext
pycairo: new API
pycairo: trying include directory: 'C:\\Users\\mona.hynes.LISDOON\\AppData\\Local\\Temp\\pip-build-env-6iivyiiw\\overlay\\Lib\\site-packages\\cairo\\include'
pycairo: found 'C:\\Users\\mona.hynes.LISDOON\\AppData\\Local\\Temp\\pip-build-env-6iivyiiw\\overlay\\Lib\\site-packages\\cairo\\include\\py3cairo.h'
building 'gi._gi' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\gi
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPY_SSIZE_T_CLEAN -IC:\Users\mona.hynes.LISDOON\AppData\Local\Temp\pip-install-zi8f2b72\pygobject_c02dc4480e0747d4bcd87d8b59ba11df -IC:\Users\mona.hynes.LISDOON\AppData\Local\Temp\pip-install-zi8f2b72\pygobject_c02dc4480e0747d4bcd87d8b59ba11df\gi -IC:\Users\mona.hynes.LISDOON\AppData\Local\Programs\Python\Python310\include -IC:\Users\mona.hynes.LISDOON\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcgi\gimodule.c /Fobuild\temp.win-amd64-cpython-310\Release\gi\gimodule.obj -FImsvc_recommended_pragmas.h
gimodule.c
gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.31.31103\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for PyGObject
Failed to build PyGObject
ERROR: Could not build wheels for PyGObject, which is required to install pyproject.toml-based projects
I had the same issue and the problem is that PyGObject needs to be compiled which will be done by default using Microsoft Visual Studio. This seems not to work. I also read somewhere that this won't work.
I managed to compile it using the instructions on https://pygobject.readthedocs.io/en/latest/getting_started.html but then got errors importing it into my project ('circular import'). Msys2 relies on python 3.9 by default, while I'm using 3.10. Could be related. Did not have time to look further, yet. So I'm happy for solutions to that :) Maybe will try changing to 3.9. later.

Why do I get this error when installing Jupyter notebook?

ERROR: Command errored out with exit status 1:
command: 'c:\users\nithi\appdata\local\programs\python\python39\python.exe' 'c:\users\nithi\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\nithi\AppData\Local\Temp\tmpba_qtkcq'
cwd: C:\Users\nithi\AppData\Local\Temp\pip-install-dq1r1ff8\argon2-cffi
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\argon2
copying src\argon2\exceptions.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\low_level.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_ffi_build.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_legacy.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_password_hasher.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_utils.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__init__.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__main__.py -> build\lib.win-amd64-3.9\argon2
running build_clib
building 'argon2' library
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\extras
creating build\temp.win-amd64-3.9\extras\libargon2
creating build\temp.win-amd64-3.9\extras\libargon2\src
creating build\temp.win-amd64-3.9\extras\libargon2\src\blake2
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iextras\libargon2\src\..\include -Iextras\libargon2\src\blake2 -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include /Tcextras\libargon2\src\argon2.c /Fobuild\temp.win-amd64-3.9\extras\libargon2\src\argon2.obj
argon2.c
extras\libargon2\src\argon2.c(18): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for argon2-cffi
Failed to build argon2-cffi
ERROR: Could not build wheels for argon2-cffi which use PEP 517 and cannot be installed directly
I keep getting this error when I try to install jupyter notebook.
pip install notebook, this is the command I used on the command line.
One website suggested to install visual studio C++, Which I did and still no luck. Any help is appreciated. Thank you

Error installing Jupyter-Notebook on Window with python 3.9

Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\argon2
copying src\argon2\exceptions.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\low_level.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_ffi_build.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_legacy.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_password_hasher.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_utils.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__init__.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__main__.py -> build\lib.win-amd64-3.9\argon2
running build_clib
building 'argon2' library
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\extras
creating build\temp.win-amd64-3.9\extras\libargon2
creating build\temp.win-amd64-3.9\extras\libargon2\src
creating build\temp.win-amd64-3.9\extras\libargon2\src\blake2
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iextras\libargon2\src\..\include -Iextras\libargon2\src\blake2 -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include /Tcextras\libargon2\src\argon2.c /Fobuild\temp.win-amd64-3.9\extras\libargon2\src\argon2.obj
argon2.c
extras\libargon2\src\argon2.c(18): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for argon2-cffi
Failed to build argon2-cffi
ERROR: Could not build wheels for argon2-cffi which use PEP 517 and cannot be installed directly
Getting this error when trying to install Jupyter-Notebook using pip install
I am using Python 3.9 and pip 20.2.3. I have installed Microsoft Visual C++ 2015-2019 Redistributable - 14.27.29112
Need help to get this resolved.
Try this:
python -m pip install jupyter notebook
I installed reinstalled visual c 2019 build tools via the installer from ms and then I upgraded pip using
python -m pip install --upgrade pip
after that it works. I am on python 3.7 installed via chocolatey
Based on my Experience I think Python 3.9 isn't supported yet for Jupyter, So what I did is I install the older version which is the Python 3.8.

Can't build mod_wsgi on Windows 10 - "Cannot open include file: 'ws2tcpip.h'" - Have VS 2019 Build tools

I have apache 2.4 installed (64 bit), python 3.7 (64 bit) (installed from Anaconda, if that matters) and VS 2019 C++ build tools, with the SDK and everything else required to build this checked. I still cannot build mod_wsgi with pip install. How can I get this to work on Windows 10?
I have tried uninstalling and reinstalling, python, visual studio & visual studio build tools, and apache. I have tried all the various visual studio command prompts. I have checked stack overflow, github, and other sites. There were others with similar issues but the solution of installing build tools did not work for me because a.) I already had it, b.) I reinstalled everything and it still didn't work.
pip install mod_wsgi
Resulting error message:
Collecting mod_wsgi
Using cached https://files.pythonhosted.org/packages/26/03/a3ed5abc2e66c82c40b0735c2f819c898d136879b00be4f5537126b6a4a4/mod_wsgi-4.6.7.tar.gz
Building wheels for collected packages: mod-wsgi
Building wheel for mod-wsgi (setup.py) ... error
ERROR: Complete output from command 'C:\Users\VC046230\AppData\Local\Continuum\anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\VC046230\\AppData\\Local\\Temp\\pip-install-12r9v42f\\mod-wsgi\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\VC046230\AppData\Local\Temp\pip-wheel-1q_bver8' --python-tag cp37:
ERROR: C:\Users\VC046230\AppData\Local\Continuum\anaconda3\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi
creating build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.7\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server
creating build\lib.win-amd64-3.7\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management
creating build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.7\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\docs
creating build\lib.win-amd64-3.7\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.7\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.7\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\server
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\Apache24/include -IC:\Users\VC046230\AppData\Local\Continuum\anaconda3\include -IC:\Users\VC046230\AppData\Local\Continuum\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.7\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\VC046230\AppData\Local\Temp\pip-install-12r9v42f\mod-wsgi\src\server\wsgi_apache.h(39): fatal error C1083: Cannot open include file: 'ws2tcpip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for mod-wsgi
I just solved the same problem. My config is Windows 10, Python 3.8.1, Apache2.4.39-Win64-VC15-OpenSSL1.1.1b, mod-wsgi 4.7.1.
1) I installed using Build Tools
Visual Studio Build Tools Main Components
SDK for Windows 10 (10.0.18362.0) since I'm using Windows 10
MSVC 140 - C++ VS 2015 (v.14.00)
2) Then I added C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin to PATH
3) Then I got the next error:
'apr_perms_set.h': No such file or directory'.
I downloaded the file and put it into $APACHE_DIR\include
4) Then I got third error:
fatal error LNK1158: cannot run ‘rc.exe’.
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
I took following files rc.exe rcdll.dll from C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86 and paste them into C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
5) Congratulations!
To anyone who had this issue, the following github issue helped me resolve it: https://github.com/GrahamDumpleton/mod_wsgi/issues/194
I had already installed Visual C++ Redistributable, so I was confused why pip install mod_wsgi still was not working.
All I ended up having to do was install Windows 10 SDK from https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/
(might also need 8.1 if it still does not work)

Categories

Resources