Importing torchsparse (PyTorch) on Windows 10 not working - python

On Windows 10. I am testing someone's code which has the following imports:
import torch.nn as nn
import torchsparse.nn as spnn
from torchsparse.point_tensor import PointTensor
So on my machine I successfully installed via
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.9.0+cu111.html
As I have CUDA 11.1. However, there seems to be a syntax difference, as the above imports give:
import torchsparse.nn as spnn
ModuleNotFoundError: No module named 'torchsparse'
I found that when I am in Python I can do the following:
>>> import torchsparse
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'torchsparse'
>>> import torchsparse.nn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'torchsparse'
>>> import torch_sparse
>>> import torch_sparse.nn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'torch_sparse.nn'
>>>
So I can only import torch_sparse. Does anyone know how I can get the equivalent imports to test my buddy's code? Much appreciated.
---- EDIT ----
Trying Ivan's answer, I got the following:
pip install --upgrade git+https://github.com/mit-han-lab/torchsparse.git#v1.4.0
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Collecting git+https://github.com/mit-han-lab/torchsparse.git#v1.4.0
Cloning https://github.com/mit-han-lab/torchsparse.git (to revision v1.4.0) to c:\users\iijds\appdata\local\temp\pip-req-build-gvmcjx1m
Running command git clone -q https://github.com/mit-han-lab/torchsparse.git 'C:\Users\iiJDS\AppData\Local\Temp\pip-req-build-gvmcjx1m'
Running command git checkout -q 74099d10a51c71c14318bce63d6421f698b24f24
Resolved https://github.com/mit-han-lab/torchsparse.git to commit 74099d10a51c71c14318bce63d6421f698b24f24
Building wheels for collected packages: torchsparse
Building wheel for torchsparse (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\iiJDS\\AppData\\Local\\Temp\\pip-req-build-gvmcjx1m\\setup.py'"'"'; __file__='"'"'C:\\Users\\iiJDS\\AppData\\Local\\Temp\\pip-req-build-gvmcjx1m\\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\iiJDS\AppData\Local\Temp\pip-wheel-rz9wo9lc'
cwd: C:\Users\iiJDS\AppData\Local\Temp\pip-req-build-gvmcjx1m\
Complete output (53 lines):
running bdist_wheel
c:\python39\lib\site-packages\torch\utils\cpp_extension.py:370: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\torchsparse
copying torchsparse\operators.py -> build\lib.win-amd64-3.9\torchsparse
copying torchsparse\tensor.py -> build\lib.win-amd64-3.9\torchsparse
copying torchsparse\version.py -> build\lib.win-amd64-3.9\torchsparse
copying torchsparse\__init__.py -> build\lib.win-amd64-3.9\torchsparse
creating build\lib.win-amd64-3.9\torchsparse\nn
copying torchsparse\nn\__init__.py -> build\lib.win-amd64-3.9\torchsparse\nn
creating build\lib.win-amd64-3.9\torchsparse\utils
copying torchsparse\utils\collate.py -> build\lib.win-amd64-3.9\torchsparse\utils
copying torchsparse\utils\quantize.py -> build\lib.win-amd64-3.9\torchsparse\utils
copying torchsparse\utils\utils.py -> build\lib.win-amd64-3.9\torchsparse\utils
copying torchsparse\utils\__init__.py -> build\lib.win-amd64-3.9\torchsparse\utils
creating build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\activation.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\conv.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\count.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\crop.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\devoxelize.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\downsample.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\hash.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\pooling.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\query.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\voxelize.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\__init__.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
creating build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\activation.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\bev.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\conv.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\crop.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\norm.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\pooling.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\__init__.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
creating build\lib.win-amd64-3.9\torchsparse\nn\utils
copying torchsparse\nn\utils\apply.py -> build\lib.win-amd64-3.9\torchsparse\nn\utils
copying torchsparse\nn\utils\kernel.py -> build\lib.win-amd64-3.9\torchsparse\nn\utils
copying torchsparse\nn\utils\__init__.py -> build\lib.win-amd64-3.9\torchsparse\nn\utils
running build_ext
c:\python39\lib\site-packages\torch\utils\cpp_extension.py:305: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
building 'torchsparse.backend' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "c:\python39\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
return stream.closed
ValueError: underlying buffer has been detached
----------------------------------------
ERROR: Failed building wheel for torchsparse
Running setup.py clean for torchsparse
Failed to build torchsparse
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Installing collected packages: torchsparse
Running setup.py install for torchsparse ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\iiJDS\\AppData\\Local\\Temp\\pip-req-build-gvmcjx1m\\setup.py'"'"'; __file__='"'"'C:\\Users\\iiJDS\\AppData\\Local\\Temp\\pip-req-build-gvmcjx1m\\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\iiJDS\AppData\Local\Temp\pip-record-p7zn1m6h\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python39\Include\torchsparse'
cwd: C:\Users\iiJDS\AppData\Local\Temp\pip-req-build-gvmcjx1m\
Complete output (53 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\torchsparse
copying torchsparse\operators.py -> build\lib.win-amd64-3.9\torchsparse
copying torchsparse\tensor.py -> build\lib.win-amd64-3.9\torchsparse
copying torchsparse\version.py -> build\lib.win-amd64-3.9\torchsparse
copying torchsparse\__init__.py -> build\lib.win-amd64-3.9\torchsparse
creating build\lib.win-amd64-3.9\torchsparse\nn
copying torchsparse\nn\__init__.py -> build\lib.win-amd64-3.9\torchsparse\nn
creating build\lib.win-amd64-3.9\torchsparse\utils
copying torchsparse\utils\collate.py -> build\lib.win-amd64-3.9\torchsparse\utils
copying torchsparse\utils\quantize.py -> build\lib.win-amd64-3.9\torchsparse\utils
copying torchsparse\utils\utils.py -> build\lib.win-amd64-3.9\torchsparse\utils
copying torchsparse\utils\__init__.py -> build\lib.win-amd64-3.9\torchsparse\utils
creating build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\activation.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\conv.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\count.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\crop.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\devoxelize.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\downsample.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\hash.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\pooling.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\query.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\voxelize.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
copying torchsparse\nn\functional\__init__.py -> build\lib.win-amd64-3.9\torchsparse\nn\functional
creating build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\activation.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\bev.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\conv.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\crop.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\norm.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\pooling.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
copying torchsparse\nn\modules\__init__.py -> build\lib.win-amd64-3.9\torchsparse\nn\modules
creating build\lib.win-amd64-3.9\torchsparse\nn\utils
copying torchsparse\nn\utils\apply.py -> build\lib.win-amd64-3.9\torchsparse\nn\utils
copying torchsparse\nn\utils\kernel.py -> build\lib.win-amd64-3.9\torchsparse\nn\utils
copying torchsparse\nn\utils\__init__.py -> build\lib.win-amd64-3.9\torchsparse\nn\utils
running build_ext
c:\python39\lib\site-packages\torch\utils\cpp_extension.py:370: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
c:\python39\lib\site-packages\torch\utils\cpp_extension.py:305: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
building 'torchsparse.backend' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "c:\python39\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
return stream.closed
ValueError: underlying buffer has been detached
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\iiJDS\\AppData\\Local\\Temp\\pip-req-build-gvmcjx1m\\setup.py'"'"'; __file__='"'"'C:\\Users\\iiJDS\\AppData\\Local\\Temp\\pip-req-build-gvmcjx1m\\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\iiJDS\AppData\Local\Temp\pip-record-p7zn1m6h\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python39\Include\torchsparse' Check the logs for full command output.

It appears the package you are trying to import comes from this Github repo, which is different to the package you installed: torch-sparse you tried using. You should try with this instead:
pip install --upgrade git+https://github.com/mit-han-lab/torchsparse.git#v1.4.0
Also, you can uninstall the other one with:
pip uninstall torch-sparse

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.

PIP Cannot Install psutil

below are my specs
My PC is running Windows 11 V. 21H2. I am using Python 3.10. I use Pycharm 2021.2.3. I am using PIP 21.3.1 to install python libraries. To the best of my knowledge, everything is up to date.
I'm using the pip install psutil funtion in the terminal. I was able to initialize the install and begin the download, but it failed with a lot of errors.
I then tried to run cmd /k pip install --no-binary :all: psutil per recomendation of the python website. Still no luck, eact same errors.
The install beings very normal.
Collecting psutil
Using cached psutil-5.8.0.tar.gz (470 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Installing collected packages: psutil
Running setup.py install for psutil: started
Running setup.py install for psutil: finished with status 'error'
However, it runs into an error and spits this out.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\elton\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\elton\\AppData\\Local\\Temp\\pip-install-fi8xi6rq\\psutil_87b30645105b42978bc30b4b75398dbe\\setup.py'"'"'; __file__='"'"'C:\\Users\\elton\\AppData\\Local\\Temp\\pip-install-fi8xi6rq\\psutil_87b30645105b42978bc30b4b75398dbe\\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\elton\AppData\Local\Temp\pip-record-cr321z3l\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\elton\AppData\Local\Programs\Python\Python310\Include\psutil'
cwd: C:\Users\elton\AppData\Local\Temp\pip-install-fi8xi6rq\psutil_87b30645105b42978bc30b4b75398dbe\
Complete output (40 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\psutil
copying psutil\_common.py -> build\lib.win-amd64-3.10\psutil
copying psutil\_compat.py -> build\lib.win-amd64-3.10\psutil
copying psutil\_psaix.py -> build\lib.win-amd64-3.10\psutil
copying psutil\_psbsd.py -> build\lib.win-amd64-3.10\psutil
copying psutil\_pslinux.py -> build\lib.win-amd64-3.10\psutil
copying psutil\_psosx.py -> build\lib.win-amd64-3.10\psutil
copying psutil\_psposix.py -> build\lib.win-amd64-3.10\psutil
copying psutil\_pssunos.py -> build\lib.win-amd64-3.10\psutil
copying psutil\_pswindows.py -> build\lib.win-amd64-3.10\psutil
copying psutil\__init__.py -> build\lib.win-amd64-3.10\psutil
creating build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\runner.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_aix.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_bsd.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_connections.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_contracts.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_linux.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_memleaks.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_misc.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_osx.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_posix.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_process.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_sunos.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_system.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_testutils.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_unicode.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\test_windows.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\__init__.py -> build\lib.win-amd64-3.10\psutil\tests
copying psutil\tests\__main__.py -> build\lib.win-amd64-3.10\psutil\tests
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'psutil._psutil_windows' 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/
---------------------------------------
I checked my installed versions of Microsoft Visual C++ and my most recent version is 14.0.23506.0. This leads me to believe that I'm up to date.
Then I receive another error
Command errored out with exit status 1:
'C:\Users\elton\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io,
os, sys, setuptools, tokenize; sys.argv[0] =
'"'"'C:\\Users\\elton\\AppData\\Local\\Temp\\pip-install-
fi8xi6rq\\psutil_87b30645105b42978bc30b4b75398dbe\\setup.py'"'"';
__file__='"'"'C:\\Users\\elton\\AppData\\Local\\Temp\\pip-install-
fi8xi6rq\\psutil_87b30645105b42978bc30b4b75398dbe\\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\elton\AppData\Local\Temp\pip-record-cr321z3l\install-record.txt' --single-
version-externally-managed --compile --install-headers
'C:\Users\elton\AppData\Local\Programs\Python\Python310\Include\psutil' Check the logs
for full command output.
I check the C:\Users\elton\AppData\Local\Programs\Python\Python310\Include\psutil file location to find the log but it is not there.
I have checked multiple sources looking for answers about the Visual C++ and I see that its common for people to have this error when multiple versions of python installed but I only have one version installed.
Any help would be greatly appreciated.
This worked for me:
https://blog.hqcodeshop.fi/archives/499-Python-Windows-Pip-requiring-Build-Tools-for-Visual-Studio.html
Get the 2017 version of the build tools then explicitly ask to install that specific version "MSVC v140 - VS 2015 C++ build tools (v14.00)" of the build tools under "Individual Components".
I'm not sure if it must be from the 2017 version. I would hope that any version which has that version of build tools should work, but given all the failed answers, maybe it has to be exactly that one.

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

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.

Categories

Resources