Installing QuantLib in Anaconda on the Spyder Editor (Windows)
Asked Answered
V

3

7

How do I install the QuantLib Package in Anaconda. I have tried the following code;

import QuantLib as ql

but I am getting the following result;

ModuleNotFoundError: No module named 'QuantLib'

Can anyone assist me

Validity answered 23/2, 2017 at 8:55 Comment(5)
How did you install the QuantLib package? Where are their docs? What is the proper way to import from their package?Dangelo
I tried to install the QuantLib through the Visual Studio but I did not succeed. I have tried almost everything that is on the internet but the installation failed.Validity
"almost everything on the internet" Well that's quite a lot! Can you be more specific about what you tried most recently? Its impossible to help with such vague detailsDangelo
I tried what is on this link vineetv.wordpress.com/2015/07/07/…Validity
I tried what is on this link vineetv.wordpress.com/2015/07/07/… where I have to install the QuantLib in Visual Studio and download Boost and SWIG and I did not succeed in the last stage of stage in building the project where there was an error (3>LINK : fatal error LNK1104: cannot open file 'ucrtd.lib'). I created an additional path to the ucrtd folder but it still didn't work. I also followed the video on youtube youtube.com/watch?v=uWMT78XJFJEValidity
T
7

You first need to install the QuantLib package. The easiest way I found is to install Anaconda 4.3.1 (link), open a Command Prompt as Admin and run:

pip install QuantLib-Python

For me, this only worked on the latest version of Anaconda including Python 3.6, think the QuantLib-Python package was implemented in PIP only very recently. This might work for other recent installations of Python as well, but it did not work for me on older versions of Anaconda or Python 3.5.

Tantalic answered 30/3, 2017 at 10:43 Comment(1)
Is it also available for 32 bit installations of Anaconda?Prismatoid
C
2

I used this link download quantlib 1.7.1 to install in Windows 10 (I use Anaconda). It was really smooth and no prob at all.

Cobbie answered 16/5, 2017 at 23:54 Comment(1)
Is it also available for 32 bit installations of Anaconda?Prismatoid
T
2

conda install -c conda-forge quantlib does not appear to quite work while it shows a package in conda list as quantlib(note the lower case). The pip installation via python -m pip install QuantLib from Anaconda prompt did the trick for me and import QuantLib as ql runs fine without throwing errors.

see QuantLib-Python installation on Windows for more help.

Thessa answered 20/4, 2023 at 23:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.