Current working method to install zipline? tried everything - python

Hey im trying to install zipline on Python but nothing works
I already tried it with Python 3.7 but it fails at the following libaries bcolz
lru dict
bottleneck
cyordereddict
(and zipline itself)
I tried it with Python 3.5 as recommended in this guide (https://pythonprogramming.net/zipline-local-install-python-programming-for-finance/)
same results.
I tried it creating an anaconda environment with pyhton 3.5 ... again same results.
the only thing that "worked was installing it without dependencies, but then i would have to install trading-calendars and some other libaries (which also didnt work to install):
pip install --no-deps zipline-1.3.0-cp37-cp37m-win_amd64.whl
Could somebody tell me a current working method on installing zipline?

zipline is as of now, not compatible with python version > 3.5 and is very specific to versions of dependent packages. Most of these packages has new versions.
https://github.com/quantopian/zipline/issues/2514
Best method would be to install with conda.
Once you had installed Anaconda/Miniconda you need to downgrade it to 4.6.11, below commands may help.
conda config --set allow_conda_downgrades true
conda install conda=4.6.11
conda create -n env_zipline python=3.5
activate env_zipline
conda install -c Quantopian zipline

To install zipline simply run in your new virtual env:
pip install -e git://github.com/shlomikushchi/zipline-trader.git#egg=zipline-trader
For more info:
Check Docs
Edit on GitHub
Lear from video tutorial
Read blog - Linear Regression For a Momentum Based Trading Strategy Using Zipline Trader
Chat on Slack

Related

Ubuntu conda Python3.9 can not find numpy

I can not use Mumpy with Ubuntu, Python 3.9 in Anaconda. But I have installed it. How can I fix this?
Part of the point of virtual environments, like those created by conda, are that you don't need root ("administrator") privileges to build and install software, so you shouldn't need sudo; just run python setup.py develop. You may need other things installed (compilers and development libraries) for that to work.
You've already confirmed numpy is installed via your conda install and pip install commands, but you could also run python -c "import numpy; print(numpy.__version__)" as further confirmation that it's working.
Pytorch is already packaged for conda - have you tried the command listed at that link?

What's the difference between conda skeleton and conda install?

Following this tutorial conda skeleton should be used for installing non r-essential R packages. however this hasn't worked for me. However after searching online this post suggests to use conda install -c r r-packagename which worked for me. So what is the difference between conda skeketon and conda install?
The skeleton command is used to jump-start the building of your own package. The install command is for installing someone else's package (or one that you previously finished.)

update to python 3.7 using anaconda

Python 3.7 alpha version is out, but I haven't been able to find any post on how to update to python 3.7 using Anaconda - maybe they will wait for the official release? Any suggestions?
This can be installed via conda with the command conda install -c anaconda python=3.7 as per https://anaconda.org/anaconda/python.
Though not all packages support 3.7 yet, running conda update --all may resolve some dependency failures.
Python 3.7 is now available to be installed, but many packages have not been updated yet. As noted by another answer here, there is a GitHub issue tracking the progress of Anaconda building all the updated packages.
Until someone creates a conda package for Python 3.7, you can't install it. Unfortunately, something like 3500 packages show up in a search for "python" on Anaconda.org (https://anaconda.org/search?q=%22python%22) so I couldn't see if anyone has done that yet.
You might be able to build your own package, depending on what OS you want it for. You can start with the recipe that conda-forge uses to build Python: https://github.com/conda-forge/python-feedstock/
In the past, I think Continuum have generally waited until a stable release to push out packages for new Pythons, but I don't work there, so I don't know what their actual policy is.
To see just the Python releases, do conda search --full-name python.
The September 4th release for 3.7 recommends the following:
conda install python=3.7 anaconda=custom
If you want to create a new environment, they recommend:
conda create -n example_env numpy scipy pandas scikit-learn notebook
anaconda-navigator
conda activate example_env
run conda navigator, you can upgrade your packages easily in the friendly GUI
conda create -n py37 -c anaconda anaconda=5.3
seems to be working.

Installing TensorFlow in python 3.5 Anaconda distro conda env

What I did to try and solve this issue:
Using Mac OS X
Using Anaconda distro currently in my computer as the path /Users/hongshuhong/anaconda/
Used conda instead of virtualenv because of my distribution of python. I referred to the guide here and tried to download the same with conda's package manager: https://www.tensorflow.org/versions/master/get_started/os_setup.html#download-and-setup
Tensorflow worked correctly when I created an anaconda env using the command conda create --name ML python=2.7 anaconda to state I'm using 2.7 python, then used this command conda install -c https://conda.anaconda.org/jjhelmus tensorflow
gathered from the Anaconda Cloud to attempt to download it. It worked when I said
$ python
>>> import tensorflow as tf
...
However, it doesn't really fix the issue:
However, I want to use the 3.5 distribution of python, simply to keep up with the times and not use outdated pythons.
I attempted to download it using the same way in python=3.5, but it raised this error when I tried to run the command conda install -c https://conda.anaconda.org/jjhelmus tensorflow :
Hint: the following packages conflict with each other:
- tensorflow
- python 3.5*
Use 'conda info tensorflow' etc. to see the dependencies for each package.
And I ran the conda info tensorflow to see what was going on and I got:
Fetching package metadata: ....
Error: No packages found in current osx-64 channels matching: tensorflow
This is really frustrating me and I'm not sure what to do. If there's no work around for this, I think I'll have to use Anaconda's python 2.7 distribution for TensorFlow experiments. If anyone has any idea how to solve this compatibility issue(or some other kind of issue), I'd be extremely grateful. Thanks.
EDIT: I'm pretty sure TensorFlow supports 3.5 because in their documentations they say they support 2.7 python and 3.3+. If there were no clues as to whether they support 3.5, I would have already given up and used 2.7 by now.
The version of TensorFlow packaged here is version 0.5.
Python 3.x support was introduced in TensorFlow 0.6, so you need to figure out how to install the newest version into Anaconda.
Usually you can install packages into anaconda using pip, but I haven't succeeded with TensorFlow.
EDIT: I just noticed that the documentation hasn't updated the url to the pip-wheel.
To install tensorflow in python 3.5 via pip, use the following command:
$ sudo easy_install --upgrade six
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py3-none-any.whl
This links to ...tensorflow-0.5.0-py2-none-any.whl, which is an older version of tensorflow for python 2.x.
Tensorflow get started page link.

upgrade to dev version of scikit-learn on Anaconda?

I'm using python through Anaconda, and would like to use a new feature (http://scikit-learn.org/dev/modules/neural_networks_supervised.html) in scikit-learn that's currently only available in the development version 0.18.dev0.
However, doing the classical conda update doesn't seem to work, as conda doesn't list any dev packages. What would be the simplest way to install a development version into my Anaconda? (For what it's worth, I'm using 64-bit windows 7.)
You can only use conda to install a package if someone has built and made available binaries for the package. Some packages publish nightly builds that would allow this, but scikit-learn is not one of them.
To install the bleeding-edge version in one command, you could use pip; e.g.:
$ conda install pip
$ pip install git+git://github.com/scikit-learn/scikit-learn.git
but keep in mind that this requires compiling all the C extensions within the library, and so it will fail if your system is not set up for that.
I had scikit-learn 0.17 which did not have MLPClassifier. I just did a conda update like below:
conda update scikit-learn
conda takes care of updating all dependent packages and after the update it works!
You should build your own scikit-learn package on Anaconda. I did it in about 10 mins (repo)(package). The conda tutorial on how to build packages was helpful. There are probably more ways than one to do this, but I just downloaded the scikit-learn github repo, dropped it into a new repo, added a directory that housed my conda recipe, and then built the package from the recipe which pointed to the source code I just downloaded.

Categories