problems installing quantlib for python 3.4

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

problems installing quantlib for python 3.4

chitown2015
I have a python 3.4 installed for anaconda. I have downloaded QuantLib-1.7 and successfully built it using Visual Studio 2010. The resulting file is C:\Research\quant_lib\QuantLib-1.7\lib\QuantLib-vc100-mt.

However, I cannot seem to install quantlib for python. I've followed the advice in this webpage:

https://vineetv.wordpress.com/2015/07/07/installing-quantlib-python-windows/

So here's what I've done:

1) I've opened Visual Studio Command Prompt 2010.
2) I've changed directory to Quantlib-SWIG folder:

cd C:\Research\quant_lib\QuantLib-SWIG-1.7\Python

3) I've modified the PATH to include necessary paths:

set PATH=C:\Anaconda3;C:\Anaconda3\Scripts;C:\Research\quant_lib\swigwin-3.0.8;C:\Research\quant_lib\QuantLib-1.7\lib

4) I've defined QL_DIR:

set QL_DIR=C:\Research\quant_lib\QuantLib-1.7

5) I've included boost:

set INCLUDE=C:\Research\quant_lib\boost_1_60_0

6) I've set LIB:

set LIB=C:\Research\quant_lib\boost_1_60_0\lib32-msvc-10.0

7) I've adjusted the setup file:

echo [build] > setup.cfg
echo compiler=msvc >> setup.cfg

8) I run:

python setup.py wrap

I get the following:

running wrap
Generating Python bindings for QuantLib...
SWIG(1) : Warning 125: Use of the include path to find the input file is deprecated and will not work with ccache. Please include the path when specifying the input file.

9) The above warning seemed innocent so I've went ahead and run the following:

python setup.py build

The result is:

running build
running build_py
copying QuantLib\QuantLib.py -> build\lib.win-amd64-3.4\QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Anaconda3\include -IC:\Anaconda3\include -IC:\Research\quant_lib\QuantLib-1.7 -IC:\Research\quant_lib\boost_1_60_0 /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win-amd64-3.4\Release\QuantLib/quantlib_w
rap.obj /GR /FD /Zm250 /EHsc /bigobj /MD
error: command 'cl.exe' failed: No such file or directory

I am not sure which cl.exe it is looking for. But cannot get past this point. Appreciate help.












Reply | Threaded
Open this post in threaded view
|

Re: problems installing quantlib for python 3.4

Luigi Ballabio
Hello,
    cl.exe is the Visual Studio compiler, which (I guess) the command prompt can't find because you replaced the PATH entirely instead of adding to it.  Instead of 

set PATH=C:\Anaconda3;C:\Anaconda3\Scripts;C:\Research\quant_lib\swigwin-3.0.8;C:\Research\quant_lib\QuantLib-1.7\lib

you should write

set PATH=C:\Anaconda3;C:\Anaconda3\Scripts;C:\Research\quant_lib\swigwin-3.0.8;C:\Research\quant_lib\QuantLib-1.7\lib;%PATH%

so that the previous value of PATH is appended.

Hope this helps,
    Luigi


On Wed, Mar 9, 2016 at 6:38 PM chitown2015 <[hidden email]> wrote:
I have a python 3.4 installed for anaconda. I have downloaded QuantLib-1.7
and successfully built it using Visual Studio 2010. The resulting file is
C:\Research\quant_lib\QuantLib-1.7\lib\QuantLib-vc100-mt.

However, I cannot seem to install quantlib for python. I've followed the
advice in this webpage:

https://vineetv.wordpress.com/2015/07/07/installing-quantlib-python-windows/

So here's what I've done:

1) I've opened Visual Studio Command Prompt 2010.
2) I've changed directory to Quantlib-SWIG folder:

cd C:\Research\quant_lib\QuantLib-SWIG-1.7\Python

3) I've modified the PATH to include necessary paths:

