How to install wordcloud using pip in python 3.7 - python

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

Related

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

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.

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 fix "Failed building wheel for pyscipopt"?

I'm trying to install Pyscipopt for homework. There was an installation guide on the school website, the problem is that it doesn't work on my laptop. I have to write "pip install pyscipopt" in Anaconda Prompt, but I get the error "failed building wheel for pyscipopt". I don't know what it means or how to solve this, can anyone help me?
(base) C:\Users\claire>pip install pyscipopt
Collecting pyscipopt
Using cached https://files.pythonhosted.org/packages/a7/47/e3d5fcc37138c0eb9695d7c26e22b999c1274b06606db183c2aa36f98e5a/PySCIPOpt-2.2.0.tar.gz
Building wheels for collected packages: pyscipopt
Building wheel for pyscipopt (setup.py) ... error
ERROR: Complete output from command 'C:\Users\claire\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\claire\\AppData\\Local\\Temp\\pip-install-zja79xrm\\pyscipopt\\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\claire\AppData\Local\Temp\pip-wheel-jnmor4q4' --python-tag cp37:
ERROR: Using include path <C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\src>.
Using SCIP library <scip> at <C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\lib>.
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\Multidict.py -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\__init__.py -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\scip.pyx -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\scip.pxd -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\benders.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\benderscut.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\branchrule.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\conshdlr.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\event.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\expr.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\heuristic.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\lp.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\presol.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\pricer.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\propagator.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\relax.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\sepa.pxi -> build\lib.win-amd64-3.7\pyscipopt
running build_ext
building 'pyscipopt.scip' 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\pyscipopt
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\src -IC:\Users\claire\Anaconda3\include -IC:\Users\claire\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc\pyscipopt\scip.c /Fobuild\temp.win-amd64-3.7\Release\src\pyscipopt\scip.obj
scip.c
src\pyscipopt\scip.c(621): fatal error C1083: Cannot open include file: 'scip/scip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for pyscipopt
Running setup.py clean for pyscipopt
Failed to build pyscipopt
Installing collected packages: pyscipopt
Running setup.py install for pyscipopt ... error
ERROR: Complete output from command 'C:\Users\claire\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\claire\\AppData\\Local\\Temp\\pip-install-zja79xrm\\pyscipopt\\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\claire\AppData\Local\Temp\pip-record-aw3wx8lo\install-record.txt' --single-version-externally-managed --compile:
ERROR: Using include path <C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\src>.
Using SCIP library <scip> at <C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\lib>.
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\Multidict.py -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\__init__.py -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\scip.pyx -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\scip.pxd -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\benders.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\benderscut.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\branchrule.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\conshdlr.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\event.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\expr.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\heuristic.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\lp.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\presol.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\pricer.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\propagator.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\relax.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\sepa.pxi -> build\lib.win-amd64-3.7\pyscipopt
running build_ext
building 'pyscipopt.scip' 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\pyscipopt
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\src -IC:\Users\claire\Anaconda3\include -IC:\Users\claire\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc\pyscipopt\scip.c /Fobuild\temp.win-amd64-3.7\Release\src\pyscipopt\scip.obj
scip.c
src\pyscipopt\scip.c(621): fatal error C1083: Cannot open include file: 'scip/scip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command "'C:\Users\claire\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\claire\\AppData\\Local\\Temp\\pip-install-zja79xrm\\pyscipopt\\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\claire\AppData\Local\Temp\pip-record-aw3wx8lo\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\
This is the actual error:
Cannot open include file: 'scip/scip.h': No such file or directory
To resolve it, please carry out the installation instructions as outlined here. Most importantly, you need to install the SCIP Optimization Suite first. You can get the Windows installer here. After installing, you need to set an environment variable telling the PySCIPOpt installer where to find the SCIP library for linking:
set SCIPOPTDIR="C:\Program Files\SCIPOptSuite-6.0.2"
pip install pyscipopt
(assuming you used the default installation path for the SCIPOptSuite)
I got this error trying to install python conda:
pip install conda
The error displayed was:
Building wheel for pycosat (setup.py) ... error
...
pycosat.c:10:10: fatal error: Python.h: No such file or directory 10 |
#include <Python.h>`
The solution was to install python3-dev, which has the required header.
sudo apt-get install python3-dev
The solution was here:
https://github.com/conda/pycosat/issues/34
It doesn't solve OP's specific problem, but I ended up here looking for a solution to this error.
Try this
pip install <package> --no-cache-dir

