implementing pyshark

Peter Otten __peter__ at web.de
Mon Apr 6 16:46:12 CEST 2015


Michael S. wrote:

[Please don't top-post. Thank you]

> import gevent --->  successful
> import gevent._threading ---> fails
>   output :
> In [2]: import gevent._threading
> 
---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call
> last) <ipython-input-2-50f3ada08750> in <module>()
> ----> 1 import gevent._threading
> 
> ImportError: No module named _threading

And the question is?

Everything that follows comes directly from my crystal ball and has the 
potential to break more stuff; if you try it you do it at your own risk.

Again, most likely you have a broken python-gevent install. If you got this 
by attempting a manual install from source without the necessary build 
dependencies you can either add these and try again.

Alternatively you can remove the debris:

1 Find out the location of the gevent folder:

$ python -c 'import gevent; print gevent.__file__'
/somefolder/gevent/__init__.pyc

2 Remove the gevent folder (unless it's maintained by the package manager).
$ rm -r /somefolder/gevent

Now pyshark should correctly detect that gevent is not available and use a 
fallback.

3 If you need gevent later use the official way to install it

$ sudo apt-get install python-gevent

in the hope that it contains a _threading module and pyshark will start 
using gevent again, this time successfully.




More information about the Python-list mailing list