Can anyone help me...
I have followed all the instructions as follows: 1.Boost Installation 2.QuantLib Installation (did it in 2 hours) 3.compiled the BermudanSwaption All this was done with no problem Installed SWIG The problem is when i try to import the library in IPython (from QuantLib import *) i get the error ImportError: No module named QuantLib any one ideas? |
Hello, the QuantLib-SWIG module installs a QuantLib.py file that Python doesn't currently find. When you say "Installed SWIG" you mean the QuantLib-SWIG release, or just SWIG? How did you do it? Luigi On Fri, Jun 10, 2016 at 12:09 PM quantengineer <[hidden email]> wrote: Can anyone help me... ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Ok this is what i have done now.....
1. QuantLib-1.8 Installation cd /usr/local/lib/QuantLib-1.2.1 sudo ./configure sudo make sudo make install this has worked .... 2. QuantLib-SWIG-1.1 Installation cd /usr/local/lib/QuantLib-SWIG-1.1 sudo ./configure sudo make -C Python At this point i get the error charless-MacBook-Pro-2:QuantLib-SWIG-1.7 charles$ sudo make -C Python /Applications/Xcode.app/Contents/Developer/usr/bin/make all-am CXXFLAGS="-g -O2 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings" /opt/local/bin/python setup.py build running build running build_py creating build creating build/lib.macosx-10.11-x86_64-2.7 creating build/lib.macosx-10.11-x86_64-2.7/QuantLib copying QuantLib/__init__.py -> build/lib.macosx-10.11-x86_64-2.7/QuantLib copying QuantLib/QuantLib.py -> build/lib.macosx-10.11-x86_64-2.7/QuantLib running build_ext building 'QuantLib._QuantLib' extension creating build/temp.macosx-10.11-x86_64-2.7 creating build/temp.macosx-10.11-x86_64-2.7/QuantLib /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -Os -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/opt/local/include -I/opt/local/include -c QuantLib/quantlib_wrap.cpp -o build/temp.macosx-10.11-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused -g -O2 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings In file included from QuantLib/quantlib_wrap.cpp:3940: In file included from /opt/local/include/ql/quantlib.hpp:47: In file included from /opt/local/include/ql/math/all.hpp:38: In file included from /opt/local/include/ql/math/matrixutilities/all.hpp:4: In file included from /opt/local/include/ql/math/matrixutilities/basisincompleteordered.hpp:25: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4036:59: error: 'value_type' is a private member of 'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double *> >' __val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>, ^ QuantLib/quantlib_wrap.cpp:7271:23: note: while substituting deduced template arguments into function template 'operator<<' [with _Expr = boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double *> >] s << (*self)[i][j]; ^ In file included from QuantLib/quantlib_wrap.cpp:3940: In file included from /opt/local/include/ql/quantlib.hpp:47: In file included from /opt/local/include/ql/math/all.hpp:38: In file included from /opt/local/include/ql/math/matrixutilities/all.hpp:4: In file included from /opt/local/include/ql/math/matrixutilities/basisincompleteordered.hpp:25: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4037:46: error: 'value_type' is a private member of 'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double *> >' __scalar_expr<typename _Expr::value_type>, _Expr> > ^ 2 errors generated. error: command '/usr/bin/clang' failed with exit status 1 make[1]: *** [.build-stamp] Error 1 make: *** [all] Error 2 charless-MacBook-Pro-2:QuantLib-SWIG-1.7 charles$ |
What version of Boost are you using? On Fri, Jun 10, 2016 at 9:39 PM quantengineer <[hidden email]> wrote: Ok this is what i have done now..... ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
boost 1.43
------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
You probably need a newer version. 1.43 is kind of old, and I think the compiler from El Capitan no longer compiles it correctly.
Luigi On Tue, Jun 14, 2016 at 3:20 PM Charles <[hidden email]> wrote:
------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
I installed 1.60 still i can’t call the library in ipython. However after following all instructions on
the example compiles only problem is i can’t call the library from ipython get an error which says -------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-1-7585f083cf27> in <module>() 1 ----> 2 import QuantLib as ql ImportError: No module named QuantLib I found this on the net….. does it make sense? To install Quantlib and Quantlib-SWIG on Mac OS 10.11.2 (El Capitan) and get it to work on Anaconda and pyCharm, I’ve followed the steps below:
Then you should be able to “import QuantLib as ql” in pyCharm, or any python IDE
|
They kind of make sense. Step 5 is no longer required. Step 10 is supposed to install the module where Anaconda can find it, but it seems dependent on where you have installed anaconda, so I'm not sure that on your system it would work as it is (by the way, do you use Anaconda at all?) Anyway: in a previous mail, you said you had the error while running "make -C Python" from QuantLib-SWIG. Does that work now? (In this mail you say you've followed http://quantlib.org/install/macosx.shtml, which only covers QuantLib installation, not QuantLib-SWIG). After that worked, did you also run "sudo make -C Python install"? Luigi On Wed, Jun 15, 2016 at 11:33 AM quantengineer <[hidden email]> wrote: I installed 1.60 still i can’t call the library in ipython. However after following all instructions on ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Luigi
Everything works until upto point 6 so far. I then downloaded QuantLib-Swig, got into the Python directory and run python setup.py build got the following charless-MacBook-Pro-2:Python charles$ python setup.py build running build running build_py file QuantLib/QuantLib.py (for module QuantLib.QuantLib) not found file QuantLib/QuantLib.py (for module QuantLib.QuantLib) not found running build_ext building 'QuantLib._QuantLib' extension /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -Os -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/opt/local/include -I/opt/local/include -c QuantLib/quantlib_wrap.cpp -o build/temp.macosx-10.11-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused clang: error: no such file or directory: 'QuantLib/quantlib_wrap.cpp' clang: error: no input files error: command '/usr/bin/clang' failed with exit status 1 i run python setup.py test and got running test running build running build_py file QuantLib/QuantLib.py (for module QuantLib.QuantLib) not found file QuantLib/QuantLib.py (for module QuantLib.QuantLib) not found running build_ext building 'QuantLib._QuantLib' extension /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -Os -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/opt/local/include -I/opt/local/include -c QuantLib/quantlib_wrap.cpp -o build/temp.macosx-10.11-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused clang: error: no such file or directory: 'QuantLib/quantlib_wrap.cpp' clang: error: no input files error: command '/usr/bin/clang' failed with exit status 1 charless-MacBook-Pro-2:Python charles$ I have
------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
You're missing source files. Did you download the release from https://sourceforge.net/projects/quantlib/files/QuantLib/1.8/other%20languages/? Are you following the instructions on the site at http://quantlib.org/install/linux-python.shtml ? On Wed, Jun 15, 2016 at 6:49 PM Charles <[hidden email]> wrote:
------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Luigi
Finally in the early hours of the morning its working…. just the bit at the end were i can get the link with anaconda working charless-MacBook-Pro-2:Python charles$ python setup.py test running test running build running build_py running build_ext testing QuantLib 1.8 runTest (date.DateTest) Testing date arithmetics ... ok testObservable (instruments.InstrumentTest) Testing observability of stocks ... ok testObservable (marketelements.MarketElementTest) Testing observability of market elements ... ok testObservableHandle (marketelements.MarketElementTest) Testing observability of market element handles ... ok testKronrod (integrals.IntegralTest) Testing Gauss-Kronrod integration ... ok testSegment (integrals.IntegralTest) Testing segment integration ... ok testSimpson (integrals.IntegralTest) Testing Simpson integration ... ok testTrapezoid (integrals.IntegralTest) Testing trapezoid integration ... ok runTest (solvers1d.Solver1DTest) Testing 1-D solvers ... ok testFSpreadedObs (termstructures.TermStructureTest) Testing observability of forward-spreaded term structure ... ok testImpliedObs (termstructures.TermStructureTest) Testing observability of implied term structure ... ok testZSpreadedObs (termstructures.TermStructureTest) Testing observability of zero-spreaded term structure ... ok testCashFlows (bonds.FixedRateBondTest) Testing that the FixedRateBond gives the expected cash flows. ... ok testCleanPrice (bonds.FixedRateBondTest) Testing FixedRateBond clean price. ... ok testCleanPriceFromZSpread (bonds.FixedRateBondTest) Testing FixedRateBond clean price derived from Z-spread. ... ok testDayCounter (bonds.FixedRateBondTest) Testing FixedRateBond dayCounter() method. ... ok testDirtyPrice (bonds.FixedRateBondTest) Testing FixedRateBond dirty price. ... ok testFrequency (bonds.FixedRateBondTest) Testing FixedRateBond frequency() method. ... ok testNextCoupon (bonds.FixedRateBondTest) Testing FixedRateBond correct next coupon amount. ... ok testNotional (bonds.FixedRateBondTest) Testing FixedRateBond notional values. ... ok testPrevCoupon (bonds.FixedRateBondTest) Testing FixedRateBond correct previous coupon amount. ... ok testRedemption (bonds.FixedRateBondTest) Testing FixedRateBond redemption value and date. ... ok testRedemptions (bonds.FixedRateBondTest) Testing FixedRateBond redemptions. ... ok testSimpleInspectors (bonds.FixedRateBondTest) Testing FixedRateBond simple inspectors. ... ok testBond (ratehelpers.FixedRateBondHelperTest) Testing FixedRateBondHelper bond() method. ... ok testFairRate (cms.CmsTest) Testing Hagan-pricer flat-vol equivalence for coupons... ... ok testParity (cms.CmsTest) Testing put-call parity for capped-floored CMS coupons... ... ok testConsistency (assetswap.AssetSwapTest) Testing consistency between fair price and fair spread... ... ok testGenericBondImplied (assetswap.AssetSwapTest) Testing implied generic-bond value against asset-swap fair price with null spread... ... ok testImpliedValue (assetswap.AssetSwapTest) Testing implied bond value against asset-swap fair price with null spread... ... ok testMASWWithGenericBond (assetswap.AssetSwapTest) Testing market asset swap against par asset swap with generic bond... ... ok testMarketASWSpread (assetswap.AssetSwapTest) Testing relationship between market asset swap and par asset swap... ... ok testSpecializedBondVsGenericBond (assetswap.AssetSwapTest) Testing clean and dirty prices for specialized bond against equivalent generic bond... ... ok testSpecializedBondVsGenericBondUsingAsw (assetswap.AssetSwapTest) Testing asset-swap prices and spreads for specialized bond against equivalent generic bond... ... ok testZSpread (assetswap.AssetSwapTest) Testing clean and dirty price with null Z-spread against theoretical prices... ... ok testZSpreadWithGenericBond (assetswap.AssetSwapTest) Testing clean and dirty price with null Z-spread against theoretical prices... ... ok ---------------------------------------------------------------------- Ran 36 tests in 0.665s OK charless-MacBook-Pro-2:Python charles$ python setup.py install --prefix //anaconda/envs/Users/charles/anaconda running install running build running build_py running build_ext running install_lib creating //anaconda error: could not create '//anaconda': Permission denied charless-MacBook-Pro-2:Python charles$
------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
I'm guessing that's because //anaconda/envs/Users/charles/anaconda was some kind of placeholder in the instructions for the actual Anaconda installation path. Does the path exist? Where is the Anaconda python installation on your computer? Luigi On Thu, Jun 16, 2016 at 2:21 AM Charles <[hidden email]> wrote:
------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |