How to install Charm-crypto library for python3 on windows 10? - python

I've installed GMP 5.x , PBC (latest) and OPENSSL but when I try `pip3 install charm-crypto this error occurs. If anyone knows how to solve this error because I don't understand it please tell me? By the way the error is much longer than this but I couldn't paste it, It is mostly repeating the process of copying
(venv) C:\Users\admin\PycharmProjects\Testing>pip3 install charm-crypto
Collecting charm-crypto
Using cached Charm-Crypto-0.43.tar.gz (364 kB)
Requirement already satisfied: setuptools in c:\users\admin\pycharmprojects\testing\venv\lib\site-packages (from charm-crypto) (50.3.2)
Requirement already satisfied: pyparsing>=1.5.5 in c:\users\admin\pycharmprojects\testing\venv\lib\site-packages (from charm-crypto) (2.4.7)
Using legacy 'setup.py install' for charm-crypto, since package 'wheel' is not installed.
Installing collected packages: charm-crypto
Running setup.py install for charm-crypto ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\admin\pycharmprojects\testing\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\admin\\AppData\
\Local\\Temp\\pip-install-83yi7s_w\\charm-crypto\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-83yi7s_w\\charm-crypto\\setup.py'"
'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-vq3a6qkl\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users
\admin\pycharmprojects\testing\venv\include\site\python3.9\charm-crypto'
cwd: C:\Users\admin\AppData\Local\Temp\pip-install-83yi7s_w\charm-crypto\
Complete output (194 lines):
Platform: Windows
Config file: config.mk
Warning, using default config vaules.
You probably want to run ./configure.sh first.
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\charm
copying charm\config.py -> build\lib.win-amd64-3.9\charm
copying charm\__init__.py -> build\lib.win-amd64-3.9\charm
creating build\lib.win-amd64-3.9\charm\core
copying charm\core\__init__.py -> build\lib.win-amd64-3.9\charm\core
creating build\lib.win-amd64-3.9\charm\core\crypto
copying charm\core\crypto\__init__.py -> build\lib.win-amd64-3.9\charm\core\crypto
copying charm\adapters\abenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\dabenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\ibenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\ibenc_adapt_identityhash.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\kpabenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\pkenc_adapt_bchk05.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\pkenc_adapt_chk04.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\pkenc_adapt_hybrid.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\pksig_adapt_naor01.py -> build\lib.win-amd64-3.9\charm\adapters
copying charm\adapters\__init__.py -> build\lib.win-amd64-3.9\charm\adapters
running build_ext
building 'charm.core.math.pairing' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\charm
creating build\temp.win-amd64-3.9\Release\charm\core
creating build\temp.win-amd64-3.9\Release\charm\core\benchmark
creating build\temp.win-amd64-3.9\Release\charm\core\math
creating build\temp.win-amd64-3.9\Release\charm\core\math\pairing
creating build\temp.win-amd64-3.9\Release\charm\core\utilities
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DBENCHMARK_E
NABLED=1 -Icharm/core/utilities/ -Icharm/core/benchmark/ -Ic:\users\admin\pycharmprojects\testing\venv\include -IC:\Users\admin\AppData\Local\Programs\Python\Python3
9\include -IC:\Users\admin\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\
ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10
.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Fi
les (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tccharm/core/benchmark/benchmarkmodule.c
/Fobuild\temp.win-amd64-3.9\Release\charm/core/benchmark/benchmarkmodule.obj
benchmarkmodule.c
C:\Users\admin\AppData\Local\Temp\pip-install-83yi7s_w\charm-crypto\charm\core\benchmark\benchmarkmodule.h(12): fatal error C1083: Impossible d'ouvrir le fichier
includeÿ: 'sys/time.h'ÿ: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit cod
e 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\admin\pycharmprojects\testing\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0]
= '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-83yi7s_w\\charm-crypto\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-8
3yi7s_w\\charm-crypto\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(c
ode, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-vq3a6qkl\install-record.txt' --single-version-externally-managed --co
mpile --install-headers 'c:\users\admin\pycharmprojects\testing\venv\include\site\python3.9\charm-crypto' Check the logs for full command output.

The problem is there is file with code which is not compatible with MSVC. sys/time.h is included in benchmarkmodule.h and unfortunately this file does not exit in MSVC.
Try to install mingw, set the CC to mingw compiler and run the pip3 command . If it still not working you can try to build it directly like explained in https://jhuisi.github.io/charm/install_source.html.
In all cases you will need a mingw compiler. However, it may be complicated.
You will need to install the msvc redistributable. When you run the make command, f you face the error Unknown MS Compiler version 1927. modify the cygwinccompiler.py file by adding :
#custom add
elif msc_ver == '1927':
# VS2019 / MSVC 16.7
return ['msvcr100']
#custom add
before the last add.
You may also need to add a file distutils.cfg like explained in https://wiki.python.org/moin/WindowsCompilers. Once these modifications done, the compilation should start normally.
Perhaps the easiest would be to compile it under linux.

Related

Error with installing REBOUND in Python/PIP: ...Microsoft Visual Studio\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

I have a problem with installing Rebound via pip on Python. I initialize the installation with:
pip3 install rebound
Output starts with the following:
Collecting rebound
Using cached rebound-3.14.0.tar.gz (250 kB)
Using legacy 'setup.py install' for rebound, since package 'wheel' is not installed.
Installing collected packages: rebound
Running setup.py install for rebound ... \
and then an error appears:
Running setup.py install for rebound ... \ WARNING: Subprocess output does not appear to be encoded as cp1250
error
ERROR: Command errored out with exit status 1:
command: 'c:\users\jacob\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jacob\\AppData\\Local\\Temp\\pip-install-clca5gs3\\rebound_a19ceff23d4844dfb1d9ce4d08fba984\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jacob\\AppData\\Local\\Temp\\pip-install-clca5gs3\\rebound_a19ceff23d4844dfb1d9ce4d08fba984\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Jacob\AppData\Local\Temp\pip-record-8w1f5up7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\jacob\appdata\local\programs\python\python39\Include\rebound'
cwd: C:\Users\Jacob\AppData\Local\Temp\pip-install-clca5gs3\rebound_a19ceff23d4844dfb1d9ce4d08fba984\
Complete output (27 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\rebound
copying rebound\citations.py -> build\lib.win-amd64-3.9\rebound
copying rebound\data.py -> build\lib.win-amd64-3.9\rebound
copying rebound\horizons.py -> build\lib.win-amd64-3.9\rebound
copying rebound\interruptible_pool.py -> build\lib.win-amd64-3.9\rebound
copying rebound\particle.py -> build\lib.win-amd64-3.9\rebound
copying rebound\plotting.py -> build\lib.win-amd64-3.9\rebound
copying rebound\simulation.py -> build\lib.win-amd64-3.9\rebound
copying rebound\simulationarchive.py -> build\lib.win-amd64-3.9\rebound
copying rebound\tools.py -> build\lib.win-amd64-3.9\rebound
copying rebound\units.py -> build\lib.win-amd64-3.9\rebound
copying rebound\widget.py -> build\lib.win-amd64-3.9\rebound
copying rebound\__init__.py -> build\lib.win-amd64-3.9\rebound
copying rebound\rebound.h -> build\lib.win-amd64-3.9\rebound
running build_ext
building 'librebound' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLIBREBOUND -Isrc -Ic:\users\jacob\appdata\local\programs\python\python39\include -Ic:\users\jacob\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/binarydiff.c /Fobuild\temp.win-amd64-3.9\Release\src/binarydiff.obj -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DGITHASH=eb1f3890ab7f01487de2b3d01c42c1acdfd9d5e5 -DLIBREBOUND -D_GNU_SOURCE -fPIC
cl : Wiersz polecenia error D8021 : nieprawid\x88owy argument numeryczny "/Wno-unknown-pragmas"
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\jacob\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jacob\\AppData\\Local\\Temp\\pip-install-clca5gs3\\rebound_a19ceff23d4844dfb1d9ce4d08fba984\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jacob\\AppData\\Local\\Temp\\pip-install-clca5gs3\\rebound_a19ceff23d4844dfb1d9ce4d08fba984\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Jacob\AppData\Local\Temp\pip-record-8w1f5up7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\jacob\appdata\local\programs\python\python39\Include\rebound' Check the logs for full command output.
Any idea what is the problem? It's clearly connected with MSVC. At the beginning there was an error which required MSVC ver. 14 or higher to be installed. After I've installed MSVC, above error occures.
Python ver. 3.9
pip ver. 21.0
setup.py adds a lot of compiler flags specific to gcc. It seems the authors don't expect the code to be used on w32. Only Linux and MacOS X are supported.

Error in pip install in Python 3.9 related to Visual Studio

I have an error while installing jupyter-notebook in Pycharm terminal on Windows:
pip install notebook
Currently I use Python 3.9
I have tried to install in Pycharm's terminal with/without administrator permisions.
I have tried to install in console with/without administrator permisions.
I have tried to reinstall Python 3.9.
I think there are some problems with Visual Studio, because the message displays the Visual Studio 2019 directory. But why? I launched pip install in PyCharm terminal, I didn't open Visual Studio in this time.
One of the last rows in error message:
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
Full displayed message:
Building wheels for collected packages: pywinpty
Building wheel for pywinpty (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\пк\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ПК\\AppData\\Local\\Temp\\pip-install-e2
xrfsm7\\pywinpty\\setup.py'"'"'; __file__='"'"'C:\\Users\\ПК\\AppData\\Local\\Temp\\pip-install-e2xrfsm7\\pywinpty\\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\ПК\AppData\Local\Temp\pip-wheel-hv58iobu'
cwd: C:\Users\ПК\AppData\Local\Temp\pip-install-e2xrfsm7\pywinpty\
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\winpty
copying winpty\ptyprocess.py -> build\lib.win-amd64-3.9\winpty
copying winpty\winpty_wrapper.py -> build\lib.win-amd64-3.9\winpty
copying winpty\__init__.py -> build\lib.win-amd64-3.9\winpty
creating build\lib.win-amd64-3.9\winpty\tests
copying winpty\tests\test_cywinpty.py -> build\lib.win-amd64-3.9\winpty\tests
copying winpty\tests\test_ptyprocess.py -> build\lib.win-amd64-3.9\winpty\tests
copying winpty\tests\test_winpty_wrapper.py -> build\lib.win-amd64-3.9\winpty\tests
copying winpty\tests\__init__.py -> build\lib.win-amd64-3.9\winpty\tests
creating build\lib.win-amd64-3.9\winpty\_winpty
copying winpty\_winpty\__init__.py -> build\lib.win-amd64-3.9\winpty\_winpty
running build_ext
building 'winpty.cywinpty' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\winpty
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\пк\appdata\local\programs\p
ython\python39\include -Ic:\users\пк\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\includ
e -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\
Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Progra
m Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcwinpty/cywinpty.c /Fobuild\temp.win-amd64-3.9\Release\wi
npty/cywinpty.obj
cywinpty.c
winpty/cywinpty.c(629): fatal error C1083: Cannot open include file: 'winpty.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pywinpty
Running setup.py clean for pywinpty
Failed to build pywinpty
Installing collected packages: pywinpty, terminado, notebook
Running setup.py install for pywinpty ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\пк\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ПК\\AppData\\Local\\Temp\\pip-install-
e2xrfsm7\\pywinpty\\setup.py'"'"'; __file__='"'"'C:\\Users\\ПК\\AppData\\Local\\Temp\\pip-install-e2xrfsm7\\pywinpty\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);cod
e=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ПК\AppData\Local\Temp\pip-record-y8q1qlob\install-reco
rd.txt' --single-version-externally-managed --compile --install-headers 'c:\users\пк\appdata\local\programs\python\python39\Include\pywinpty'
cwd: C:\Users\ПК\AppData\Local\Temp\pip-install-e2xrfsm7\pywinpty\
Complete output (25 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\winpty
copying winpty\ptyprocess.py -> build\lib.win-amd64-3.9\winpty
copying winpty\winpty_wrapper.py -> build\lib.win-amd64-3.9\winpty
copying winpty\__init__.py -> build\lib.win-amd64-3.9\winpty
creating build\lib.win-amd64-3.9\winpty\tests
copying winpty\tests\test_cywinpty.py -> build\lib.win-amd64-3.9\winpty\tests
copying winpty\tests\test_ptyprocess.py -> build\lib.win-amd64-3.9\winpty\tests
copying winpty\tests\test_winpty_wrapper.py -> build\lib.win-amd64-3.9\winpty\tests
copying winpty\tests\__init__.py -> build\lib.win-amd64-3.9\winpty\tests
creating build\lib.win-amd64-3.9\winpty\_winpty
copying winpty\_winpty\__init__.py -> build\lib.win-amd64-3.9\winpty\_winpty
running build_ext
building 'winpty.cywinpty' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\winpty
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\пк\appdata\local\programs
\python\python39\include -Ic:\users\пк\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\incl
ude -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86
)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Prog
ram Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcwinpty/cywinpty.c /Fobuild\temp.win-amd64-3.9\Release\
winpty/cywinpty.obj
cywinpty.c
winpty/cywinpty.c(629): fatal error C1083: Cannot open include file: 'winpty.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\пк\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ПК\\A
ppData\\Local\\Temp\\pip-install-e2xrfsm7\\pywinpty\\setup.py'"'"'; __file__='"'"'C:\\Users\\ПК\\AppData\\Local\\Temp\\pip-install-e2xrfsm7\\pywinpty\\setup.py'"'"';f=getattr(tokenize, '"
'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ПК\AppData\Local\Temp
\pip-record-y8q1qlob\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\пк\appdata\local\programs\python\python39\Include\pywinpty' Check the lo
gs for full command output.
There are related unanswered questions:
Why do I get this error when installing Jupyter notebook?

How to fix ERROR while installing WSGI for PYTHON

I can't install WSGI for Python. I have tried lots of things.
I have installed the latest versions of pip, python, apache, setuptools.
I can't understand why WSGI is not installing
I have started learning python a few days ago on my own.
I have watched lots of videos and i've read lots of informations in different forums. But i couldn't solve this problem
Maybe i'm doing something wrong
D:\It\Console2>pip install mod_wsgi
Collecting mod_wsgi
Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
Building wheels for collected packages: mod-wsgi
Building wheel for mod-wsgi (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'd:\it\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-install-ih8ke_\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-install-55ih8ke_\\mod-wsgi\\setup.py'"'"';f=getattr(tokeniz '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheeld 'C:\Users\TheFlash\AppData\Local\Temp\pip-wheel-xh383iwl'
cwd: C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\
Complete output (33 lines):
d:\it\python\lib\distutils\dist.py:261: 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.6
creating build\lib.win-amd64-3.6\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi
creating build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server
creating build\lib.win-amd64-3.6\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management
creating build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.6\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\docs
creating build\lib.win-amd64-3.6\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.6\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\src
creating build\temp.win-amd64-3.6\Release\src\server
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IDIt\Apache/include -Id:\it\python\include -Id:\it\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.286\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-I\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (6)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.6\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\src\server\wsgi_apache.h(42): fatal error C1083: ?? г¤ ?вбп RвЄалвм д c< ўЄ<оз?-Ё?:
tpd.h: No such file or directory,
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed witexit status 2
----------------------------------------
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: Command errored out with exit status 1:
command: 'd:\it\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-instal55ih8ke_\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-install-55ih8ke_\\mod-wsgi\\setup.py'"'"';f=getattr(tokene, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install -ecord 'C:\Users\TheFlash\AppData\Local\Temp\pip-record-vqudmtwm\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\ipython\Include\mod-wsgi'
cwd: C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\
Complete output (33 lines):
d:\it\python\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\mod_wsgi
copying src\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi
creating build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\apxs_config.py -> build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\environ.py -> build\lib.win-amd64-3.6\mod_wsgi\server
copying src\server\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server
creating build\lib.win-amd64-3.6\mod_wsgi\server\management
copying src\server\management\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management
creating build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
copying src\server\management\commands\runmodwsgi.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
copying src\server\management\commands\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\server\management\commands
creating build\lib.win-amd64-3.6\mod_wsgi\docs
copying docs\_build\html\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\docs
creating build\lib.win-amd64-3.6\mod_wsgi\images
copying images\__init__.py -> build\lib.win-amd64-3.6\mod_wsgi\images
copying images\snake-whiskey.jpg -> build\lib.win-amd64-3.6\mod_wsgi\images
running build_ext
building 'mod_wsgi.server.mod_wsgi' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\src
creating build\temp.win-amd64-3.6\Release\src\server
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -:\It\Apache/include -Id:\it\python\include -Id:\it\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.210\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Filesx86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/server\mod_wsgi.c /Fobuild\temp.win-amd64-3.6\Release\src/server\mod_wsgi.obj
mod_wsgi.c
C:\Users\TheFlash\AppData\Local\Temp\pip-install-55ih8ke_\mod-wsgi\src\server\wsgi_apache.h(42): fatal error C1083: ?? г¤ ?вбп RвЄалвм д c< ўЄ<оз?-Ё?httpd.h: No such file or directory,
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed wh exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\it\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\TheFlash\ppData\\Local\\Temp\\pip-install-55ih8ke_\\mod-wsgi\\setup.py'"'"'; __file__='"'"'C:\\Users\\TheFlash\\AppData\\Local\\Temp\\pip-install-55ih8ke_\\mod-ws\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __fi__, '"'"'exec'"'"'))' install --record 'C:\Users\TheFlash\AppData\Local\Temp\pip-record-vqudmtwm\install-record.txt' --single-version-externally-managed
compile --install-headers 'd:\it\python\Include\mod-wsgi' Check the logs for full command output.
EDIT:
You might be able to find your solution from this answer
Here are steps that I took:
Install python x64 (may need to double check you downloaded the right one for your OS)
Install pip
Install Apache
Moved the extracted Apache24 folder to C:\
Set the env variable for apache with set "MOD_WSGI_APACHE_ROOTDIR=C:\Apache24"
Install Microsoft C++ build tools
Restart machine
Run pip install mod_wsgi

snappy/snappymodule.cc(31): fatal error C1083: Cannot open include file: 'snappy-c.h': No such file or directory

I'm not able to install python-snappy module. I have successfully installed snappy module first but getting below error for python-snappy.
(new-env) C:\Automation\test-automation\connect>pip install python-snappy
Collecting python-snappy
Using cached https://files.pythonhosted.org/packages/45/35/65d9f8cc537129894b4b32647d80212d1fa342877581c5b8a69872cea8be/python-snappy-0.5.4.tar.gz
Installing collected packages: python-snappy
Running setup.py install for python-snappy ... error
Complete output from command C:\Automation\test-automation\new-env\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\vagrant\\AppData\\Local\\Temp\\
2\\pip-install-17b8xwg1\\python-snappy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))
" install --record C:\Users\vagrant\AppData\Local\Temp\2\pip-record-vdvhb6a5\install-record.txt --single-version-externally-managed --compile --install-headers C:\Automation\tes
t-automation\new-env\include\site\python3.7\python-snappy:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\snappy
copying snappy\hadoop_snappy.py -> build\lib.win32-3.7\snappy
copying snappy\snappy.py -> build\lib.win32-3.7\snappy
copying snappy\snappy_cffi.py -> build\lib.win32-3.7\snappy
copying snappy\snappy_cffi_builder.py -> build\lib.win32-3.7\snappy
copying snappy\snappy_formats.py -> build\lib.win32-3.7\snappy
copying snappy\__init__.py -> build\lib.win32-3.7\snappy
copying snappy\__main__.py -> build\lib.win32-3.7\snappy
running build_ext
building 'snappy._snappy' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\snappy
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Automation\test-automation\new-env\include "-IC:\Program Files (x8
6)\Python37-32\include" "-IC:\Program Files (x86)\Python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\
10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows
Kits\8.1\include\winrt" /EHsc /Tpsnappy/snappymodule.cc /Fobuild\temp.win32-3.7\Release\snappy/snappymodule.obj
snappymodule.cc
snappy/snappymodule.cc(31): fatal error C1083: Cannot open include file: 'snappy-c.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Automation\test-automation\new-env\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\vagrant\\AppData\\Local\\Temp\\2\\pip-install-17b8xwg1\
\python-snappy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Us
ers\vagrant\AppData\Local\Temp\2\pip-record-vdvhb6a5\install-record.txt --single-version-externally-managed --compile --install-headers C:\Automation\test-automation\new-env\inc
lude\site\python3.7\python-snappy" failed with error code 1 in C:\Users\vagrant\AppData\Local\Temp\2\pip-install-17b8xwg1\python-snappy\
(new-env) C:\Automation\test-automation\connect>
Successfully installed snappy and Visual Studio 14.
In such cases you can download the wheel files compiled by C. Gohlke.
All you need to do is that find which dependencies you need and then search on the http://www.lfd.uci.edu/~gohlke/pythonlibs/ according to your python version.
After downloading the file, go to that file location and simply install it using pip.
For example in this case lets say you are using python 3.7 version and you want to install python-snappy then first download python_snappy‑0.5.4‑cp37‑cp37m‑win_amd64.whl and then save it on some location. Again go to that location and simply use pip install python_snappy-0.5.4-cp37-cp37m-win_amd64.whl.
That's it.

