no module named gevent even though it is installed

前端 未结 2 1886
再見小時候
再見小時候 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:52

    make sure that your pip references the same python that you are using, on many systems you can have multiple python versions installed. you can see which to which python your pip belongs by running:

    pip --version
    
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题