Installing pyglpk package on Windows10 - python

I don't have much knowledge for technical details of installing packages, etc, so this might be a stupid question. I simply first downloaded GLPK and added it to the path, and then tried to install pyglpk through pip install glpk, which gives the following error messages:
Collecting glpk
Using cached https://files.pythonhosted.org/packages/74/e0/8676d8d5404a8f9aee298985d21aae67b776476b01583ff1a3e0030e2f51/glpk-0.4.5.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: glpk
Building wheel for glpk (PEP 517) ... error
ERROR: Complete output from command 'C:\Users\User\Anaconda3\python.exe' 'C:\Users\User\Anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\User\AppData\Local\Temp\tmpzvxrzwqg':
ERROR: running bdist_wheel
running build
running build_ext
building 'glpk' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVERSION_NUMBER="0.4.5" -IC:\Users\User\Anaconda3\include -IC:\Users\User\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc\glpk.c /Fobuild\temp.win-amd64-3.7\Release\src\glpk.obj
glpk.c
c:\users\user\appdata\local\temp\pip-install-m71t9t2y\glpk\src\lp.h(24): fatal error C1083: Cannot open include file: 'glpk.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for glpk
Running setup.py clean for glpk
Failed to build glpk
ERROR: Could not build wheels for glpk which use PEP 517 and cannot be installed directly
I tried to search for different installation tutorials or questions online, but most of them are for Linux/MacOS, but not for Windows. What can I do about this?

I found a solution to run glpk in python without using PIP. I get the same issue and couldn't solve it with PIP.
First thing is download GLPK solver:
https://sourceforge.net/projects/winglpk/
GLPK is based in C. You must check where is a file called glpsol.exe
And add that directory to the path.
look remarked txt in this image
After that you can run your pyomo model and select GLPK as your solver.

It is looking for glpk.h in the folder C:\Users\User\Anaconda3\include. You can make the installation succeed by copying glpk.h from the GLPK installation into that folder. You will also need to copy glpk.lib into C:\Users\User\Anaconda3\libs.

Related

error: subprocess-exited-with-error | I have an error trying to install pysqlite3 with pip

