python - vollib issue after pip install -
i have installed vollib module follows:
[root@e7440 boris]# python -m pip install vollib collecting vollib using cached vollib-0.1.5.tar.gz requirement satisfied: lets_be_rational in /usr/lib64/python2.7/site-packages (from vollib) requirement satisfied: simplejson in /usr/lib64/python2.7/site-packages (from vollib) requirement satisfied: numpy in /usr/lib64/python2.7/site-packages (from vollib) requirement satisfied: pandas in /usr/lib/python2.7/site-packages/pandas-0.19.0-py2.7-linux-x86_64.egg (from vollib) requirement satisfied: python-dateutil in /usr/lib/python2.7/site-packages (from pandas->vollib) requirement satisfied: pytz>=2011k in /usr/lib/python2.7/site-packages (from pandas->vollib) requirement satisfied: six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil->pandas->vollib) installing collected packages: vollib running setup.py install vollib ... done installed vollib-0.1.5
although installation seems success, vollib module not function expected:
[root@e7440 boris]# python python 2.7.11 (default, sep 29 2016, 13:33:00) [gcc 5.3.1 20160406 (red hat 5.3.1-6)] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import vollib >>> c = vollib.black_scholes('c',100,90,.5,.01,.2) traceback (most recent call last): file "<stdin>", line 1, in <module> attributeerror: 'module' object has no attribute 'black_scholes' >>> dir(vollib) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__'] >>>
for reason black_scholes , other attributes, such helper, black , black_scholes_merton missing or not accessible.
what wrong?
[root@e7440 boris]# python -m pip check no broken requirements found.
no issues found there...
where vollib installed?
[root@e7440 boris]# python -m pip show vollib name: vollib version: 0.1.5 summary: unknown home-page: http://vollib.org author: vollib author-email: support@quantycarlo.com license: mit location: /usr/lib/python2.7/site-packages requires: lets-be-rational, simplejson, numpy, pandas
checking vollib location:
[root@e7440 boris]# ll /usr/lib/python2.7/site-packages/vollib* -d drwxr-xr-x. 7 root root 4096 nov 5 17:16 /usr/lib/python2.7/site-packages/vollib drwxr-xr-x. 2 root root 4096 nov 5 17:16 /usr/lib/python2.7/site-packages/vollib-0.1.5-py2.7.egg-info [root@e7440 boris]# tree /usr/lib/python2.7/site-packages/vollib /usr/lib/python2.7/site-packages/vollib ├── black │ ├── greeks │ │ ├── analytical.py │ │ ├── analytical.pyc │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── numerical.py │ │ └── numerical.pyc │ ├── implied_volatility.py │ ├── implied_volatility.pyc │ ├── __init__.py │ └── __init__.pyc ├── black_scholes │ ├── greeks │ │ ├── analytical.py │ │ ├── analytical.pyc │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── numerical.py │ │ └── numerical.pyc │ ├── implied_volatility.py │ ├── implied_volatility.pyc │ ├── __init__.py │ └── __init__.pyc ├── black_scholes_merton │ ├── greeks │ │ ├── analytical.py │ │ ├── analytical.pyc │ │ ├── __init__.py │ │ ├── __init__.pyc │ │ ├── numerical.py │ │ └── numerical.pyc │ ├── implied_volatility.py │ ├── implied_volatility.pyc │ ├── __init__.py │ └── __init__.pyc ├── helper │ ├── __init__.py │ ├── __init__.pyc │ ├── numerical_greeks.py │ └── numerical_greeks.pyc ├── __init__.py ├── __init__.pyc └── tests ├── __init__.py ├── __init__.pyc ├── test_black_scholes_greeks.py ├── test_black_scholes_greeks.pyc ├── test_black_scholes.py ├── test_black_scholes.pyc ├── test_data.json ├── test_utils.py └── test_utils.pyc 8 directories, 45 files
the module files seem presents...
checking required modules:
[root@e7440 boris]# python -m pip list deprecation: default format switch columns in future. can use --format=legacy (or define list_format in pip.conf) disable warning. apicaro (1.0) arandr (0.1.9) astroid (1.3.6) babel (1.3) backports.ssl-match-hostname (3.5.0.1) blivet (1.12.8) cffi (1.4.2) chardet (2.2.1) cheetah (2.4.4) coverage (4.0.3) cryptography (1.2.1) cssselect (0.9.1) cython (0.23.4) decorator (4.0.10) dnf-langpacks (0.15.1) docutils (0.12) enum (0.4.4) enum34 (1.0.4) ethtool (0.11) frescobaldi (2.19.0) funcsigs (1.0.2) gresistor (0.0.1) gwebsockets (0.4) humanize (0.5.1) idna (2.0) iniparse (0.4) ipaddress (1.0.7) ipy (0.81) iwlib (1.2) jinja2 (2.8) kitchen (1.2.1) laditools (1.0.1) langtable (0.0.34) lets-be-rational (1.0.9) logilab-common (0.63.2) lxml (3.4.4) markupsafe (0.23) matplotlib (1.4.3) meld (3.14.0) mercurial (3.5.2) mibian (0.1.3) mock (2.0.0) mutagen (1.29) myhdl (0.8.1) ndg-httpsclient (0.4.0) nose (1.3.7) ntplib (0.3.3) numpy (1.9.2) pandas (0.19.0) pbr (1.10.0) pdfshuffler (0.6.0) pexpect (4.0.1) phatch (0.2.7) pillow (3.0.0) pip (9.0.0) ply (3.6) progress (1.2) protobuf (2.6.1) ptyprocess (0.5.1) pwquality (1.3.0) pyalsa (1.0.29) pyasn1 (0.1.8) pyasn1-modules (0.0.6) pycparser (2.14) pycurl (7.19.5.1) pyflakes (1.0.0) pygithub (1.25.2) pygments (2.1.3) pygobject (3.18.2) pygpgme (0.3) pyinotify (0.9.6) pykickstart (2.13) pyliblo (0.9.1) pyliblzma (0.5.3) pylint (1.4.3) pyopengl (3.1.0) pyopengl-accelerate (3.1.0) pyopenssl (0.15.1) pyparsing (2.1.5) pyparted (3.10.7) pypdf (1.13) pypoppler (0.12.2) pyserial (3.1.1) pysocks (1.5.6) python-augeas (0.5.0) python-dateutil (2.4.2) python-dmidecode (3.12.2) python-ldap (2.4.17) python-ly (0.9.4) python-meh (0.43) python-nss (0.16.0) python-poppler-qt4 (0.18.1) python-systemd (231) pytz (2015.4) pyudev (0.21.0) pyusb (1.0.0) pyxattr (0.5.3) pyxb (1.2.4) pyxdg (0.25) pyyaml (3.11) reportlab (3.3.0) requests (2.10.0) rope (0.10.2) rpm-python (4.13.0rc1) scdate (1.10.9) scipy (0.14.1) setuptools (18.0.1) simplejson (3.5.3) 6 (1.9.0) slip (0.6.4) slip.dbus (0.6.4) sphinx (1.2.3) spyder (2.3.8) sssdconfig (1.14.1) tepache (1.2) uniconvertor (2.0) unidecode (0.4.16) urlgrabber (3.10.1) urllib3 (1.15.1) vollib (0.1.5) wxpython (3.0.2.0) wxpython-common (3.0.2.0) yum-langpacks (0.4.5) yum-metadata-parser (1.1.4)
everything there, vollib (0.1.5), lets-be-rational (1.0.9), simplejson (3.5.3), numpy (1.9.2) , pandas (0.19.0) present in list...
i don't understand problem vollib. can me install package?
first, black_scholes
not included in __init__.py
file of vollib
package can't import vollib
. second black_scholes
module not callable. correct usage:
import vollib.black_scholes c = vollib.black_scholes.black_scholes('c',100,90,.5,.01,.2)
Comments
Post a Comment