quantopian / zipline

Zipline, a Pythonic Algorithmic Trading Library
https://www.zipline.io
Apache License 2.0
17.7k stars 4.73k forks source link

Getting No module named 'Zipline' after installing with conda #2378

Open hollowheights opened 5 years ago

hollowheights commented 5 years ago

Dear Zipline Maintainers,

Before I tell you about my issue, let me describe my environment:

Environment

Python 3.4 with pycharm

* Operating System: Win 10 * Python Version: Python 3.4 * Python Bitness: 64 bit * How did you install Zipline: Conda * Python packages: `$ pip freeze` or `$ conda list` Could not extract name and version from: 'blaze 0.9.1' Could not extract name and version from: 'bokeh 0.11.1' Could not extract name and version from: 'boto 2.39.0' Could not extract name and version from: 'Bottleneck 1.0.0' Could not extract name and version from: 'bs4 0.0.1' Could not extract name and version from: 'cffi 1.5.2' Could not extract name and version from: 'chest 0.2.3' Could not extract name and version from: 'cloudpickle 0.1.1' Could not extract name and version from: 'clyent 1.2.1' Could not extract name and version from: 'colorama 0.3.7' Could not extract name and version from: 'comtypes 1.1.2' Could not extract name and version from: 'conda 4.0.5' Could not extract name and version from: 'conda-build 1.20.0' Could not extract name and version from: 'conda-env 2.4.5' Could not extract name and version from: 'conda-manager 0.3.1' Could not extract name and version from: 'configobj 5.0.6' Could not extract name and version from: 'cryptography 1.3' Could not extract name and version from: 'cycler 0.10.0' Could not extract name and version from: 'Cython 0.23.4' Could not extract name and version from: 'cytoolz 0.7.5' Could not extract name and version from: 'dask 0.8.1' Could not extract name and version from: 'datashape 0.5.1' Could not extract name and version from: 'decorator 4.0.9' Could not extract name and version from: 'dill 0.2.4' Could not extract name and version from: 'docutils 0.12' Could not extract name and version from: 'dynd c328ab7' Could not extract name and version from: 'et-xmlfile 1.0.1' Could not extract name and version from: 'fastcache 1.0.2' Could not extract name and version from: 'fix-yahoo-finance 0.0.21' Could not extract name and version from: 'Flask 0.10.1' Could not extract name and version from: 'Flask-Cors 2.1.2' Could not extract name and version from: 'future 0.16.0' Could not extract name and version from: 'gevent 1.1.0' Could not extract name and version from: 'gitdb2 2.0.3' Could not extract name and version from: 'GitPython 2.1.9' Could not extract name and version from: 'greenlet 0.4.9' Could not extract name and version from: 'h5py 2.5.0' Could not extract name and version from: 'HeapDict 1.0.0' Could not extract name and version from: 'html5lib 1.0.1' Could not extract name and version from: 'idna 2.0' Could not extract name and version from: 'inflection 0.3.1' Could not extract name and version from: 'ipykernel 4.3.1' Could not extract name and version from: 'ipython 4.1.2' Could not extract name and version from: 'ipython-genutils 0.1.0' Could not extract name and version from: 'ipywidgets 4.1.1' Could not extract name and version from: 'itsdangerous 0.24' Could not extract name and version from: 'jdcal 1.2' Could not extract name and version from: 'jedi 0.9.0' Could not extract name and version from: 'Jinja2 2.8' Could not extract name and version from: 'jsonschema 2.4.0' Could not extract name and version from: 'jupyter 1.0.0' Could not extract name and version from: 'jupyter-client 4.2.2' Could not extract name and version from: 'jupyter-console 4.1.1' Could not extract name and version from: 'jupyter-core 4.1.0' Could not extract name and version from: 'llvmlite 0.9.0' Could not extract name and version from: 'locket 0.2.0' Could not extract name and version from: 'lxml 3.6.0' Could not extract name and version from: 'macholib 1.8' Could not extract name and version from: 'MarkupSafe 0.23' Could not extract name and version from: 'matplotlib 1.5.1' Could not extract name and version from: 'menuinst 1.3.2' Could not extract name and version from: 'mistune 0.7.2' Could not extract name and version from: 'more-itertools 2.2' Could not extract name and version from: 'mpmath 0.19' Could not extract name and version from: 'multipledispatch 0.4.8' Could not extract name and version from: 'multitasking 0.0.7' Could not extract name and version from: 'nbconvert 4.1.0' Could not extract name and version from: 'nbformat 4.0.1' Could not extract name and version from: 'ndg-httpsclient 0.4.2' Could not extract name and version from: 'networkx 1.11' Could not extract name and version from: 'nltk 3.2' Could not extract name and version from: 'nose 1.3.7' Could not extract name and version from: 'notebook 4.1.0' Could not extract name and version from: 'numba 0.24.0' Could not extract name and version from: 'numexpr 2.5' Could not extract name and version from: 'numpy 1.10.4' Could not extract name and version from: 'odo 0.4.2' Could not extract name and version from: 'openpyxl 2.3.2' Could not extract name and version from: 'pandas 0.22.0' Could not extract name and version from: 'pandas-datareader 0.6.0' Could not extract name and version from: 'partd 0.3.2' Could not extract name and version from: 'path.py 0.0.0' Could not extract name and version from: 'patsy 0.4.0' Could not extract name and version from: 'pefile 2017.9.3' Could not extract name and version from: 'pep8 1.7.0' Could not extract name and version from: 'pickleshare 0.5' Could not extract name and version from: 'Pillow 3.1.1' Could not extract name and version from: 'pip 18.1' Could not extract name and version from: 'playsound 1.2.2' Could not extract name and version from: 'ply 3.8' Could not extract name and version from: 'psutil 4.1.0' Could not extract name and version from: 'py 1.4.31' Could not extract name and version from: 'pyasn1 0.1.9' Could not extract name and version from: 'pycosat 0.6.1' Could not extract name and version from: 'pycparser 2.14' Could not extract name and version from: 'pycrypto 2.6.1' Could not extract name and version from: 'pyflakes 1.1.0' Could not extract name and version from: 'Pygments 2.1.1' Could not extract name and version from: 'PyInstaller 3.3' Could not extract name and version from: 'pyOpenSSL 0.15.1' Could not extract name and version from: 'pyparsing 2.0.3' Could not extract name and version from: 'pyreadline 2.1' Could not extract name and version from: 'pytest 2.8.5' Could not extract name and version from: 'python-dateutil 2.5.1' Could not extract name and version from: 'pytz 2016.2' Could not extract name and version from: 'pywin32 220' Could not extract name and version from: 'PyYAML 3.11' Could not extract name and version from: 'pyzmq 15.2.0' Could not extract name and version from: 'QtAwesome 0.3.2' Could not extract name and version from: 'qtconsole 4.2.0' Could not extract name and version from: 'QtPy 1.0' Could not extract name and version from: 'Quandl 3.0.1' Could not extract name and version from: 'requests 2.9.1' Could not extract name and version from: 'requests-file 1.4' Could not extract name and version from: 'requests-ftp 0.3.1' Could not extract name and version from: 'rope-py3k 0.9.4.post1' Could not extract name and version from: 'scikit-image 0.12.3' Could not extract name and version from: 'scikit-learn 0.17.1' Could not extract name and version from: 'scipy 0.17.0' Could not extract name and version from: 'setuptools 20.3' Could not extract name and version from: 'simplegeneric 0.8.1' Could not extract name and version from: 'singledispatch 3.4.0.3' Could not extract name and version from: 'six 1.10.0' Could not extract name and version from: 'smmap2 2.0.3' Could not extract name and version from: 'snowballstemmer 1.2.1' Could not extract name and version from: 'sockjs-tornado 1.0.1' Could not extract name and version from: 'Sphinx 1.3.1' Could not extract name and version from: 'sphinx-rtd-theme 0.1.9' Could not extract name and version from: 'spyder 2.3.8' Could not extract name and version from: 'SQLAlchemy 1.0.12' Could not extract name and version from: 'statsmodels 0.6.1' Could not extract name and version from: 'sympy 1.0' Could not extract name and version from: 'tables 3.2.2' Could not extract name and version from: 'toolz 0.7.4' Could not extract name and version from: 'tornado 4.3' Could not extract name and version from: 'traitlets 4.2.1' Could not extract name and version from: 'unicodecsv 0.14.1' Could not extract name and version from: 'webencodings 0.5.1' Could not extract name and version from: 'Werkzeug 0.11.4' Could not extract name and version from: 'wheel 0.29.0' Could not extract name and version from: 'wrapt 1.10.11' Could not extract name and version from: 'xlrd 0.9.4' Could not extract name and version from: 'XlsxWriter 0.8.4' Could not extract name and version from: 'xlwings 0.7.0' Could not extract name and version from: 'xlwt 1.0.0' alabaster 0.7.7 py35_0 anaconda 4.0.0 np110py35_0 anaconda-client 1.4.0 py35_0 anaconda-navigator 1.1.0 py35_0 argcomplete 1.0.0 py35_1 astropy 1.1.2 np110py35_0 babel 2.2.0 py35_0 beautifulsoup4 4.4.1 py35_0 bitarray 0.8.1 py35_1 blaze 0.9.1 py35_0 bokeh 0.11.1 py35_0 boto 2.39.0 py35_0 bottleneck 1.0.0 np110py35_0 bzip2 1.0.6 vc14_2 [vc14] cffi 1.5.2 py35_0 chest 0.2.3 py35_0 cloudpickle 0.1.1 py35_0 clyent 1.2.1 py35_0 colorama 0.3.7 py35_0 comtypes 1.1.2 py35_0 conda 4.0.5 py35_0 conda-build 1.20.0 py35_0 conda-env 2.4.5 py35_0 conda-manager 0.3.1 py35_0 configobj 5.0.6 py35_0 console_shortcut 0.1.1 py35_1 cryptography 1.3 py35_0 curl 7.45.0 vc14_1 [vc14] cycler 0.10.0 py35_0 cython 0.23.4 py35_0 cytoolz 0.7.5 py35_0 dask 0.8.1 py35_0 datashape 0.5.1 py35_0 decorator 4.0.9 py35_0 dill 0.2.4 py35_0 docutils 0.12 py35_1 dynd-python 0.7.2 py35_0 et_xmlfile 1.0.1 py35_0 fastcache 1.0.2 py35_0 flask 0.10.1 py35_1 flask-cors 2.1.2 py35_0 freetype 2.5.5 vc14_0 [vc14] gevent 1.1.0 py35_0 greenlet 0.4.9 py35_0 h5py 2.5.0 np110py35_4 hdf5 1.8.15.1 vc14_4 [vc14] heapdict 1.0.0 py35_0 idna 2.0 py35_0 ipykernel 4.3.1 py35_0 ipython 4.1.2 py35_1 ipython_genutils 0.1.0 py35_0 ipywidgets 4.1.1 py35_0 itsdangerous 0.24 py35_0 jdcal 1.2 py35_0 jedi 0.9.0 py35_0 jinja2 2.8 py35_0 jpeg 8d vc14_0 [vc14] jsonschema 2.4.0 py35_0 jupyter 1.0.0 py35_2 jupyter_client 4.2.2 py35_0 jupyter_console 4.1.1 py35_0 jupyter_core 4.1.0 py35_0 libdynd 0.7.2 0 libpng 1.6.17 vc14_1 [vc14] libsodium 1.0.3 0 libtiff 4.0.6 vc14_1 [vc14] llvmlite 0.9.0 py35_0 locket 0.2.0 py35_0 lxml 3.6.0 py35_0 markupsafe 0.23 py35_1 matplotlib 1.5.1 np110py35_0 menuinst 1.3.2 py35_0 mistune 0.7.2 py35_0 mkl 11.3.1 0 mkl-service 1.1.2 py35_0 mpmath 0.19 py35_0 multipledispatch 0.4.8 py35_0 nbconvert 4.1.0 py35_0 nbformat 4.0.1 py35_0 networkx 1.11 py35_0 nltk 3.2 py35_0 nose 1.3.7 py35_0 notebook 4.1.0 py35_2 numba 0.24.0 np110py35_0 numexpr 2.5 np110py35_0 numpy 1.10.4 py35_0 odo 0.4.2 py35_0 openpyxl 2.3.2 py35_0 openssl 1.0.2g vc14_0 [vc14] pandas 0.18.0 np110py35_0 partd 0.3.2 py35_1 path.py 8.1.2 py35_1 patsy 0.4.0 np110py35_0 pep8 1.7.0 py35_0 pickleshare 0.5 py35_0 pillow 3.1.1 py35_0 pip 8.1.1 py35_1 ply 3.8 py35_0 psutil 4.1.0 py35_0 py 1.4.31 py35_0 pyasn1 0.1.9 py35_0 pycosat 0.6.1 py35_0 pycparser 2.14 py35_0 pycrypto 2.6.1 py35_3 pyflakes 1.1.0 py35_0 pygments 2.1.1 py35_0 pyopenssl 0.15.1 py35_2 pyparsing 2.0.3 py35_0 pyqt 4.11.4 py35_5 pyreadline 2.1 py35_0 pytables 3.2.2 np110py35_2 pytest 2.8.5 py35_0 python 3.5.1 4 python-dateutil 2.5.1 py35_0 pytz 2016.2 py35_0 pywin32 220 py35_1 pyyaml 3.11 py35_3 pyzmq 15.2.0 py35_0 qt 4.8.7 vc14_7 [vc14] qtawesome 0.3.2 py35_0 qtconsole 4.2.0 py35_1 qtpy 1.0 py35_0 requests 2.9.1 py35_0 rope 0.9.4 py35_1 scikit-image 0.12.3 np110py35_0 scikit-learn 0.17.1 np110py35_0 scipy 0.17.0 np110py35_0 setuptools 20.3 py35_0 simplegeneric 0.8.1 py35_0 singledispatch 3.4.0.3 py35_0 sip 4.16.9 py35_2 six 1.10.0 py35_0 snowballstemmer 1.2.1 py35_0 sockjs-tornado 1.0.1 py35_0 sphinx 1.3.5 py35_0 sphinx_rtd_theme 0.1.9 py35_0 spyder 2.3.8 py35_1 sqlalchemy 1.0.12 py35_0 statsmodels 0.6.1 np110py35_0 sympy 1.0 py35_0 tk 8.5.18 vc14_0 [vc14] toolz 0.7.4 py35_0 tornado 4.3 py35_0 traitlets 4.2.1 py35_0 unicodecsv 0.14.1 py35_0 vs2015_runtime 14.00.23026.0 0 werkzeug 0.11.4 py35_0 wheel 0.29.0 py35_0 xlrd 0.9.4 py35_0 xlsxwriter 0.8.4 py35_0 xlwings 0.7.0 py35_0 xlwt 1.0.0 py35_0 zlib 1.2.8 vc14_2 [vc14]