set
PATH=C:\Anaconda3;C:\Anaconda3\Scripts;C:\Research\quant_lib\swigwin-3.0.8;C:\Research\quant_lib\QuantLib-1.7\lib

4) I've defined QL_DIR:

set QL_DIR=C:\Research\quant_lib\QuantLib-1.7

5) I've included boost:

set INCLUDE=C:\Research\quant_lib\boost_1_60_0

6) I've set LIB:

set LIB=C:\Research\quant_lib\boost_1_60_0\lib32-msvc-10.0

7) I've adjusted the setup file:

echo [build] > setup.cfg
echo compiler=msvc >> setup.cfg

8) I run:

python setup.py wrap

I get the following:

running wrap
Generating Python bindings for QuantLib...
SWIG(1) : Warning 125: Use of the include path to find the input file is
deprecated and will not work with ccache. Please include the path when
specifying the input file.

9) The above warning seemed innocent so I've went ahead and run the
following:

python setup.py build

The result is:

running build
running build_py
copying QuantLib\QuantLib.py -> build\lib.win-amd64-3.4\QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG
-D_WINDOWS -DNOMINMAX -IC:\Anaconda3\include -IC:\Anaconda3\include
-IC:\Research\quant_lib\QuantLib-1.7 -IC:\Research\quant_lib\boost_1_60_0
/TpQuantLib/quantlib_wrap.cpp
/Fobuild\temp.win-amd64-3.4\Release\QuantLib/quantlib_w
rap.obj /GR /FD /Zm250 /EHsc /bigobj /MD
error: command 'cl.exe' failed: No such file or directory

I am not sure which cl.exe it is looking for. But cannot get past this
point. Appreciate help.
















--
View this message in context: http://quantlib.10058.n7.nabble.com/problems-installing-quantlib-for-python-3-4-tp17342.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: problems installing quantlib for python 3.4

chitown2015
Ok, I've corrected that and added %PATH% in the end. Now, I am getting:

running build
running build_py
creating build
creating build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\QuantLib
copying QuantLib\__init__.py -> build\lib.win-amd64-3.4\QuantLib
copying QuantLib\QuantLib.py -> build\lib.win-amd64-3.4\QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
creating build\temp.win-amd64-3.4\Release\QuantLib
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Anaconda3\include -IC:\Anaconda3\include -IC:\Research\python_extension_packages\QuantLib-1.7 -IC:\Research\python_extension_packages\boost_1
_58_0 /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj /GR /FD /Zm250 /EHsc /bigobj /MD
quantlib_wrap.cpp
c:\anaconda3\include\pyconfig.h(68) : fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2
Reply | Threaded
Open this post in threaded view
|

Re: problems installing quantlib for python 3.4

Luigi Ballabio
It might be a similar problem with include paths, but I'm not sure about it.  May you check if you have a file "io.h" in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"? If you do, it's an include path problem. If not, it might be the Visual Studio installation problem mentioned at <http://stackoverflow.com/questions/12460307/installation-of-visual-studio-2010-any-edition-installs-only-2-files-in-the-c/>.

Luigi

On Wed, Mar 16, 2016 at 9:06 PM chitown2015 <[hidden email]> wrote:
Ok, I've corrected that and added %PATH% in the end. Now, I am getting:

running build
running build_py
creating build
creating build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\QuantLib
copying QuantLib\__init__.py -> build\lib.win-amd64-3.4\QuantLib
copying QuantLib\QuantLib.py -> build\lib.win-amd64-3.4\QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
creating build\temp.win-amd64-3.4\Release\QuantLib
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX
-IC:\Anaconda3\include -IC:\Anaconda3\include
-IC:\Research\python_extension_packages\QuantLib-1.7
-IC:\Research\python_extension_packages\boost_1
_58_0 /TpQuantLib/quantlib_wrap.cpp
/Fobuild\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj /GR /FD
/Zm250 /EHsc /bigobj /MD
quantlib_wrap.cpp
c:\anaconda3\include\pyconfig.h(68) : fatal error C1083: Cannot open include
file: 'io.h': No such file or directory
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio
10.0\\VC\\BIN\\cl.exe' failed with exit status 2