installing Gdal on Windows 10 with python 3.6.4: fatal error C1083: Cannot open include file: 'cpl_port.h'

So I am trying to pip install gdal but got an error.
extensions/gdal_wrap.cpp(3168): fatal error C1083: Cannot open include file: 'cpl_port.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
So I am running the following:
Python 3.6.4 anaconda distribution
Windows 10 (x64)
Microsoft Visual 2017 Redistribute both x64 and x86 (both installed by the vs builder tool)
MS Visual was installed because of this error before
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Here is the trace log for the error:
C:\Users\0\Desktop\>pip install gdal
Collecting gdal
Using cached GDAL-2.2.4.tar.gz
Building wheels for collected packages: gdal
Running setup.py bdist_wheel for gdal ... error
Complete output from command c:\users\0\envs\ecoscan\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\0\\AppData\\Local\\Temp\\pip-build-wc3za_f8\\gdal\\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\0\AppData\Local\Temp\tmp9t7nk1ompip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying gdal.py -> build\lib.win-amd64-3.6
copying ogr.py -> build\lib.win-amd64-3.6
copying osr.py -> build\lib.win-amd64-3.6
copying gdalconst.py -> build\lib.win-amd64-3.6
copying gnm.py -> build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\osgeo
copying osgeo\gdal.py -> build\lib.win-amd64-3.6\osgeo
copying osgeo\gdalconst.py -> build\lib.win-amd64-3.6\osgeo
copying osgeo\gdalnumeric.py -> build\lib.win-amd64-3.6\osgeo
copying osgeo\gdal_array.py -> build\lib.win-amd64-3.6\osgeo
copying osgeo\gnm.py -> build\lib.win-amd64-3.6\osgeo
copying osgeo\ogr.py -> build\lib.win-amd64-3.6\osgeo
copying osgeo\osr.py -> build\lib.win-amd64-3.6\osgeo
copying osgeo\__init__.py -> build\lib.win-amd64-3.6\osgeo
Fixing build\lib.win-amd64-3.6\gdal.py build\lib.win-amd64-3.6\ogr.py build\lib.win-amd64-3.6\osr.py build\lib.win-amd64-3.6\gdalconst.py build\lib.win-amd64-3.6\gnm.py build\lib.win-amd64-3.6\osgeo\gdal.py build\lib.win-amd64-3.6\osgeo\gdalconst.py build\lib.win-amd64-3.6\osgeo\gdalnumeric.py build\lib.win-amd64-3.6\osgeo\gdal_array.py build\lib.win-amd64-3.6\osgeo\gnm.py build\lib.win-amd64-3.6\osgeo\ogr.py build\lib.win-amd64-3.6\osgeo\osr.py build\lib.win-amd64-3.6\osgeo\__init__.py
Skipping optional fixer: ws_comma
Fixing build\lib.win-amd64-3.6\gdal.py build\lib.win-amd64-3.6\ogr.py build\lib.win-amd64-3.6\osr.py build\lib.win-amd64-3.6\gdalconst.py build\lib.win-amd64-3.6\gnm.py build\lib.win-amd64-3.6\osgeo\gdal.py build\lib.win-amd64-3.6\osgeo\gdalconst.py build\lib.win-amd64-3.6\osgeo\gdalnumeric.py build\lib.win-amd64-3.6\osgeo\gdal_array.py build\lib.win-amd64-3.6\osgeo\gnm.py build\lib.win-amd64-3.6\osgeo\ogr.py build\lib.win-amd64-3.6\osgeo\osr.py build\lib.win-amd64-3.6\osgeo\__init__.py
Skipping optional fixer: ws_comma
running build_ext
building 'osgeo._gdal' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\extensions
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -Ic:\users\0\anaconda3\include -Ic:\users\0\anaconda3\include -I. "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /EHsc /Tpextensions/gdal_wrap.cpp /Fobuild\temp.win-amd64-3.6\Release\extensions/gdal_wrap.obj
gdal_wrap.cpp
extensions/gdal_wrap.cpp(3168): fatal error C1083: Cannot open include file: 'cpl_port.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
Any ideas how to fix this? I just want use the ogr2ogr in gdal to convert .shp to GeoJSON then to topojson.
I had the same problem and found the solution here:
gdal-installation-error-using-pip
That is: download the wheel file and install from the command line.
I prefer use conda instead, I was stuck at the same issue for hours, this is the only solution to install GDAL I found.
conda install gdal

Categories

Resources