Now that you know a little about me, let me tell you about the issue I am having:

I have tried for a couple of hours to install zipline, but with no luck.

Description of Issue

Here is how you can reproduce this issue on your machine:

Reproduction Steps

I ended up installing zipline from these instructions:

conda create -n env_full anaconda python=3.4 conda activate env_full conda install -c Quantopian zipline

What steps have you taken to resolve this already?

My best guess for now is that when I try to import zipline into my python file in pycharm, pycharm (or python in general) is looking for the module in the wrong place. The module is installed in the separate "env_full" to not conflict with previous modules - at least as far as I have understood. ...

Anything else?

Hope to get some help here - installing zipline har already taken a few hour more than I had expected :) ...

Sincerely, Hollow Heights

davidhuang123 commented 5 years ago

I have the same issue with Jupyter notebook. The solution is to connect Kernel to your notebook. Check this out https://medium.com/@ace139/enable-multiple-kernels-in-jupyter-notebooks-6098c738fe72

hollowheights commented 5 years ago

This seems very relevant. I am using pycharm though. And I'm not sure what info I should use in the following part

(some-env)$ python -m ipykernel install --user --name <some-env> --display-name "<name-of-your-kernel>"

I basically don't have experience with virtual environments. As far as I understand the libraries are kept for themselves, but I need python and/or pycharm to look for zipline in this specific location instead of where my other libraries/modules are.

hollowheights commented 5 years ago

Update: I have tested with jupyter notebook now. When I use a previously installed module such as numpy it runs in both Pycharm and Jupyter. However "no module name xxx" is returned when I try to import backtrader and zipline. Backtrader was installed with pip with no error messages, so I see to reason to think the installation in itself didn't work out.

Any ideas what could cause this change so that new modules are not being implemented successfully?

davidhuang123 commented 5 years ago

Do you connect Kernel to env_zipline when you are using Jupyter notebook? Backtrader does not require it's own unique environment, but Zipline does.