--
View this message in context: http://quantlib.10058.n7.nabble.com/problems-installing-quantlib-for-python-3-4-tp17342p17350.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: problems installing quantlib for python 3.4

chitown2015
You were right. io.h hile file was in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include". So, I've adjusted my commands to have %INCLUDE% and %LIB%. Now I am having the following issue:

running build
running build_py
copying QuantLib\QuantLib.py -> build\lib.win-amd64-3.4\QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Anaconda3\include -IC:\Anaconda3\include -IC:\Research\python_extension_packages\QuantLib-1.7 -IC:\Research\python_extension_packages\boost_1
_58_0 "-Ic:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE" "-Ic:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include" /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj /GR /FD /Zm250 /EHsc /bigobj /MD
quantlib_wrap.cpp
QuantLib/quantlib_wrap.cpp(14658) : warning C4018: '<' : signed/unsigned mismatch
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Anaconda3\libs /LIBPATH:C:\Anaconda3\PCbuild\amd64 /LIBPATH:C:\Research\python_extension_packages\QuantLib-1.7\lib /LIBPATH:C:\Research\python_extension_packages\boost_1_58_0\lib32-msvc-10.0
"/LIBPATH:c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB" "/LIBPATH:c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib" /EXPORT:PyInit__QuantLib build\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj /OUT:build\lib.win-amd64-3.4\QuantLib\_QuantLib.pyd /IMPLIB:build\temp.win-amd
64-3.4\Release\QuantLib\_QuantLib.lib /MANIFESTFILE:build\temp.win-amd64-3.4\Release\QuantLib\_QuantLib.pyd.manifest /subsystem:windows /machine:x64
build\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\link.exe' failed with exit status 1112

This looks like I need to install 32 bit python to make this work? I am not sure.
Reply | Threaded
Open this post in threaded view
|

Re: problems installing quantlib for python 3.4

Luigi Ballabio
Neither am I.  People: is anybody using the Python bindings on Windows and Anaconda? May you step in with any suggestions?

Luigi


On Thu, Mar 17, 2016 at 5:27 PM chitown2015 <[hidden email]> wrote:
You were right. io.h hile file was in "C:\Program Files (x86)\Microsoft
Visual Studio 10.0\VC\include". So, I've adjusted my commands to have
%INCLUDE% and %LIB%. Now I am having the following issue:

running build
running build_py
copying QuantLib\QuantLib.py -> build\lib.win-amd64-3.4\QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX
-IC:\Anaconda3\include -IC:\Anaconda3\include
-IC:\Research\python_extension_packages\QuantLib-1.7
-IC:\Research\python_extension_packages\boost_1
_58_0 "-Ic:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE"
"-Ic:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include"
/TpQuantLib/quantlib_wrap.cpp
/Fobuild\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj /GR /FD
/Zm250 /EHsc /bigobj /MD
quantlib_wrap.cpp
QuantLib/quantlib_wrap.cpp(14658) : warning C4018: '<' : signed/unsigned
mismatch
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL
/nologo /INCREMENTAL:NO /LIBPATH:C:\Anaconda3\libs
/LIBPATH:C:\Anaconda3\PCbuild\amd64
/LIBPATH:C:\Research\python_extension_packages\QuantLib-1.7\lib
/LIBPATH:C:\Research\python_extension_packages\boost_1_58_0\lib32-msvc-10.0
"/LIBPATH:c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB"
"/LIBPATH:c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib"
/EXPORT:PyInit__QuantLib
build\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj
/OUT:build\lib.win-amd64-3.4\QuantLib\_QuantLib.pyd
/IMPLIB:build\temp.win-amd
64-3.4\Release\QuantLib\_QuantLib.lib
/MANIFESTFILE:build\temp.win-amd64-3.4\Release\QuantLib\_QuantLib.pyd.manifest
/subsystem:windows /machine:x64
build\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj : fatal error
LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio
10.0\\VC\\BIN\\link.exe' failed with exit status 1112

