Closed RiccaDS closed 1 year ago
One thing that jumps out is that the hipline-reloaded version you have is a bit older - we are currently at 2.2. To have conda
load the most recent versions, you may have to run
conda update conda
first.
Second, if the interpreter doesn't find the installed module, this suggest it is looking on the wrong path (e.g. your previous Python installation). One way to find out what's actually running is to execute
import sys
sys.prefix
in the notebook as this will show you which interpreter is running. If this is not your environment's interpreter, then either something went wrong while activating the environment (restart the shell and retry) or, more fundamentally, with the conda setup (it adds some code to your shell config files to ensure it's on the path). Here is one way to validate the installation.
Hope this helps, please let me know if it doesn't!
Thank you for the indications @stefan-jansen , I am getting nuts over this. Will test this in the evening and report back.
@stefan-jansen ok I wasn't able to make it work using conda. Honestly I made so many tests that I don't remember exactly all what went wrong, but conda gives some problems. In the end I was able to make it work with pip install. For those who need it these are the commands I used, these are also what can be found on the installation instructions: $ conda env create -n zipenv $ conda activate zipenv $ sudo apt install libatlas-base-dev python-dev gfortran pkg-config libfreetype6-dev hdf5-tools $ wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz $ tar -xzf ta-lib-0.4.0-src.tar.gz $ cd ta-lib/ $ sudo ./configure $ sudo make $ sudo make install $ cd .. $ pip install zipline-reloaded For testing purposes run $ zipline run --help
To ingest Quandl bundle get your key and add the corresponding environment variable called QUANDL_API_KEY $ conda install matplotlib $ jupyter notebook etc..
As I have some time I will retry with conda on another environment and report back the problems. Thank you
Thanks @RiccaDS. I had the same problem. conda install from the ml4t channel did not work, but the pip install solved the issue.
We have just updated Zipline to 2.4 (currently in beta) and should have the new version up on conda-forge in a week or so pending a new exchange-calendar release.
Dear Zipline Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
Operating System: Linux Mint 20.3 Cinnamon, 5.4.0-104-generic Kernel
Python Version: 3.9.7
Python Bitness: 64
How did you install Zipline: I installed Anaconda, then created a conda environment, activated it, installed zipline within it, then launched jupyter notebook.
Python packages:
Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 4.5 1_gnu
alembic 1.7.6 pyhd8ed1ab_0 conda-forge bcolz-zipline 1.2.4 py38hef53783_0 ml4t blas 1.0 mkl
bottleneck 1.3.2 py38heb32a55_1
brotlipy 0.7.0 py38h497a2fe_1001 conda-forge ca-certificates 2021.10.8 ha878542_0 conda-forge cached-property 1.5.2 hd8ed1ab_1 conda-forge cached_property 1.5.2 pyha770c72_1 conda-forge certifi 2021.10.8 py38h578d9bd_1 conda-forge cffi 1.15.0 py38hd667e15_1
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge click 8.0.4 py38h578d9bd_0 conda-forge cryptography 35.0.0 py38ha5dfef3_0 conda-forge decorator 4.4.2 py_0 conda-forge empyrical-reloaded 0.5.8 py38_0 ml4t greenlet 0.4.17 py38h497a2fe_2 conda-forge h5py 3.2.1 nompi_py38h9915d05_100 conda-forge hdf5 1.10.6 nompi_h3c11f04_101 conda-forge icu 58.2 hf484d3e_1000 conda-forge idna 3.3 pyhd8ed1ab_0 conda-forge importlib-metadata 4.11.2 py38h578d9bd_0 conda-forge importlib_resources 5.4.0 pyhd8ed1ab_0 conda-forge intel-openmp 2021.4.0 h06a4308_3561
intervaltree 3.0.2 py_0 conda-forge iso3166 2.0.2 pyhd8ed1ab_0 conda-forge iso4217 1.6.20180829 py_0 conda-forge ld_impl_linux-64 2.35.1 h7274673_9
libffi 3.3 he6710b0_2
libgcc-ng 9.3.0 h5101ec6_17
libgfortran-ng 7.5.0 h14aa051_20 conda-forge libgfortran4 7.5.0 h14aa051_20 conda-forge libgomp 9.3.0 h5101ec6_17
libstdcxx-ng 9.3.0 hd4cf53a_17
libxml2 2.9.12 h03d6c58_0
libxslt 1.1.34 hc22bd24_0
logbook 1.5.3 py38_0 ml4t lru-dict 1.1.7 py38h497a2fe_0 conda-forge lxml 4.8.0 py38h1f438cf_0
mako 1.2.0 pyhd8ed1ab_0 conda-forge markupsafe 2.0.1 py38h497a2fe_0 conda-forge mkl 2021.4.0 h06a4308_640
mkl-service 2.4.0 py38h497a2fe_0 conda-forge mkl_fft 1.3.1 py38hd3c417c_0
mkl_random 1.2.2 py38h1abd341_0 conda-forge multipledispatch 0.6.0 py_0 conda-forge multitasking 0.0.9 pyhd8ed1ab_0 conda-forge ncurses 6.3 h7f8727e_2
networkx 2.5.1 pyhd8ed1ab_0 conda-forge numexpr 2.8.1 py38h6abb31d_0
numpy 1.21.2 py38h20f2e39_0
numpy-base 1.21.2 py38h79a1101_0
openssl 1.1.1m h7f8727e_0
packaging 21.3 pyhd8ed1ab_0 conda-forge pandas 1.2.3 py38h51da96c_0 conda-forge pandas-datareader 0.10.0 pyh6c4a22f_0 conda-forge patsy 0.5.2 pyhd8ed1ab_0 conda-forge pip 21.2.4 py38h06a4308_0
pycparser 2.21 pyhd8ed1ab_0 conda-forge pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.7 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 py38h578d9bd_4 conda-forge python 3.8.12 h12debd9_0
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-interface 1.6.0 py_0 conda-forge python_abi 3.8 2_cp38 conda-forge pytz 2021.3 pyhd8ed1ab_0 conda-forge readline 8.1.2 h7f8727e_1
requests 2.27.1 pyhd8ed1ab_0 conda-forge scipy 1.7.3 py38hc147768_0
setuptools 58.0.4 py38h06a4308_0
six 1.16.0 pyh6c4a22f_0 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge sqlalchemy 1.3.23 py38h497a2fe_0 conda-forge sqlite 3.38.0 hc218d9a_0
statsmodels 0.13.0 py38h7f8727e_0
ta-lib 0.4.21 py38hfeaa757_0 ml4t tk 8.6.11 h1ccaba5_0
toolz 0.11.2 pyhd8ed1ab_0 conda-forge trading-calendars 2.1.1 pyhd3deb0d_0 conda-forge urllib3 1.26.8 pyhd8ed1ab_1 conda-forge wheel 0.37.1 pyhd3eb1b0_0
xz 5.2.5 h7b6447c_0
yfinance 0.1.63 py_0 ml4t zipline-reloaded 2.0.0.post1 py38hef53783_0 ml4t zipp 3.7.0 pyhd8ed1ab_1 conda-forge zlib 1.2.11 h7f8727e_4
Now that you know a little about me, let me tell you about the issue I am having:
After launching Jupyter Notebook and using this command
%load_ext zipline
as suggested in the tutorial at https://zipline.ml4trading.io/beginner-tutorial.html , I am rewarded with the following errorModuleNotFoundError: No module named 'zipline'
Also, if I return to the CLI and type any of the following commands$ zipline bundles
,$ zipline ingest -b quandl
I getinstruction not allowed (core dump created)
Here is how you can reproduce this issue on your machine:
Reproduction Steps
What steps have you taken to resolve this already?
-I have tried different versions of python -I have tried to restrain Pandas version to a maximum allowed version I don't actually remember but it was indicated as a possible solution on a post. -I installed anaconda-navigator and installed jupyter notebook(JN) from within it, then launched JN both from the CLI and from Anaconda-navigator. At this point the new error on import of the module in JN-Python 3 (ipykernel) is
The kernel appears to have died. It will restart automatically
. -I tried doing the same steps on the base environment and with different combinations to no avail.It is to be noted that before installing anaconda I have default Python 3.8.10 64bit packages installed. I am fairly new to linux and python so dunno if that matters.
Sincerely, Riccardo