Trouble installing OSQP package - python

I'm trying to install the CVXPY package, which has OSQP as a dependency, but I'm failing miserably at installing it. This is the log:
Microsoft Windows [Version 10.0.18362.476]
(c) 2019 Microsoft Corporation. Alle Rechte vorbehalten.
C:\WINDOWS\system32>pip install osqp
Collecting osqp
Using cached https://files.pythonhosted.org/packages/ba/17/49790ce2ce7a6b95cd250642ebc68bd723ddefdd052ee8dcc1e0dcf4ffca/osqp-0.6.1.tar.gz
Requirement already satisfied: numpy>=1.7 in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (1.17.4)
Requirement already satisfied: scipy>=0.13.2 in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (1.3.2)
Requirement already satisfied: future in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (0.18.2)
Installing collected packages: osqp
Running setup.py install for osqp ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\felix\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"'; __file__='"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\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\felix\AppData\Local\Temp\pip-record-0cy159dw\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\felix\AppData\Local\Temp\pip-install-3lddfze1\osqp\
Complete output (93 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\osqp
copying module\interface.py -> build\lib.win32-3.8\osqp
copying module\utils.py -> build\lib.win32-3.8\osqp
copying module\__init__.py -> build\lib.win32-3.8\osqp
creating build\lib.win32-3.8\osqp\codegen
copying module\codegen\code_generator.py -> build\lib.win32-3.8\osqp\codegen
copying module\codegen\utils.py -> build\lib.win32-3.8\osqp\codegen
copying module\codegen\__init__.py -> build\lib.win32-3.8\osqp\codegen
creating build\lib.win32-3.8\osqp\tests
copying module\tests\basic_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\codegen_matrices_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\codegen_vectors_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\dual_infeasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\feasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\mkl_pardiso_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\non_convex_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\polishing_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\primal_infeasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\unconstrained_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\update_matrices_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\warm_start_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\__init__.py -> build\lib.win32-3.8\osqp\tests
creating build\lib.win32-3.8\osqppurepy
copying modulepurepy\interface.py -> build\lib.win32-3.8\osqppurepy
copying modulepurepy\_osqp.py -> build\lib.win32-3.8\osqppurepy
copying modulepurepy\__init__.py -> build\lib.win32-3.8\osqppurepy
running egg_info
writing osqp.egg-info\PKG-INFO
writing dependency_links to osqp.egg-info\dependency_links.txt
writing requirements to osqp.egg-info\requires.txt
writing top-level names to osqp.egg-info\top_level.txt
reading manifest file 'osqp.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'osqp.egg-info\SOURCES.txt'
creating build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\emosqpmodule.c -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\example.c -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\setup.py -> build\lib.win32-3.8\osqp\codegen\files_to_generate
creating build\lib.win32-3.8\osqp\codegen\sources
creating build\lib.win32-3.8\osqp\codegen\sources\configure
copying module\codegen\sources\configure\osqp_configure.h.in -> build\lib.win32-3.8\osqp\codegen\sources\configure
copying module\codegen\sources\configure\qdldl_types.h.in -> build\lib.win32-3.8\osqp\codegen\sources\configure
creating build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\auxil.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\constants.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\error.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\glob_opts.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\kkt.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\lin_alg.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\osqp.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\proj.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\qdldl.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\qdldl_interface.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\scaling.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\types.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\util.h -> build\lib.win32-3.8\osqp\codegen\sources\include
creating build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\auxil.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\error.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\kkt.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\lin_alg.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\osqp.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\proj.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\qdldl.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\qdldl_interface.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\scaling.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\util.c -> build\lib.win32-3.8\osqp\codegen\sources\src
running build_ext
-- Selecting Windows SDK version to target Windows 10.0.18362.
CMake Error at CMakeLists.txt:5 (project):
Failed to run MSBuild command:
MSBuild.exe
to get the value of VCTargetsPath:
Das System kann die angegebene Datei nicht finden
-- Configuring incomplete, errors occurred!
See also "C:/Users/felix/AppData/Local/Temp/pip-install-3lddfze1/osqp/osqp_sources/build/CMakeFiles/CMakeOutput.log".
Das System kann die angegebene Datei nicht finden
CMake Error: Generator: execution of make failed. Make command was: MSBuild.exe osqpstatic.vcxproj /p:Configuration=Release /p:Platform=Win32 /p:VisualStudioVersion=14.0 /v:m &&
error: [Errno 2] No such file or directory: 'osqp_sources\\build\\out\\Release\\osqp.lib'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\felix\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"'; __file__='"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\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\felix\AppData\Local\Temp\pip-record-0cy159dw\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
It seems it is a problem with the MSBuildTools. I've installed the build tools as instructed on the CVXPY-webpage: https://drive.google.com/file/d/0B4GsMXCRaSSIOWpYQkstajlYZ0tPVkNQSElmTWh1dXFaYkJr/view
That didn't work. Then I found this question (Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualst udio.com/visual-cpp-build-tools) and modified the build tools installation accordingly but it still doesn't work. I don't have the python developement under Web & cloud as in the screenshot, but this should be optional anyway.
Could you please help me?
P.S.: Das System kann die angegebene Datei nicht finden roughly translates to The system can't find the specified file
EDIT: Here's the build tools installation, just in case:

I was facing the same issue. From the link https://www.lfd.uci.edu/~gohlke/pythonlibs/#osqp (posted by phd), downloaded the corresponding version of osqp and install it using (for instance):
pip install osqp-0.6.1-cp38-cp38-win_amd64.whl
Then, you should be able to simply install cvxpy using
pip install cvxpy

I am one of the developers. OSQP pip wheels for python 3.8 are online now. It should fix your problem.

Related

Unable to install igraph due to failing build for the C core

I've been trying to install igraph using pip but it keeps failing.
I get the following error:
Using cached igraph-0.9.8.tar.gz (3.6 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: texttable>=1.6.2 in c:\msys64\mingw64\lib\python3.9\site-packages (from igraph) (1.6.4)
Building wheels for collected packages: igraph
Building wheel for igraph (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\msys64\mingw64\bin\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-nrm8rlun\\igraph_85a609eb9b2b457aa62af06569648cc8\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-nrm8rlun\\igraph_85a609eb9b2b457aa62af06569648cc8\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\HP\AppData\Local\Temp\pip-wheel-6pxfcwpb'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-nrm8rlun\igraph_85a609eb9b2b457aa62af06569648cc8\
Complete output (65 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.mingw_x86_64-3.9
creating build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\clustering.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\configuration.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\cut.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\datatypes.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\formula.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\layout.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\matching.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\operators.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\sparse_matrix.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\statistics.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\summary.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\utils.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\version.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\__init__.py -> build\lib.mingw_x86_64-3.9\igraph
creating build\lib.mingw_x86_64-3.9\igraph\app
copying src\igraph\app\shell.py -> build\lib.mingw_x86_64-3.9\igraph\app
copying src\igraph\app\__init__.py -> build\lib.mingw_x86_64-3.9\igraph\app
creating build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\baseclasses.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\colors.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\coord.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\edge.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\graph.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\metamagic.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\shapes.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\text.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\utils.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\vertex.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\__init__.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
creating build\lib.mingw_x86_64-3.9\igraph\remote
copying src\igraph\remote\gephi.py -> build\lib.mingw_x86_64-3.9\igraph\remote
copying src\igraph\remote\__init__.py -> build\lib.mingw_x86_64-3.9\igraph\remote
running build_ext
running build_c_core
-- Building for: NMake Makefiles
-- Setting build type to 'Release' as none was specified.
-- Version number: 0.9.4-24-gb29e741ea
CMake Error at CMakeLists.txt:30 (project):
Running
'nmake' '-?'
failed with:
The system cannot find the file specified
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/HP/AppData/Local/Temp/pip-install-nrm8rlun/igraph_85a609eb9b2b457aa62af06569648cc8/vendor/build/igraph/CMakeFiles/CMakeOutput.log".
We are going to build the C core of igraph.
Source folder: vendor\source\igraph
Build folder: vendor\build\igraph
Install folder: vendor\install\igraph
Configuring build...
Build failed for the C core of igraph.
----------------------------------------
ERROR: Failed building wheel for igraph
Running setup.py clean for igraph
Failed to build igraph
Installing collected packages: igraph
Running setup.py install for igraph ... error
ERROR: Command errored out with exit status 1:
command: 'c:\msys64\mingw64\bin\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-nrm8rlun\\igraph_85a609eb9b2b457aa62af06569648cc8\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-nrm8rlun\\igraph_85a609eb9b2b457aa62af06569648cc8\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-vzu8m8eh\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\msys64\mingw64\include\python3.9\igraph'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-nrm8rlun\igraph_85a609eb9b2b457aa62af06569648cc8\
Complete output (65 lines):
running install
C:\msys64\mingw64\lib\python3.9\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.mingw_x86_64-3.9
creating build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\clustering.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\configuration.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\cut.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\datatypes.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\formula.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\layout.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\matching.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\operators.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\sparse_matrix.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\statistics.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\summary.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\utils.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\version.py -> build\lib.mingw_x86_64-3.9\igraph
copying src\igraph\__init__.py -> build\lib.mingw_x86_64-3.9\igraph
creating build\lib.mingw_x86_64-3.9\igraph\app
copying src\igraph\app\shell.py -> build\lib.mingw_x86_64-3.9\igraph\app
copying src\igraph\app\__init__.py -> build\lib.mingw_x86_64-3.9\igraph\app
creating build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\baseclasses.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\colors.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\coord.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\edge.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\graph.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\metamagic.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\shapes.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\text.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\utils.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\vertex.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
copying src\igraph\drawing\__init__.py -> build\lib.mingw_x86_64-3.9\igraph\drawing
creating build\lib.mingw_x86_64-3.9\igraph\remote
copying src\igraph\remote\gephi.py -> build\lib.mingw_x86_64-3.9\igraph\remote
copying src\igraph\remote\__init__.py -> build\lib.mingw_x86_64-3.9\igraph\remote
running build_ext
running build_c_core
-- Version number: 0.9.4-24-gb29e741ea
CMake Error at CMakeLists.txt:30 (project):
Running
'nmake' '-?'
failed with:
The system cannot find the file specified
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/HP/AppData/Local/Temp/pip-install-nrm8rlun/igraph_85a609eb9b2b457aa62af06569648cc8/vendor/build/igraph/CMakeFiles/CMakeOutput.log".
We are going to build the C core of igraph.
Source folder: vendor\source\igraph
Build folder: vendor\build\igraph
Install folder: vendor\install\igraph
Configuring build...
Build failed for the C core of igraph.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\msys64\mingw64\bin\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-nrm8rlun\\igraph_85a609eb9b2b457aa62af06569648cc8\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-nrm8rlun\\igraph_85a609eb9b2b457aa62af06569648cc8\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-vzu8m8eh\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\msys64\mingw64\include\python3.9\igraph' Check the logs for full command output.
The problem has something to do with building the C core of igraph. What steps do I take to resolve this error?
My system info, if relevant:
HP Pavillion 14
Intel Core i7-1065G7 CPU
Windows 10 Home 21H1 64bit
Python 3.9.7
pip 21.3.1
tl;dr Use the official Python distribution for Windows, or use Anaconda.
You should not use python-igraph with the Python included in MSYS2 unless you have a very good reason. This Python is not compatible with the official Python distribution on Windows, which means that you will not be able to install binary wheels from PyPI, and will need to compile everything from source. As you discovered, that is not always trivial.
If you have a truly good reason to use this Python with igraph, the simplest way is the following:
Make sure you are using the appropriate subsystem (i.e. you launch the correct terminal). Here I am assuming you are using the MinGW64 one.
Install the igraph C library from MSYS2: pacman -S mingw-w64-x86_64-igraph
Make sure you are using pip from MSYS2: pacman -S mingw-w64-x86_64-python-pip
Install texttable: pip install texttable
Install igraph, and link to the existing C library: pip install igraph --install-option="--use-pkg-config"
By going this route, you are treading in uncharted waters. Expect problems that you will need to resolve on your own.

unable to install awscli using pip on dind 18.09.6-dind due to cython dependency

I saw a strange issue just most of yesterday where while running a simple jenkins build that uses pod template with container docker:18.09.6-dind (alpine linux) the build would fail while trying to install awscli using pip. Here is the sample code:-
apk add curl
apk add py-pip
pip install --user awscli
The error was :-
apk add py-pip
(1/11) Installing libbz2 (1.0.6-r7)
(2/11) Installing expat (2.2.8-r0)
(3/11) Installing libffi (3.2.1-r6)
(4/11) Installing gdbm (1.13-r1)
(5/11) Installing ncurses-terminfo-base (6.1_p20190518-r2)
(6/11) Installing ncurses-libs (6.1_p20190518-r2)
(7/11) Installing readline (8.0.0-r0)
(8/11) Installing sqlite-libs (3.28.0-r3)
(9/11) Installing python2 (2.7.18-r0)
(10/11) Installing py-setuptools (40.8.0-r1)
(11/11) Installing py2-pip (18.1-r0)
Executing busybox-1.30.1-r2.trigger
OK: 74 MiB in 54 packages
[Pipeline] withAwsCli
Executing sh script inside container dind of pod pod-custom-w741q
Executing command: "pip" "--version"
exit
pip 18.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)
Executing sh script inside container dind of pod pod-custom-w741q
Executing command: "pip" "show" "awscli"
exit
ERROR: [withAwsCli] Command 'pip show awscli' returned the code 1
Executing sh script inside container dind of pod pod-custom-w741q
Executing command: "pip" "install" "--user" "awscli"
exit
Collecting awscli
Downloading https://files.pythonhosted.org/packages/d9/d3/1b76aa71fea8438f82a991ad94443d343836848f8b8c0dc413ed987745f8/awscli-1.19.51-py2.py3-none-any.whl (3.6MB)
Collecting botocore==1.20.51 (from awscli)
Downloading https://files.pythonhosted.org/packages/3c/1d/7a3741f17a10cc599bb3728351992b10094328ee07b8a129250ba2039642/botocore-1.20.51-py2.py3-none-any.whl (7.4MB)
Collecting colorama<0.4.4,>=0.2.5 (from awscli)
Downloading https://files.pythonhosted.org/packages/c9/dc/45cdef1b4d119eb96316b3117e6d5708a08029992b2fee2c143c7a0a5cc5/colorama-0.4.3-py2.py3-none-any.whl
Collecting PyYAML<5.5,>=3.10 (from awscli)
Downloading https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz (175kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
Complete output from command /usr/bin/python2 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-mT9r0n --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel Cython:
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/e1/b7/182161210a13158cd3ccc41ee19aadef54496b74f2817cc147006ec932b4/setuptools-44.1.1-py2.py3-none-any.whl (583kB)
Collecting wheel
Downloading https://files.pythonhosted.org/packages/65/63/39d04c74222770ed1589c0eaba06c05891801219272420b40311cd60c880/wheel-0.36.2-py2.py3-none-any.whl
Collecting Cython
Downloading https://files.pythonhosted.org/packages/d9/cd/0d2d90b27219c07f68f1c25bcc7b02dd27639d2180add9d4b73e70945869/Cython-0.29.23.tar.gz (2.1MB)
Installing collected packages: setuptools, wheel, Cython
Running setup.py install for Cython: started
Running setup.py install for Cython: finished with status 'error'
Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-72Od1r/Cython/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-Qfbz7l/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-mT9r0n --compile:
Unable to find pgen, not compiling formal grammar.
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying cython.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/Cython
copying Cython/TestUtils.py -> build/lib.linux-x86_64-2.7/Cython
copying Cython/Utils.py -> build/lib.linux-x86_64-2.7/Cython
copying Cython/CodeWriter.py -> build/lib.linux-x86_64-2.7/Cython
copying Cython/Debugging.py -> build/lib.linux-x86_64-2.7/Cython
copying Cython/StringIOTree.py -> build/lib.linux-x86_64-2.7/Cython
copying Cython/__init__.py -> build/lib.linux-x86_64-2.7/Cython
copying Cython/Coverage.py -> build/lib.linux-x86_64-2.7/Cython
copying Cython/Shadow.py -> build/lib.linux-x86_64-2.7/Cython
creating build/lib.linux-x86_64-2.7/Cython/Build
copying Cython/Build/Dependencies.py -> build/lib.linux-x86_64-2.7/Cython/Build
copying Cython/Build/__init__.py -> build/lib.linux-x86_64-2.7/Cython/Build
copying Cython/Build/Distutils.py -> build/lib.linux-x86_64-2.7/Cython/Build
copying Cython/Build/Inline.py -> build/lib.linux-x86_64-2.7/Cython/Build
copying Cython/Build/BuildExecutable.py -> build/lib.linux-x86_64-2.7/Cython/Build
copying Cython/Build/Cythonize.py -> build/lib.linux-x86_64-2.7/Cython/Build
copying Cython/Build/IpythonMagic.py -> build/lib.linux-x86_64-2.7/Cython/Build
creating build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/FlowControl.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Code.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/MemoryView.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Pipeline.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/AnalysedTreeTransforms.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/CythonScope.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/TypeSlots.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Errors.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/FusedNode.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/PyrexTypes.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/AutoDocTransforms.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/UtilityCode.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/StringEncoding.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Version.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/CmdLine.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/UtilNodes.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/ParseTreeTransforms.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Visitor.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/TypeInference.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/__init__.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Options.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/DebugFlags.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Scanning.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/ExprNodes.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Interpreter.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Builtin.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Annotate.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Symtab.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Optimize.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Parsing.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Naming.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/ModuleNode.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/TreeFragment.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Nodes.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Future.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/TreePath.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Main.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/CodeGeneration.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Buffer.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Pythran.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
copying Cython/Compiler/Lexicon.py -> build/lib.linux-x86_64-2.7/Cython/Compiler
creating build/lib.linux-x86_64-2.7/Cython/Runtime
copying Cython/Runtime/__init__.py -> build/lib.linux-x86_64-2.7/Cython/Runtime
creating build/lib.linux-x86_64-2.7/Cython/Distutils
copying Cython/Distutils/old_build_ext.py -> build/lib.linux-x86_64-2.7/Cython/Distutils
copying Cython/Distutils/__init__.py -> build/lib.linux-x86_64-2.7/Cython/Distutils
copying Cython/Distutils/build_ext.py -> build/lib.linux-x86_64-2.7/Cython/Distutils
copying Cython/Distutils/extension.py -> build/lib.linux-x86_64-2.7/Cython/Distutils
creating build/lib.linux-x86_64-2.7/Cython/Debugger
copying Cython/Debugger/DebugWriter.py -> build/lib.linux-x86_64-2.7/Cython/Debugger
copying Cython/Debugger/libpython.py -> build/lib.linux-x86_64-2.7/Cython/Debugger
copying Cython/Debugger/__init__.py -> build/lib.linux-x86_64-2.7/Cython/Debugger
copying Cython/Debugger/Cygdb.py -> build/lib.linux-x86_64-2.7/Cython/Debugger
copying Cython/Debugger/libcython.py -> build/lib.linux-x86_64-2.7/Cython/Debugger
creating build/lib.linux-x86_64-2.7/Cython/Debugger/Tests
......................................
......................................
running build_ext
building 'Cython.Plex.Scanners' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/tmp
creating build/temp.linux-x86_64-2.7/tmp/pip-install-72Od1r
creating build/temp.linux-x86_64-2.7/tmp/pip-install-72Od1r/Cython
creating build/temp.linux-x86_64-2.7/tmp/pip-install-72Od1r/Cython/Cython
creating build/temp.linux-x86_64-2.7/tmp/pip-install-72Od1r/Cython/Cython/Plex
gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python2.7 -c /tmp/pip-install-72Od1r/Cython/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-2.7/tmp/pip-install-72Od1r/Cython/Cython/Plex/Scanners.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-72Od1r/Cython/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-Qfbz7l/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-mT9r0n --compile" failed with error code 1 in /tmp/pip-install-72Od1r/Cython/
----------------------------------------
Command "/usr/bin/python2 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-mT9r0n --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel Cython" failed with error code 1 in None
It always worked fine until yesterday and also works fine now on same dind OS. I have no clue why was it trying to set up dependency cython just yesterday. I see a new version of cython was released yesterday
https://pypi.org/search/?q=cython
Not sure if that played any role
I am not that familiar with how pip works when it tries to install something so would like to understand why it was looking for cython all of a sudden while its the same pip version 18.1 on that dind OS and trying to fetch latest awscli which happened to be released just yesterday 1.19.51 as per
https://github.com/aws/aws-cli/releases
Also yesterday same thing worked just fine all throughout on docker:18.06.1-ce-dind or other dind versions. So something specific to docker:18.09.6-dind and combination of pip 18.1 and awscli 1.19.51.
kindly help me figure out what could have been the issue here.
Found out the root cause which is
https://github.com/aws/aws-cli/issues/6096

failed building wheel for psycopg2 [duplicate]

This question already has answers here:
Installing numpy with pip on windows 10 for python 3.7
(4 answers)
Closed 2 years ago.
I need to download the package psycopg2 in order to work with the postgresql database in use. Unfortunately, when I try to pip install psycopg2 the following error pops up:
failed building wheel for psycopg2
my os: windows
log
Building wheel for psycopg2-binary (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Windows 10\.virtualenvs\project-e1HiiE3H\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Windows 10\\AppData\\Local\\Temp\\pip-install-u7m2a_o9\\psycopg2-binary\\setup.py'"'"'; __file__='"'"'C:\\Users\\Windows 10\\AppData\\Local\\Temp\\pip-install-u7m2a_o9\\psycopg2-binary\\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\Windows 10\AppData\Local\Temp\pip-wheel-bv5plcfw'
cwd: C:\Users\Windows 10\AppData\Local\Temp\pip-install-u7m2a_o9\psycopg2-binary\
Complete output (24 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\psycopg2
copying lib\compat.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\errorcodes.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\errors.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\extensions.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\extras.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\pool.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\sql.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\tz.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\_ipaddress.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\_json.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\_lru_cache.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\_range.py -> build\lib.win-amd64-3.9\psycopg2
copying lib\__init__.py -> build\lib.win-amd64-3.9\psycopg2
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'psycopg2._psycopg' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
Solution no 1 (no need for compilation):
pip install psycopg2-binary
Solution no 2:
get a C compiler
pip install psycopg2

cx_freeze doesn't get installed in python 3.8.0

I'm trying to install cx_freeze to convert my python code into an executable. But it always shows the error below.
I looked into the problem and found that I should downgrade my python version because there is no cx_freeze that supports Python 3.8.
NOTE
It turns out that cx_freeze installation on Python 3.8 is possible if you download the development version directly from Git.
Using cached https://files.pythonhosted.org/packages/14/74/a76c12e4e357c79999191d5db259e66b46c57708515395c023d38e6bbbd7/cx_Freeze-6.0.tar.gz
Building wheels for collected packages: cx-freeze
Building wheel for cx-freeze (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\lenovo\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-wncuyyho\\cx-freeze\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-wncuyyho\\cx-freeze\\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\lenovo\AppData\Local\Temp\pip-wheel-59n38z49' --python-tag cp38
cwd: C:\Users\lenovo\AppData\Local\Temp\pip-install-wncuyyho\cx-freeze\
Complete output (70 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\finder.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\freezer.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\hooks.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\macdist.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\main.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\setupwriter.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\windist.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\__init__.py -> build\lib.win-amd64-3.8\cx_Freeze
creating build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\Console.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\ConsoleSetLibPath.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLib.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLibSource.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\__startup__.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
creating build\lib.win-amd64-3.8\cx_Freeze\samples
creating build\lib.win-amd64-3.8\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_1.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_2.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\advanced
creating build\lib.win-amd64-3.8\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\asmodule.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\asmodule
creating build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\get_examples.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\server_simple.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\web_srv.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\wsgiserver.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
creating build\lib.win-amd64-3.8\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\matplotlib_eg.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\matplotlib
creating build\lib.win-amd64-3.8\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\test_openpyxl.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\openpyxl
creating build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\PyQt4app.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt4
creating build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\PyQt5app.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt5
creating build\lib.win-amd64-3.8\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\relimport.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\relimport
creating build\lib.win-amd64-3.8\cx_Freeze\samples\service
copying cx_Freeze\samples\service\Config.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\service
copying cx_Freeze\samples\service\ServiceHandler.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\service
copying cx_Freeze\samples\service\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\service
creating build\lib.win-amd64-3.8\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\hello.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\simple
creating build\lib.win-amd64-3.8\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\SimpleTkApp.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\Tkinter
creating build\lib.win-amd64-3.8\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\wxapp.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\wx
creating build\lib.win-amd64-3.8\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for cx-freeze
Running setup.py clean for cx-freeze
Failed to build cx-freeze
Installing collected packages: cx-freeze
Running setup.py install for cx-freeze ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\lenovo\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-wncuyyho\\cx-freeze\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-wncuyyho\\cx-freeze\\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\lenovo\AppData\Local\Temp\pip-record-42p9qoxu\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\lenovo\AppData\Local\Temp\pip-install-wncuyyho\cx-freeze\
Complete output (70 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\finder.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\freezer.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\hooks.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\macdist.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\main.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\setupwriter.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\windist.py -> build\lib.win-amd64-3.8\cx_Freeze
copying cx_Freeze\__init__.py -> build\lib.win-amd64-3.8\cx_Freeze
creating build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\Console.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\ConsoleSetLibPath.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLib.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLibSource.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
copying cx_Freeze\initscripts\__startup__.py -> build\lib.win-amd64-3.8\cx_Freeze\initscripts
creating build\lib.win-amd64-3.8\cx_Freeze\samples
creating build\lib.win-amd64-3.8\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_1.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_2.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\advanced
creating build\lib.win-amd64-3.8\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\asmodule.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\asmodule
creating build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\get_examples.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\server_simple.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\web_srv.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
copying cx_Freeze\samples\importlib\wsgiserver.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\importlib
creating build\lib.win-amd64-3.8\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\matplotlib_eg.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\matplotlib
creating build\lib.win-amd64-3.8\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\test_openpyxl.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\openpyxl
creating build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\PyQt4app.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt4
creating build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\PyQt5app.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\PyQt5
creating build\lib.win-amd64-3.8\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\relimport.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\relimport
creating build\lib.win-amd64-3.8\cx_Freeze\samples\service
copying cx_Freeze\samples\service\Config.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\service
copying cx_Freeze\samples\service\ServiceHandler.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\service
copying cx_Freeze\samples\service\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\service
creating build\lib.win-amd64-3.8\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\hello.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\simple
creating build\lib.win-amd64-3.8\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\SimpleTkApp.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\Tkinter
creating build\lib.win-amd64-3.8\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\wxapp.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\wx
creating build\lib.win-amd64-3.8\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win-amd64-3.8\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\lenovo\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-wncuyyho\\cx-freeze\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-wncuyyho\\cx-freeze\\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\lenovo\AppData\Local\Temp\pip-record-42p9qoxu\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I had the exact same problem. This is how to solve it:
 
1. Install Visual Studio Community Edition
You need the C++ compiler for Windows 10. Download **Visual Studio 2019 Community** from https://visualstudio.microsoft.com/downloads/
Double click the downloaded installer. You should now see the following window (after a bit of waiting and a bit of clicking next):
That's the place where you should select the "things" that you want to include in your Visual Studio installation. The only thing you need right now is Desktop development with C++. After selecting that, you should see Installation details appear on the right side. There are already a few entries selected there (marked as Automatically selected in my screenshot above). You need to manually select the two last entries. Now click the Install button in the down-right corner.
Now have some patience while the installation progresses:
At the end, the installer will ask you to restart your computer. Click OK. That's it.
 
2. Install cx_freeze
*Just a reminder: make sure you have an updated `pip`. Issue the command:*
*`python -m pip install --upgrade pip`*
cx_freeze does not yet support Python 3.8. Luckily, the development version already has a fix. So you should not run pip install cx_freeze, but the following command instead:
pip install --upgrade git+https://github.com/anthony-tuininga/cx_Freeze.git#master
On my computer, the installation was successfull:
C:\Users\Kristof>pip install --upgrade git+https://github.com/anthony-tuininga/cx_Freeze.git#master
Collecting git+https://github.com/anthony-tuininga/cx_Freeze.git#master
Cloning https://github.com/anthony-tuininga/cx_Freeze.git (to revision master) to c:\users\kristof\appdata\local\temp\pip-req-build-7hrolrl1
Running command git clone -q https://github.com/anthony-tuininga/cx_Freeze.git 'C:\Users\Kristof\AppData\Local\Temp\pip-req-build-7hrolrl1'
Building wheels for collected packages: cx-Freeze
Building wheel for cx-Freeze (setup.py) ... done
Created wheel for cx-Freeze: filename=cx_Freeze-6.1-cp38-cp38-win_amd64.whl size=173005 sha256=507c3b90a1b7945fc277ccf25a5e4be7c64a37e1a1f6bce3f5171434c823fc04
Stored in directory: C:\Users\Kristof\AppData\Local\Temp\pip-ephem-wheel-cache-p7vebfjn\wheels\30\8c\fc\66fc4c5a5e2a27aa97f29d147cee6bd5d1198260ae9d1e9102
Successfully built cx-Freeze
Installing collected packages: cx-Freeze
Successfully installed cx-Freeze-6.1
 
3. Install cx_freeze on Python 3.9
I came back to this question after several months. I've got Python 3.9 now. Please note that cx_Freeze has changed its github path and also switched from master to main branch. This is how to install the main branch now:
> pip install git+https://github.com/marcelotduarte/cx_Freeze.git#main
Collecting git+https://github.com/marcelotduarte/cx_Freeze.git#main
Cloning https://github.com/marcelotduarte/cx_Freeze.git (to revision main) to c:\users\gebruiker\appdata\local\temp\pip-req-build-ah6qsibk
Running command git clone -q https://github.com/marcelotduarte/cx_Freeze.git 'C:\Users\Gebruiker\AppData\Local\Temp\pip-req-build-ah6qsibk'
Running command git submodule update --init --recursive -q
Requirement already satisfied: importlib_metadata>=3.1.1 in c:\python39\lib\site-packages (from cx-Freeze==6.6.dev0) (3.6.0)
Requirement already satisfied: zipp>=0.5 in c:\python39\lib\site-packages (from importlib_metadata>=3.1.1->cx-Freeze==6.6.dev0) (3.4.0)
Building wheels for collected packages: cx-Freeze
Building wheel for cx-Freeze (setup.py) ... done
Created wheel for cx-Freeze: filename=cx_Freeze-6.6.dev0-cp39-cp39-win_amd64.whl size=260212 sha256=48855a055f9834fb666831b9ae4ff08aaa93276f9c91339614a4f58656d0bd47
Stored in directory: C:\Users\Gebruiker\AppData\Local\Temp\pip-ephem-wheel-cache-flvt95bk\wheels\e4\58\28\02e3273cbbf0d18134fd22f6766cfdbc1b9f6b2946d5d75940
Successfully built cx-Freeze
Installing collected packages: cx-Freeze
Successfully installed cx-Freeze-6.6.dev0

pip install MySQL-python on windows 10, Python 3.5?

when I try to install pip install MySQL-python on windows 10 I got :
C:\Users\ghina>pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
Complete output from command c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ghina\\AppData\\Local\\Temp\\pip-build-eo59erqx\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ghina\AppData\Local\Temp\pip-b4pe3d_p-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying _mysql_exceptions.py -> build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb
creating build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ghina\\AppData\\Local\\Temp\\pip-build-eo59erqx\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ghina\AppData\Local\Temp\pip-b4pe3d_p-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ghina\AppData\Local\Temp\pip-build-eo59erqx\MySQL-python\
I'm on windows 10 using python 3.5 and django 1.9 , and I want to connect django to mysql database . When I run django server I get : No module named 'MySQLbd'
MySQL-Python does not support Python 3.x. According to the official Django documentation you can use one of the following drivers:
The Python Database API is described in PEP 249. MySQL has three prominent drivers that implement this API:
MySQLdb is a native driver that has been developed and supported for
over a decade by Andy Dustman.
mysqlclient is a fork of MySQLdb which
notably supports Python 3 and can be used as a drop-in replacement for
MySQLdb. At the time of this writing, this is the recommended choice
for using MySQL with Django.
MySQL Connector/Python is a pure Python
driver from Oracle that does not require the MySQL client library or
any Python modules outside the standard library.

Categories

Resources