Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 520912 - dev-python/docker-py - python2.7 -c 'import docker': ImportError: No module named websocket
Summary: dev-python/docker-py - python2.7 -c 'import docker': ImportError: No module n...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-26 00:17 UTC by Brian Coca
Modified: 2014-09-01 02:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Coca 2014-08-26 00:17:30 UTC
docker-py uses 'import websockets' if not run under python3, when using python2_7 the websockets library does not get installed (doesn't even seem available). So the docker-py lib is not usable.


Reproducible: Always

Steps to Reproduce:
1.emerge docker-py
2.python -c 'import docker'

Actual Results:  
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/docker/__init__.py", line 20, in <module>
    from .client import Client # flake8: noqa
  File "/usr/lib64/python2.7/site-packages/docker/client.py", line 31, in <module>
    import websocket
ImportError: No module named websocket
nyx ~ # 


Expected Results:  
no errors

installing gevent-websocket does not seem to fix the issue either
Comment 1 Brian Coca 2014-08-26 00:20:05 UTC
My current workaround is installing pip and then doing:

pip install websocket-client
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2014-08-26 08:57:40 UTC
(In reply to Brian Coca from comment #1)
> My current workaround is installing pip and then doing:
> 
> pip install websocket-client

That's installing outside portage.  websocket-client is not in portage which kind of explains things in part. Can you not eselect py3 for this package?
Comment 3 Brian Coca 2014-08-26 12:55:00 UTC
No, the app I needed it for is python2

As I mentioned I found a workaround, I submitted the ticket to either remove python2 support from the package or add websocket as a dependency (and yes, add it to portage).
Comment 4 Alex Brandt (RETIRED) gentoo-dev 2014-08-26 14:59:40 UTC
I'm working on adding this to the tree as part of getting fig into the tree.  I should be ready to add it this coming Saturday if nothing comes up.  I can go ahead and update this issue and appropriate ebuilds when I get that added.

Let me know if there are any objections to me taking this issue and feel free to try the ebuild from the app-emulation/fig branch of my overlay.
Comment 5 Ian Delaney (RETIRED) gentoo-dev 2014-08-31 08:16:50 UTC
*websocket-client-0.17.0 (31 Aug 2014)
*websocket-client-0.11.0 (31 Aug 2014)

  31 Aug 2014; Alex Brandt <alunduil@gentoo.org>
  +websocket-client-0.11.0.ebuild, +websocket-client-0.17.0.ebuild,
  +metadata.xml:
  New ebuild for websocket-client. Ebuild written by me. Partial fix for bug
  #520912
Comment 6 Alex Brandt (RETIRED) gentoo-dev 2014-08-31 14:50:31 UTC
This bug still requires websocket-client to be added as a dependency on dev-python/docker-py-0.3.2.  It is clearly listed as a dependency in it's requirements.txt for the version in the tree: https://github.com/docker/docker-py/blob/0.3.2/requirements.txt

It is not currently listed as a dependency of that ebuild.  Should I go ahead and add that portion; thus, resolving this issue or are we going to leave the dependency out?

As Brian (the reporter) mentioned: "…either remove python2 support from the package [docker-py] or add websocket as a dependency…"
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2014-09-01 02:04:30 UTC
silly me, had a "can't see the forest for the trees' moment

  01 Sep 2014; Ian Delaney <idella4@gentoo.org> docker-py-0.3.2.ebuild:
  add dep to support py2.7, fixes Bug #520912 by B. Coca