Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name Cloud #676

Closed
Oxtay opened this issue Jun 4, 2014 · 9 comments
Closed

cannot import name Cloud #676

Oxtay opened this issue Jun 4, 2014 · 9 comments

Comments

@Oxtay
Copy link

Oxtay commented Jun 4, 2014

For some reason, bokeh is unable to import Clound from session, returns:

cannot import name Cloud

I just installed it and I am just starting to play around with it, so I am not sure whether the problem is my setting or from something else.

EDIT: solution is to remove old leftover "session" directory under site-packages/bokeh

@bryevdv
Copy link
Member

bryevdv commented Jun 4, 2014

@Oxtay how did you install it? session used to be a package and now it is a module and this can cause problems if the old directory is still lying around. I will also warn that the Cloud support is extremely alpha at this stage.

@Oxtay
Copy link
Author

Oxtay commented Jun 4, 2014

@bryevdv Thanks for the response. I actually followed the instructions in (Bokeh Quickstart)[http://bokeh.pydata.org/docs/quickstart.html#quickstart], and I got that error when running python iris.py
Why is the Cloud needed in here? Is there a documentation for it? I am just starting to use Bokeh so I still have a long way to go.

@damianavila
Copy link
Contributor

But, did you use conda? pip?... clone the repo? Thanks

@bryevdv
Copy link
Member

bryevdv commented Jun 4, 2014

@Oxtay it should't, I think you have an installation problem (not your fault) can you let us know how you installed/set up bokeh?

@Oxtay
Copy link
Author

Oxtay commented Jun 4, 2014

Sorry for not being specific.
I used pip:
pip install bokeh
and then ran python setup.py install
None of these gave me any problems.
I suspect that the problem might be because of using a virtualenv. Would that be causing the problem?
This is the complete error message that I get:

Traceback (most recent call last):
  File "iris.py", line 3, in <module>
    from bokeh.plotting import *
  File "/Users/okhtay/.virtualenvs/ip/lib/python2.7/site-packages/bokeh/plotting.py", line 21, in <module>
    from .session import Cloud, DEFAULT_SERVER_URL, Session
ImportError: cannot import name Cloud

@Oxtay
Copy link
Author

Oxtay commented Jun 4, 2014

Also in case needed, these are the packages installed in my virtualenv for Bokeh:

Cheetah==2.4.4
Flask==0.10.1
GDAL==1.10.1
Jinja2==2.7.2
Markdown==2.4
MarkupSafe==0.19
PyYAML==3.11
Pygments==1.6
Werkzeug==0.9.4
backports.ssl-match-hostname==3.4.0.2
bokeh==0.4.4
colorama==0.3.1
gevent==1.0.1
gevent-websocket==0.9.3
gnureadline==6.3.3
greenlet==0.4.2
ipython==2.0.0
itsdangerous==0.24
lxml==3.3.5
matplotlib==1.4.x
mercurial==2.9.2
mlpy==3.5.0
mock==1.0.1
mpldatacursor==0.5
nose==1.3.1
numpy==1.8.1
pandas==0.13.1
pyparsing==2.0.2
pystache==0.5.4
python-dateutil==2.2
pytz==2013b
pyzmq==14.2.0
readline==6.2.4.1
redis==2.10.1
requests==2.3.0
scikit-learn==0.14.1
scipy==0.13.3
six==1.6.1
stevedore==0.15
tornado==3.2
virtualenv==1.11.4
virtualenv-clone==0.2.4
virtualenvwrapper==4.2
websocket==0.2.1
wsgiref==0.1.2

@damianavila
Copy link
Contributor

OK, but do you install by pip: pip install bokeh and the you do python setup.py install? Where?
I am also seeing some other non-related packages in your virtualenv... did you try to install bokeh in this environment before? If this is the case, how?
Sorry for the lot of questions, trying to narrow the space to investigate... 😉

@bryevdv
Copy link
Member

bryevdv commented Jun 4, 2014

@Oxtay my guess is that you id a pip install bokeh (which installed 0.4.4, which has the session directory). Then also later ran python setup.py install in the bokeh source checkout? If so, this is the problem. setup.py will not remove the old session directory. I would suggest removing the bokeh directory from your virtualenv site-packages and then re-running either:

  • `pip install bokeh

OR

  • python setup.py install --build_js in the bokeh source tree

but not both. One note though, if you want to install from source, you will need to build the bokehjs library, which requires some small work. I would suggest using just the 0.4.4 version installed from pip, unless you have js dev tools (npm, grunt, etc) installed already.

@Oxtay
Copy link
Author

Oxtay commented Jun 4, 2014

@bryevdv You are absolutely right. That's what I've done and having looked at the webpage again, I realize that I should not have run both commands.
Thank you also, @damianavila . This is a rather experimental virtualenv, so I have a few packages that are unrelated to Bokeh.
Thanks for your helps. I just redid the installation and everything works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants