Zipline: Install Help - when loading zipline get " ImportError: cannot import name 'RLock' "

Created on 9 Jun 2018  路  11Comments  路  Source: quantopian/zipline

Dear Zipline Maintainers,

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

Environment

  • Operating System: (Windows 10 64bit)
  • Python Version: `$ python --3.5.5
  • How did you install Zipline: ( conda)

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

Description of Issue

After a complete zipline install using conda, using jupyter running the following check:


import zipline


ImportError                               Traceback (most recent call last)
<ipython-input-1-ab8bff6e5ffb> in <module>()
----> 1 import zipline

D:\Anaconda3\envs\py35\lib\site-packages\zipline\__init__.py in <module>()
     18 # This is *not* a place to dump arbitrary classes/modules for convenience,
     19 # it is a place to expose the public interfaces.
---> 20 from . import data
     21 from . import finance
     22 from . import gens

D:\Anaconda3\envs\py35\lib\site-packages\zipline\data\__init__.py in <module>()
----> 1 from . import loader
      2 from .loader import (
      3     load_prices_from_csv,
      4     load_prices_from_csv_folder,
      5 )

D:\Anaconda3\envs\py35\lib\site-packages\zipline\data\loader.py in <module>()
     15 import os
     16 
---> 17 import logbook
     18 import pandas as pd
     19 from six.moves.urllib_error import HTTPError

D:\Anaconda3\envs\py35\lib\site-packages\logbook\__init__.py in <module>()
     12 
     13 import os
---> 14 from .base import (
     15     LogRecord, Logger, LoggerGroup, NestedSetup,  Processor, Flags,
     16     get_level_name, lookup_level, dispatch_record, CRITICAL, ERROR, WARNING,

D:\Anaconda3\envs\py35\lib\site-packages\logbook\base.py in <module>()
     15 from weakref import ref as weakref
     16 from datetime import datetime
---> 17 from logbook.concurrency import (
     18     thread_get_name, thread_get_ident, greenlet_get_ident)
     19 

D:\Anaconda3\envs\py35\lib\site-packages\logbook\concurrency.py in <module>()
     29 
     30 if has_gevent:
---> 31     from gevent._threading import (Lock as ThreadLock,
     32                                    RLock as ThreadRLock,
     33                                    get_ident as thread_get_ident,

ImportError: cannot import name 'RLock'


What steps have you taken to resolve this already?

I reinstalled Anaconda 3.5 and Zipline in a separate envirnment, but error still occurs

Anything else?

Thank you for your help,

Sincerely,

Michael

Install Help

Most helpful comment

No problem. I'm not certain... Since zipline doesn't depend on gevent, is there any chance you can uninstall it?

All 11 comments

Hi @mwc4120 , It looks like you have versions of logbook and gevent installed that are incompatible (with each other). Zipline requires logbook, but not gevent. I'm not sure what versions you have, but have you tried updating them?

Hi Rich,

Thanks for the reply. I did as you suggested and updated logbook to version 0.12.5 and gevent to version 1.3.2post0. The same error still occurs. Maybe there is something else that's incompatible, I am not sure yet. When I did conda install for zipline again, everything seemed installed ok and got the message: " All requested packages already installed". I guess it's hard for me to figure out which among them is not compatible.

thanks again,

Michael

No problem. I'm not certain... Since zipline doesn't depend on gevent, is there any chance you can uninstall it?

yeah, that worked. I removed the package using Anaconda Navigator. Thanks you!!!

Great!

please upgrade etc/requirements.txt in which the Logbook version is old, thanks

Hi @Federer1976, requirements.txt is used by zipline's setup.py as a lower bound when installing, so you should get the latest logbook when you pip install zipline (or conda install it).

I did this. It works.

pip uninstall logbook
pip install logbook

yeah, that worked. I removed the package using Anaconda Navigator. Thanks you!!!

THANKS!!! this worked.

pip uninstall logbook

Yes its

I did this. It works.

pip uninstall logbook pip install logbook

its work :)

I did this. It works.

pip uninstall logbook pip install logbook

Thank you. This worked for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaeljohnbennett picture michaeljohnbennett  路  4Comments

sluo1989 picture sluo1989  路  8Comments

ghost picture ghost  路  7Comments

marketneutral picture marketneutral  路  3Comments

richdevboston picture richdevboston  路  4Comments