no module named gevent even though it is installed

前端 未结 2 1909
再見小時候
再見小時候 2021-01-13 12:38

OS : Ubuntu 16.04 Python 2.7

pip list | grep gev
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns)         


        
2条回答
  •  情深已故
    2021-01-13 12:56

    Working in a Python virtual environment in Ubuntu 16.04 I got the following results:

    $ python -m pip install gevent 
    Requirement already satisfied: gevent in ./lib/python2.7/site-packages  
    Requirement already satisfied: greenlet>=0.4.10 in ./lib/python2.7/site-packages (from gevent)

    import gevent worked successfully in my Python virtual environment, but it did not work outside of my Python virtual environment until I ran the following command:

    sudo apt install python-gevent # also works in all currently supported versions of Ubuntu 
    

    Description: gevent is a coroutine-based Python networking library. gevent uses greenlet to provide a high-level synchronous API on top of libevent event loop.

提交回复
热议问题