I've been trying to install pysqlite via pip, but I get this error using the console command: pip install pysqlite3:
Collecting pysqlite3
Using cached pysqlite3-0.5.0.tar.gz (40 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pysqlite3
Building wheel for pysqlite3 (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\pysqlite3
copying pysqlite3\dbapi2.py -> build\lib.win-amd64-cpython-311\pysqlite3
copying pysqlite3\__init__.py -> build\lib.win-amd64-cpython-311\pysqlite3
running build_ext
Builds a C extension linking against libsqlite3 library
building 'pysqlite3._sqlite3' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\src
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMODULE_NAME=\"pysqlite3.dbapi2\" -I/usr/include "-IC:\Users\USUARIO\Documents\VSCode Projects\env\include" -IC:\Users\USUARIO\AppData\Local\Programs\Python\Python311\include -IC:\Users\USUARIO\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc\blob.c /Fobuild\temp.win-amd64-cpython-311\Release\src\blob.obj
blob.c
C:\Users\USUARIO\AppData\Local\Temp\pip-install-repsnu9p\pysqlite3_2227e0dab76349b680a8874662134523\src\blob.h(4): fatal error C1083: No se puede abrir el archivo incluir: 'sqlite3.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pysqlite3
Running setup.py clean for pysqlite3
Failed to build pysqlite3
Installing collected packages: pysqlite3
Running setup.py install for pysqlite3 ... error
error: subprocess-exited-with-error
× Running setup.py install for pysqlite3 did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
running install
C:\Users\USUARIO\Documents\VSCode Projects\env\Lib\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.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\pysqlite3
copying pysqlite3\dbapi2.py -> build\lib.win-amd64-cpython-311\pysqlite3
copying pysqlite3\__init__.py -> build\lib.win-amd64-cpython-311\pysqlite3
running build_ext
Builds a C extension linking against libsqlite3 library
building 'pysqlite3._sqlite3' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\src
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DMODULE_NAME=\"pysqlite3.dbapi2\" -I/usr/include "-IC:\Users\USUARIO\Documents\VSCode Projects\env\include" -IC:\Users\USUARIO\AppData\Local\Programs\Python\Python311\include -IC:\Users\USUARIO\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc\blob.c /Fobuild\temp.win-amd64-cpython-311\Release\src\blob.obj
blob.c
C:\Users\USUARIO\AppData\Local\Temp\pip-install-repsnu9p\pysqlite3_2227e0dab76349b680a8874662134523\src\blob.h(4): fatal error C1083: No se puede abrir el archivo incluir: 'sqlite3.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pysqlite3
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I need to implement pysqlite3 in python, but there seem to be various bugs which I don't understand. I also tried to install everything in a virtual environment (virtualenv) because I thought it might be an incompatibility of one of the packages I already have (like Flask, numpy, ect), but I keep getting the same error.
I also tried to install some specific version of pysqlite3 using pip install pysqlite3=={version}, but none of this has worked, the error remains the same.
I have tried updating pip, wheel and setuptools, but the error persists. Does anyone know how to fix it and be able to install pysqlite3?

'grib_api.h': No such file or directory on Windows

I am trying to install pygrib on windows. i already installed VS build tools for c++
I am getting this error
`Building wheels for collected packages: pygrib
Building wheel for pygrib (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pygrib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
eccodes not found, build may fail...
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\pygrib
copying src\pygrib\__init__.py -> build\lib.win-amd64-cpython-38\pygrib
running build_ext
cythoning src/pygrib/_pygrib.pyx to src/pygrib\_pygrib.c
building 'pygrib._pygrib' extension
creating build\temp.win-amd64-cpython-38
creating build\temp.win-amd64-cpython-38\Release
creating build\temp.win-amd64-cpython-38\Release\src
creating build\temp.win-amd64-cpython-38\Release\src\pygrib
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ic:\users\zahee\appdata\local\programs\python\python38\include -Ic:\users\zahee\appdata\local\programs\python\python38\Include -IC:\Users\zahee\AppData\Local\Temp\pip-build-env-a8xx5o11\overlay\Lib\site-packages\numpy\core\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc/pygrib\_pygrib.c /Fobuild\temp.win-amd64-cpython-38\Release\src/pygrib\_pygrib.obj
_pygrib.c
C:\Users\zahee\AppData\Local\Temp\pip-build-env-a8xx5o11\overlay\Lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
src/pygrib\_pygrib.c(756): fatal error C1083: Cannot open include file: 'grib_api.h': No such file or directory
C:\Users\zahee\AppData\Local\Temp\pip-build-env-a8xx5o11\overlay\Lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\zahee\AppData\Local\Temp\pip-install-9rng5s0e\pygrib_20eaa5920fdd4d09ae6fbbe6d3015227\src\pygrib\_pygrib.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pygrib
Failed to build pygrib
ERROR: Could not build wheels for pygrib, which is required to install pyproject.toml-based projects`
` fatal error C1083: Cannot open include file: 'grib_api.h': No such file or directory
`
also tried clone pygrib repo https://jswhit.github.io/pygrib/installing.html but `grib_api.h` not exists in the path.
can anyone help with this issue. I am trying to make an executable using windows.
the code running perfect on macos and linux.
thank you

VS Code / Errors during Python package Installation with pip / Capytaine package

I am trying to install the capytaine package using pip (pip install capytaine) (in VS Code).
Unfortunately I am getting multiple errors, although other packages such as numpy, matplotlib etc. are installed and run successfully. I have beginner to intermediate python and general programming skills, however I struggle solving delicate issues, such as dealing with errors I encountered here. Therefore, I am not sure whether the errors are caused by wheel, setup.py or some path related mistake.
I have already went through some other discussions, but couldn't find a useful resource for my problem, neither has installing C++ build tools recommended by VS Code helped.
I've got Python 3.9.13, wheel 0.37.1 and setuptools 65.3.0 on my computer. (Should I downgrade setuptools to below 60 version? how?)
I would really appreciate if you could assist me resolve the installation issues here.
I've cropped the irrelevant parts of the output after running pip install capytaine to fit
the character requirements, hope it's not gibberish.
PS D:\TUHH\Master\Masterarbeit\Preliminary_tests\NemohAQWA_Check> pip install capytaine
Collecting capytaine
Using cached capytaine-1.4.tar.gz (124 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in c:\users\dodob\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from capytaine) (1.23.2)
.
.
.
Building wheels for collected packages: capytaine
Building wheel for capytaine (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [213 lines of output]
C:\Users\dodob\AppData\Local\Temp\pip-install-46g3rmya\capytaine_cc3bdd35637b4ed48d97c88363dfe438\setup.py:9: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
from numpy.distutils.core import Extension, setup
running bdist_wheel
.
.
.
-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include /Tcbuild\src.win-amd64-3.9\capytaine\green_functions\Delhommeau_f90module.c /Fobuild\temp.win-amd64-cpython-39\Release\build\src.win-amd64-3.9\capytaine\green_functions\Delhommeau_f90module.obj -O2 -fopenmp -cpp
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
cl : Command line warning D9002 : ignoring unknown option '-cpp'
Delhommeau_f90module.c
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: Command "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ibuild\src.win-amd64-3.9\build\src.win-amd64-3.9\capytaine\green_functions -IC:\Users\dodob\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\numpy\core\include -Ibuild\src.win-amd64-3.9\numpy\distutils\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.316"
.
.
.
INFO: CCompilerOpt.cache_flush[857] : write cache to path -> C:\Users\dodob\AppData\Local\Temp\pip-install-46g3rmya\capytaine_cc3bdd35637b4ed48d97c88363dfe438\build\temp.win-amd64-cpython-39\Release\ccompiler_opt_cache_ext.py
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for capytaine
Running setup.py clean for capytaine
Failed to build capytaine
Installing collected packages: capytaine
Running setup.py install for capytaine ... error
error: subprocess-exited-with-error
× Running setup.py install for capytaine did not run successfully.
│ exit code: 1
╰─> [200 lines of output]
C:\Users\dodob\AppData\Local\Temp\pip-install-46g3rmya\capytaine_cc3bdd35637b4ed48d97c88363dfe438\setup.py:9: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
from numpy.distutils.core import Extension, setup
running install
C:\Users\dodob\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
.
.
.
creating C:\Users\dodob\AppData\Local\Temp\tmpv6hwqlsf\Users\dodob\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\numpy\distutils\checks
INFO: CCompilerOpt.cc_test_flags[1073] : testing flags (/WX)
WARN: CCompilerOpt.__init__[1240] : feature 'AVX512_KNL' is disabled, MSVC compiler doesn't support it
WARN: CCompilerOpt.__init__[1240] : feature 'AVX512_KNM' is disabled, MSVC compiler doesn't support it
INFO: CCompilerOpt.__init__[1782] : check requested baseline
.
.
.
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: Command "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ibuild\src.win-amd64-3.9\build\src.win-amd64-3.9\capytaine\green_functions -IC:\Users\dodob\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\numpy\core\include -Ibuild\src.win-amd64-3.9\numpy\distutils\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include /Tcbuild\src.win-amd64-3.9\capytaine\green_functions\Delhommeau_f90module.c /Fobuild\temp.win-amd64-cpython-39\Release\build\src.win-amd64-3.9\capytaine\green_functions\Delhommeau_f90module.obj -O2 -fopenmp -cpp" failed with exit status 2
INFO:
########### EXT COMPILER OPTIMIZATION ###########
INFO: Platform :
Architecture: x64
Compiler : msvc
CPU baseline :
Requested : 'min'
Enabled : none
Flags : none
Extra checks: none
CPU dispatch :
Requested : 'max -xop -fma4'
Enabled : none
Generated : none
INFO: CCompilerOpt.cache_flush[857] : write cache to path -> C:\Users\dodob\AppData\Local\Temp\pip-install-46g3rmya\capytaine_cc3bdd35637b4ed48d97c88363dfe438\build\temp.win-amd64-cpython-39\Release\ccompiler_opt_cache_ext.py
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> capytaine
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
One way is If you install a new version of python make sure you have added the path into the System environment variable of windows.
The second one is In VS code you need to add a Python Interpreter to run a pip command.
a. CTRL+SHIFT+P to open Command Palette.
b. Type & Select Python Interpreter in Command Palette.
The third way is to create a virtual environment and activate it in your project and run any types of pip command you want to install.
For that see the
link 1 (https://code.visualstudio.com/docs/python/environments)
Link 2 (https://docs.python.org/3/tutorial/venv.html)
According to the docs.
This package can only be installed by Conda package manager by the following codes:
conda install -c conda-forge capytaine
You need to create an conda environment then install this package.
The Python extension automatically detects existing conda environments. We recommend you install a Python interpreter into your conda environment, otherwise one will be installed for you after you select the environment. For example, the following command creates a conda environment with the Python 3.9 interpreter and several libraries, which VS Code then shows in the list of available interpreters:
conda create -n env-01 python=3.9 scipy=0.15.0 astroid babel
You can refer to docs for more details to create a conda environment.
This is very likely a conflict of package versions. Try running pip list, copying all of your packages, creating a new file called requirements.txt, putting all of your packages in there (without versions) and running pip install -r requirements.txt. This will tell pip to solve the version conflict and you'll get a more readable error in the worst case scenario.

Cannot open include file: 'io.h': No such file or directory, Python 3.7.5, Windows 8.1, VS v 2019

I am trying to install the Isotree package from pip install, when I receive the error below. I am using Python 3.7, working on a Windows 8 with installed C++ build tools using Visual studio build tools 2019 (version 16.7.5). I have also included Windows 10 SDK (10.0.18362.0) along with other add-ons.
I have tried all possible solutions I found to similar problems on this website and via other google searches, but I can't seem to get it working. Since I am working on a work laptop, I cannot go around and download from another party.
Can somebody help me how to resolve this problem? I tried setting an environment variable INCLUDE, pointing to the folder [C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt]
this helped but another error occurred, "cannot open include: basetsd.h" and then trying to solve that, the original error (io.h) came back.
Building wheel for isotree (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\a481838\appdata\local\programs\python\python37\python.exe'
'c:\users\a481838\appdata\local\programs\python\python37\lib\site-packages\pip\
_vendor\pep517\_in_process.py' build_wheel 'C:\Users\A481838\AppData\Local\Temp\
tmpslnm97j9'
cwd: C:\Users\A481838\AppData\Local\Temp\pip-install-uxt3l0k4\isotree
Complete output (28 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\isotree
copying isotree\__init__.py -> build\lib.win-amd64-3.7\isotree
running build_ext
cythoning isotree/cpp_interface.pyx to isotree\cpp_interface.cpp
building 'isotree._cpp_interface' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\isotree
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\1
4.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D_USE_MER
SENNE_TWISTER -D_ENABLE_CEREAL -IC:\Users\A481838\AppData\Local\Temp\pip-build-e
nv-7aj7e0rh\overlay\Lib\site-packages\numpy\core\include -I. -I./src -IC:\Users\
A481838\AppData\Local\Temp\pip-build-env-7aj7e0rh\overlay\include -Ic:\users\a48
1838\appdata\local\programs\python\python37\include -Ic:\users\a481838\appdata\l
ocal\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual
Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (
x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include"
"-IC:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" /EHsc /Tpis
otree\cpp_interface.cpp /Fobuild\temp.win-amd64-3.7\Release\isotree\cpp_interfac
e.obj /openmp /O2 /std:c++14
cpp_interface.cpp
c:\users\a481838\appdata\local\programs\python\python37\include\pyconfig.h(59)
: fatal error C1083: Cannot open include file: 'io.h': No such file or directory
c:\users\a481838\appdata\local\programs\python\python37\lib\distutils\extensio
n.py:131: UserWarning: Unknown Extension options: 'install_requires'
warnings.warn(msg)
C:\Users\A481838\AppData\Local\Temp\pip-build-env-7aj7e0rh\overlay\Lib\site-pa
ckages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_le
vel' not set, using 2 for now (Py2). This will change in a later release! File:
C:\Users\A481838\AppData\Local\Temp\pip-install-uxt3l0k4\isotree\isotree\cpp_int
erface.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
warning: isotree\cpp_interface.pyx:384:44: Not all members given for struct 'I
soForest'
warning: isotree\cpp_interface.pyx:384:44: Not all members given for struct 'I
soForest'
warning: isotree\cpp_interface.pyx:387:47: Not all members given for struct 'E
xtIsoForest'
warning: isotree\cpp_interface.pyx:387:47: Not all members given for struct 'E
xtIsoForest'
warning: isotree\cpp_interface.pyx:391:34: Not all members given for struct 'I
mputer'
warning: isotree\cpp_interface.pyx:391:34: Not all members given for struct 'I
mputer'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildT
ools\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x64\\cl.exe' failed with exit
status 2
----------------------------------------
ERROR: Failed building wheel for isotree
Failed to build isotree
ERROR: Could not build wheels for isotree which use PEP 517 and cannot be instal
led directly```
Type the following.
pip install pipwin
pipwin install pycuda

PIP Cryptography Failing to Install

There are a quite a few answers to this question covering a ton of different scenarios but I've yet to find a solution to the self-same issue. When I try to install pip install cryptography I get:
generating cffi module
'build\temp.win-amd64-3.8\Release\_padding.c' creating
build\temp.win-amd64-3.8 creating build\temp.win-amd64-3.8\Release
generating cffi module
'build\temp.win-amd64-3.8\Release\_constant_time.c' generating
cffi module 'build\temp.win-amd64-3.8\Release\_openssl.c'
building '_openssl' extension creating
build\temp.win-amd64-3.8\Release\build creating
build\temp.win-amd64-3.8\Release\build\temp.win-amd64-3.8 creating
build\temp.win-amd64-3.8\Release\build\temp.win-amd64-3.8\Release
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe
/c /nologo /Ox /W3 /GL /DNDEBUG /MD
-IC:\Users\be004cr\PycharmProjects\SSLTest\venv\include -IC:\ Python\Python38\include -IC:\Python\Python38\include "-IC:\Program
Files (x86)\Microsoft Visual
Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\ATLMFC\include"
"-IC:\Program Files (x86)\Microsoft Visual Studio\
2017\Professional\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program
Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program
Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program
Files (x86) \Windows Kits\10\include\10.0.17763.0\shared"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt"
"-IC:\Program Files (x86)\Wind ows
Kits\10\include\10.0.17763.0\cppwinrt"
/Tcbuild\temp.win-amd64-3.8\Release_openssl.c
/Fobuild\temp.win-amd64-3.8\Release\build\temp.win-amd64-3.8\Release_openssl.obj
_openssl.c build\temp.win-amd64-3.8\Release_openssl.c(498): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such
file or directory error: command 'C:\Program Files (x86)\Microsoft
Visual
Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe'
failed with exit status 2
---------------------------------------- Failed building wheel for
cryptography Running setup.py clean for cryptography Failed to build
cryptography Could not build wheels for cryptography which use PEP 517
and cannot be installed directly
I am running a virtual environment within PyCharm 2019.2.5 on a Windows 10.
I have installed OpenSSL from https://slproweb.com/products/Win32OpenSSL.html and selected the
latest 32bit version (I had the 64bit installed at first attempt but read elsewhere people had trouble with this so swtiched to 32bit)
I have updated the LIB and INCLUDE locations to the relevant ../openssl/include and ../openssl/lib locations and tried re-running the pip install but I keep gettng the same message. I've done this within the terminal within PyCharm and the standard CMD prompt.
I'm running PIP version 19.0.3
I'm sure I'm missing something super simple. Just don't know what.
I'm looking to use the cryptography (originally planned to use pyopenssl but have noticed it's been superceded by cryptography) to enable HTTPS for my flask application.
Is there anything I've missed? I feel there is.
Many thanks
You can try this
1. Open PyCharm.
2. go to File -> settings -> Project:test(test means your project name) -> select project interpretor -> click add button
3. after clicking add button and search <package name> then install it.
finally, run the program.
Update
Newer versions of Pycharm have a "+" mark (add button) here.

Categories

Resources