在没有pip

时间:2015-11-12 02:47:57

标签: python linux virtualenv quantlib

我以通常的方式为所有项目使用virtualenv:创建项目文件夹,创建virtualenv,通过pip安装所需的包。

但是我现在正在尝试将pyql(https://github.com/enthought/pyql)安装到virtualenv中,但它不能通过pip获得。我通过在我的系统上安装标准的QuantLib c ++库来遵循入门指令(https://github.com/enthought/pyql/blob/master/docs/source/getting_started.rst),现在我需要安装pyql。

我从git下载了pyql,但问题是我不想只运行make buildmake test,因为这会将pyql安装到我的系统python上。我想将它安装到virtualenv中。我怎么做?我只使用pip将软件包安装到virtualenv中。

更新:

我已经激活了virtualenv然后运行make build,它提供了以下内容:

python setup.py build_ext --inplace
/usr/local/lib/python3.3/distutils/extension.py:132: UserWarning: Unknown Extension options: 'cython_directives'
  warnings.warn(msg)
missing cimport in module 'quantlib.methods.finitedifferences.solvers': ./quantlib/pricingengines/vanilla/_vanilla.pxd
missing cimport in module 'quantlib.methods.finitedifferences.solvers': ./quantlib/methods/finitedifferences/solvers/fdmbackwardsolver.pxd
missing cimport in module 'quantlib.pricingengines': quantlib/instruments/credit_default_swap.pyx
missing cimport in module 'quantlib.time': quantlib/instruments/credit_default_swap.pyx
missing cimport in module 'quantlib.instruments': quantlib/instruments/implied_volatility.pyx
missing cimport in module 'quantlib.pricingengines': quantlib/instruments/option.pyx
missing cimport in module 'quantlib.methods.finitedifferences.solvers': quantlib/methods/finitedifferences/solvers/fdmbackwardsolver.pyx
missing cimport in module 'quantlib.methods.finitedifferences.solvers': quantlib/methods/finitedifferences/solvers/fdmbackwardsolver.pxd
running build_ext
skipping 'quantlib/math/array.cpp' Cython extension (up-to-date)
skipping 'quantlib/math/hestonhwcorrelationconstraint.cpp' Cython extension (up-to-date)
skipping 'quantlib/sim/simulate.cpp' Cython extension (up-to-date)
skipping 'quantlib/pricingengines/vanilla/mcvanillaengine.cpp' Cython extension (up-to-date)
skipping 'quantlib/termstructures/yields/piecewise_yield_curve.cpp' Cython extension (up-to-date)
skipping 'quantlib/termstructures/credit/piecewise_default_curve.cpp' Cython extension (up-to-date)
skipping 'quantlib/settings.cpp' Cython extension (up-to-date)
skipping 'quantlib/test/test_cython_bug.cpp' Cython extension (up-to-date)
skipping 'quantlib/time/businessdayconvention.cpp' Cython extension (up-to-date)

如上所述,我根据需要安装了quantlib c ++库。然后在virtualenv中我安装了cython。

错误的第二行提到/usr/local/lib/python3.3。难道不是在virtualenv中使用python吗?

1 个答案:

答案 0 :(得分:1)

看起来Makefile https://github.com/enthought/pyql/blob/master/Makefile在构建期间调用python,所以只要你{virt {1}}

激活你的virtualenv就可以了。