failed building wheel for psycopg2 [duplicate] - python

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

Related

Can't install mysqlclient

pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.1.1.tar.gz (88 kB)
Preparing metadata (setup.py) .. done
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) .. error
ERROR: Command errored out with exit status 1:
command: 'c:\users\hp\appdata\local\programs\python\python36\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\AppD
ata\\Local\\Temp\\pip-install-mmb7531p\\mysqlclient_a141c7c0a933439fbe19807e877c7cc2\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install
-mmb7531p\\mysqlclient_a141c7c0a933439fbe19807e877c7cc2\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.St
ringIO('"'"'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-44gqcvbi'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-mmb7531p\mysqlclient_a141c7c0a933439fbe19807e877c7cc2\
Complete output (25 lines):
c:\users\hp\appdata\local\programs\python\python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
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\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.6\MySQLdb
creating build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\hp\appdata\local\programs\python\python36\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\HP\\Ap
pData\\Local\\Temp\\pip-install-mmb7531p\\mysqlclient_a141c7c0a933439fbe19807e877c7cc2\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-insta
ll-mmb7531p\\mysqlclient_a141c7c0a933439fbe19807e877c7cc2\\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-ylfwp41x\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\
users\hp\appdata\local\programs\python\python36\Include\mysqlclient'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-mmb7531p\mysqlclient_a141c7c0a933439fbe19807e877c7cc2\
Complete output (25 lines):
c:\users\hp\appdata\local\programs\python\python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
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\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.6\MySQLdb
creating build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\hp\appdata\local\programs\python\python36\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys
.argv[0] = '"'"'C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-mmb7531p\\mysqlclient_a141c7c0a933439fbe19807e877c7cc2\\setup.py'"'"'; __file__='"'"'C:\\Users\\HP
\\AppData\\Local\\Temp\\pip-install-mmb7531p\\mysqlclient_a141c7c0a933439fbe19807e877c7cc2\\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(com
pile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-ylfwp41x\install-record.txt' --single-version-externally-managed
--compile --install-headers 'c:\users\hp\appdata\local\programs\python\python36\Include\mysqlclient' Check the logs for full command output.
I'am trying to install mysqlclient in Pycharm. But i couldn't,its showing me these errors.There are errors while buliding wheel for mysqlclient. Django version is 3.2.18. Pip version is 21.3.1. Does this error happens due to mismatch of versions of pip and mysqlclient? ............................................................................................................
why don't use the MSI setup file to install it. it's okay with pip, I will check what is the problem, but for the time being go here & install: https://dev.mysql.com/downloads/installer/
MySQL client installs the full suite in your machine (including the CLI). You said about PyCharm, it is going to use the CLI. So just install the full suite setup.
See, I just did this,
PS C:\Users\Archisman> pip install mysqlclient
Collecting mysqlclient
Downloading mysqlclient-2.1.1-cp310-cp310-win_amd64.whl (178 kB)
---------------------------------------- 178.4/178.4 kB 10.5 MB/s eta 0:00:00
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.1.1
[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: C:\Users\Archisman\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip
PS C:\Users\Archisman>
I had installed MySQL through the setup file & works everywhere. So, just download the setup & install it. pip install mysqlclient may leave some of the packages to be installed & that's causing the error.
Also don't forget that MySQL needs MS Visual Studio Build Tools. So, it's better run the setup.
UPDATE
Found this in your Shell:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Just what I guessed.
As the error messages indicate, The problem could be the "Microsoft Visual C++ Build Tools". So try installing that depandency.

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.

i am getting error while installing mysqlclient on windows 10 no library is supproted

Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\uaahacker\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\uaahacker\AppData\Local\Temp\pip-install-icjkjmap\mysqlclient_8b5f49f509624395ab7dd2c4d4a21457\setup.py'"'"'; file='"'"'C:\Users\uaahacker\AppData\Local\Temp\pip-install-icjkjmap\mysqlclient_8b5f49f509624395ab7dd2c4d4a21457\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\uaahacker\AppData\Local\Temp\pip-record-62876lx5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\uaahacker\appdata\local\programs\python\python38-32\Include\mysqlclient'
cwd: C:\Users\uaahacker\AppData\Local\Temp\pip-install-icjkjmap\mysqlclient_8b5f49f509624395ab7dd2c4d4a21457
Complete output (23 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\MySQLdb
copying MySQLdb_init_.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb_exceptions.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb
creating build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants_init_.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\uaahacker\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\uaahacker\AppData\Local\Temp\pip-install-icjkjmap\mysqlclient_8b5f49f509624395ab7dd2c4d4a21457\setup.py'"'"'; file='"'"'C:\Users\uaahacker\AppData\Local\Temp\pip-install-icjkjmap\mysqlclient_8b5f49f509624395ab7dd2c4d4a21457\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\uaahacker\AppData\Local\Temp\pip-record-62876lx5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\uaahacker\appdata\local\programs\python\python38-32\Include\mysqlclient' Check the logs for full command output.
There is no package on pypi for the 32-bit version of Python. Only for 64-bit Python.
And if you install mysqlclient from there, naturally, sources that need to be compiled will be installed.
And for 32-bit Python, the compiled package is available at https://www.lfd.uci.edu/~gohlke/pythonlibs/.
it is literally telling you how to solve the ptoblem in the error
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
just download visualstudio build tools

Trouble installing OSQP package

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.

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