Error importing zipline in Ubuntu 13.04

279 views
Skip to first unread message

hugo.c...@gmail.com

unread,
Feb 12, 2014, 8:14:03 AM2/12/14
to zip...@googlegroups.com
Ive installed zipline for the first time to give it a test. Ive installed all python dependencies and zipline itself using pip. Im on Ubuntu 13.04.

I wanted to follow this tutorial just to get familiarized with zipline, but importing zipline did not work. It gives the same error if I open a python terminal and type import zipline as zp or a similar one if I type import zipline :

>>> import zipline
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/zipline/__init__.py", line 30, in <module>
    from . algorithm import TradingAlgorithm
  File "/usr/local/lib/python2.7/dist-packages/zipline/algorithm.py", line 35, in <module>
    from zipline.sources import DataFrameSource, DataPanelSource
  File "/usr/local/lib/python2.7/dist-packages/zipline/sources/__init__.py", line 2, in <module>
    from zipline.sources.test_source import SpecificEquityTrades
  File "/usr/local/lib/python2.7/dist-packages/zipline/sources/test_source.py", line 27, in <module>
    from six.moves import range
ImportError: cannot import name range
>>> import zipline as zp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/zipline/__init__.py", line 25, in <module>
    from . import data
ImportError: cannot import name data
>>>

What am I missing?

Hugo


Eddie Hebert

unread,
Feb 12, 2014, 9:59:51 AM2/12/14
to hugo.c...@gmail.com, zip...@googlegroups.com
Hugo:

What version of `six` do you have installed?

>>> import six
>>> six.__version__

- Eddie

hugo.c...@gmail.com

unread,
Feb 12, 2014, 1:04:22 PM2/12/14
to zip...@googlegroups.com, hugo.c...@gmail.com
It says its version 1.2.0. Ive seen that the present version is 1.5.2. I tried to uninstall it but the packet manager told me a lot of basic ubuntu stuff depends on that package, so its a no go. I guess the its time to update Ubuntu. Thanks.

El dimecres 12 de febrer de 2014 15:59:51 UTC+1, Eddie Hebert va escriure:

Eddie Hebert

unread,
Feb 12, 2014, 2:37:00 PM2/12/14
to hugo.c...@gmail.com, zip...@googlegroups.com
Hugo:

Using virtualenv, http://www.virtualenv.org/, may help you get a working
installation without having to upgrade the system Python libraries.

- Eddie

Michael S

unread,
Feb 13, 2014, 1:54:13 PM2/13/14
to zip...@googlegroups.com, hugo.c...@gmail.com
It might be easier to just install anaconda somewhere

Anthony Garner

unread,
Aug 21, 2015, 12:18:59 PM8/21/15
to Zipline Python Opensource Backtester
I installed zipline successfully within Anaconda and also separately in a different folder which I use to track changes through Sourcetree. When using juptyer there is no problem importing Zipline and running the various demo algos. However when I point Spyder at the correct point at either of my zipline installations I get the same message see below).
While delighted I can operate zipline at all, any guidance on why I can't operate it through Spyder would be appreciated. 

 
 runfile('C:/Application/github/zipline/zipline/examples/quantopian_buy_apple.py', wdir='C:/Application/github/zipline/zipline/examples')
Traceback (most recent call last):

  File "<ipython-input-19-a1cf248c09e4>", line 1, in <module>
    runfile('C:/Application/github/zipline/zipline/examples/quantopian_buy_apple.py', wdir='C:/Application/github/zipline/zipline/examples')

  File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
    execfile(filename, namespace)

  File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Application/github/zipline/zipline/examples/quantopian_buy_apple.py", line 20, in <module>
    from zipline import TradingAlgorithm

  File "C:\Anaconda\lib\site-packages\zipline\__init__.py", line 25, in <module>
Reply all
Reply to author
Forward
0 new messages