This looks like I need to install 32 bit python to make this work? I am not
sure.



--
View this message in context: http://quantlib.10058.n7.nabble.com/problems-installing-quantlib-for-python-3-4-tp17342p17352.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: problems installing quantlib for python 3.4

Mini Trader
I'm using Anaconda 3.5.  If using 3.4 it appears that it requires Visual Studio 10 - Python 3.4.4 |Continuum Analytics, Inc.| (default, Jan 29 2016, 15:20:20) [MSC v.1600 64 bit (AMD64)] on win32

Here is what i used to build for 3.5.  Note that I downloaded the appropriate boost library for my version of Visual Studio that was required.  3.5 uses VS 2015 or MSC 1900

cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
vcvarsall.bat amd64
SET INCLUDE=%INCLUDE%C:\Program Files\Boost\boost_1_60_0;
SET LIB=%LIB%C:\Program Files\Boost\boost_1_60_0\lib64-msvc-14.0;
cd C:\Program Files\QuantLib\QuantLib-SWIG-1.7\Python

From here you shouldn't get any errors.

On Thu, Mar 17, 2016 at 12:33 PM, Luigi Ballabio <[hidden email]> wrote:
Neither am I.  People: is anybody using the Python bindings on Windows and Anaconda? May you step in with any suggestions?

Luigi


On Thu, Mar 17, 2016 at 5:27 PM chitown2015 <[hidden email]> wrote:
You were right. io.h hile file was in "C:\Program Files (x86)\Microsoft
Visual Studio 10.0\VC\include". So, I've adjusted my commands to have
%INCLUDE% and %LIB%. Now I am having the following issue:

running build
running build_py
copying QuantLib\QuantLib.py -> build\lib.win-amd64-3.4\QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX
-IC:\Anaconda3\include -IC:\Anaconda3\include
-IC:\Research\python_extension_packages\QuantLib-1.7
-IC:\Research\python_extension_packages\boost_1
_58_0 "-Ic:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE"
"-Ic:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include"
/TpQuantLib/quantlib_wrap.cpp
/Fobuild\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj /GR /FD
/Zm250 /EHsc /bigobj /MD
quantlib_wrap.cpp
QuantLib/quantlib_wrap.cpp(14658) : warning C4018: '<' : signed/unsigned
mismatch
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL
/nologo /INCREMENTAL:NO /LIBPATH:C:\Anaconda3\libs
/LIBPATH:C:\Anaconda3\PCbuild\amd64
/LIBPATH:C:\Research\python_extension_packages\QuantLib-1.7\lib
/LIBPATH:C:\Research\python_extension_packages\boost_1_58_0\lib32-msvc-10.0
"/LIBPATH:c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB"
"/LIBPATH:c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib"
/EXPORT:PyInit__QuantLib
build\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj
/OUT:build\lib.win-amd64-3.4\QuantLib\_QuantLib.pyd
/IMPLIB:build\temp.win-amd
64-3.4\Release\QuantLib\_QuantLib.lib
/MANIFESTFILE:build\temp.win-amd64-3.4\Release\QuantLib\_QuantLib.pyd.manifest
/subsystem:windows /machine:x64
build\temp.win-amd64-3.4\Release\QuantLib/quantlib_wrap.obj : fatal error
LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio
10.0\\VC\\BIN\\link.exe' failed with exit status 1112

This looks like I need to install 32 bit python to make this work? I am not
sure.



--
View this message in context: http://quantlib.10058.n7.nabble.com/problems-installing-quantlib-for-python-3-4-tp17342p17352.html

Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users