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.
Related
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.
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.
I'm trying to build a small Python module in C. It's just a single .C file that includes a single header file and links a single static library.
On Linux everything works as expected, but one of our team members uses Windows, so I'd like to build this module for Windows as well.
I'm using Windows 10 with Visual Studio Build Tools 2017 installed, including the VC++ 2015.3 v14.00 (v140) toolset for desktop. I'm using Python 3.6.
from setuptools import setup, Extension
drone_logger_module = Extension('DroneLogger',
include_dirs=['Output\\include'],
libraries=['DroneLoggerWindows'],
library_dirs=['x64\\Release'],
sources=['Output\\src\\DroneLogger.py.c'])
setup([...],
ext_modules=[drone_logger_module])
When I ran python setup.py bdist_wininst, I got the following output:
running bdist_wininst
running build
running build_ext
building 'DroneLogger' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IOutput\include -IC:\Users\piete\AppData\Local\Programs\Python\Python36\include -IC:\Users\piete\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-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" /TcOutput\src\DroneLogger.py.c /Fobuild\temp.win-amd64-3.6\Release\Output\src\DroneLogger.py.obj
DroneLogger.py.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:x64\Release /LIBPATH:C:\Users\piete\AppData\Local\Programs\Python\Python36\libs /LIBPATH:C:\Users\piete\AppData\Local\Programs\Python\Python36\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64" DroneLoggerWindows.lib /EXPORT:PyInit_DroneLogger build\temp.win-amd64-3.6\Release\Output\src\DroneLogger.py.obj /OUT:build\lib.win-amd64-3.6\DroneLogger.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\Output\src\DroneLogger.cp36-win_amd64.lib
DroneLogger.py.obj : warning LNK4197: export 'PyInit_DroneLogger' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.6\Release\Output\src\DroneLogger.cp36-win_amd64.lib and object build\temp.win-amd64-3.6\Release\Output\src\DroneLogger.cp36-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed
with exit status 1158
I then followed this SO answer, and copied C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\rc.exe and rcdll.dll to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\. This solved the linking problem.
I've spent days trying to get it to work on Windows, and the solution I came up with is kind of questionable (that is, I don't know why it doesn't work out of the box, and I have a feeling that I shouldn't be moving Microsoft EXEs and DLLs around just to get it working).
My question is twofold:
Is there really no better/easier way to build a Windows installer for a Python C extension?
Why does this solution work, and why is it necessary?
What might make it generally easier to compile Python extensions on Linux than on Windows is that with standard package management on Linux you will generally have the same C compiler installed that was used to compile Python itself. On Windows, you have the choice of several Visual Studio versions, mingw, cygwin.
For Windows, I find it most straightforward to use the special Visual C++ for Python 2.7 package from Microsoft, which, unlike the newer Visual Studio version used in the question asked, has rc.exe properly in its path together with the Visual C compiler.
Another solution is to install the mingw compilers and create a file distutils.cfg in Lib/distutils in the main python folder with the contents
[build]
compiler=mingw32
[build_ext]
compiler=mingw32
to use these compilers instead. Unless -static-libgcc (and -static-libstdc++ for C++ projects) is added to the linker flags, the DLLs for libgcc (and for libstdc++) must be shipped with the extension so it will work also without the mingw runtime installed/in path.
I am trying to install QuantLib Python. So, I followed through and installed:
1) Anaconda3, boost_1_64_0, QuantLib-1.10, QuantLib-SWIG-1.10,swigwin-3.0.12.
2) I installed using Visual Studio 2017, QuantLib. I followed a youtube video and managed to install it correctly and run an example.
3) Then I switched back to the indications in http://quantlib.org/install/windows-python.shtml, I execute the commands:
cd C:\local\QuantLib-SWIG-1.10\Python
set QL_DIR=C:\local\QuantLib-1.10
set INCLUDE=C:\local\boost_1_64_0
python setup.py build
but it fails...summarizing what I get:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\local\Anaconda3\libs /LIBPATH:C:\local\Anaconda3\PCbuild\amd64 /LIBPATH:C:\local\QuantLib-1.10\lib "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\um\x64" /EXPORT:PyInit__QuantLib build\temp.win-amd64-3.6\Release\QuantLib/quantlib_wrap.obj /OUT:build\lib.win-amd64-3.6\QuantLib_QuantLib.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\QuantLib_QuantLib.cp36-win_amd64.lib /subsystem:windows /machine:x64
LINK : fatal error LNK1104: cannot open file 'QuantLib-vc140-x64-mt.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1104
I do have two files QuantLib-vc141-mt-gd.lib and QuantLib-vc141-mt.lib inside the folder C:\local\QuantLib-1.10\lib. I am sure the problem has to do with some path that I am not assigning correctly, but I don't know what else to try. Thanks!
Your paths are correct, but Python is using Visual Studio 2015 (because it's what it was compiled with) and the library you have was produced with Visual Studio 2017. If you use the 2015 version throughout, it should work.
I also met this question, the error info gives it cannot find vc140 lib file, which should be the result of vs2015. I tried on another PC with vs2015 and it did work.
If you find the version doesn't matter, here is another choice QL.whl. Finding your .whl file and install by
pip install [some.whl]
Trying to do a simple pip install TA-lib but am getting errors, in install Microsoft visual studios 14 but still the problem persists.
error code http://pastebin.com/h4jHWd1m
I tried to install it manually but get this:
setup.py:77: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running install
running build
running build_py
running build_ext
building 'talib.common' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python36-32\lib\site-packages\numpy\core\include -Ic:\ta-lib\c\include -IC:\Python36-32\include -IC:\Python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tctalib/common.c /Fobuild\temp.win32-3.6\Release\talib/common.obj
common.c
talib/common.c(240): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
The problem seems to be the same, any ideas ?
SOLVED. I had to download this and unzip to c:\
See https://github.com/mrjbq7/ta-lib#dependencies
Download file TA_Lib-0.4.24-cp37-cp37m-win_amd64.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
then use pip install TA_Lib-0.4.24-cp37-cp37m-win_amd64.whl