How to install wordcloud using pip in python 3.7

I have been trying to pip install wordcloud for python 3.7 on Windows 10 but I keep on getting this error message which I dont quite understand nor able to fix.
Running setup.py install for wordcloud: finished with status 'error'
Complete output from command "c:\program files (x86)\python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\cs33~1\\AppData\\Local\\Temp\\pip-install-ome1vxvg\\wordcloud\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\cs33~1\AppData\Local\Temp\pip-record-cy5uj5zk\install-record.txt --single-version-externally-managed --compile --user --prefix=:
c:\program files (x86)\python37-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
c:\program files (x86)\python37-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'test_requires'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\wordcloud
copying wordcloud\color_from_image.py -> build\lib.win32-3.7\wordcloud
copying wordcloud\tokenization.py -> build\lib.win32-3.7\wordcloud
copying wordcloud\wordcloud.py -> build\lib.win32-3.7\wordcloud
copying wordcloud\wordcloud_cli.py -> build\lib.win32-3.7\wordcloud
copying wordcloud\_version.py -> build\lib.win32-3.7\wordcloud
copying wordcloud\__init__.py -> build\lib.win32-3.7\wordcloud
copying wordcloud\__main__.py -> build\lib.win32-3.7\wordcloud
copying wordcloud\stopwords -> build\lib.win32-3.7\wordcloud
copying wordcloud\DroidSansMono.ttf -> build\lib.win32-3.7\wordcloud
UPDATING build\lib.win32-3.7\wordcloud/_version.py
set build\lib.win32-3.7\wordcloud/_version.py to '1.5.0'
running build_ext
building 'wordcloud.query_integral_image' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
creating build\temp.win32-3.7\Release\wordcloud
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-Ic:\program files (x86)\python37-32\include" "-Ic:\program files (x86)\python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include" /Tcwordcloud/query_integral_image.c /Fobuild\temp.win32-3.7\Release\wordcloud/query_integral_image.obj
query_integral_image.c
c:\program files (x86)\python37-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
I have tried downloading wordcloud-1.3.2-cp36-cp36m-win_amd64.whl and doing python --user pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl but i get is not a supported wheel on this platform wheel.
Help would be appreciated.
Two points
Make sure your .whl is in Scripts folder under python/python-version folder
whl is correct version eg: if python 3.7 on 32 bit system whl should be library-cp37-cp37m-win32.whl

Categories

Resources