How do I install Python packages in Google's Colab?

前端 未结 5 2008
南方客
南方客 2020-12-22 19:23

In a project, I have e.g. two different packages, How can I use the setup.py to install these two packages in the Google\'s Colab, so that I can import the packages?

5条回答
  •  借酒劲吻你
    2020-12-22 19:50

    Joining the party late, but just as a complement, I ran into some problems with Seaborn not so long ago, because CoLab installed a version with !pip that wasn't updated. In my specific case, I couldn't use Scatterplot, for example. The answer to this is below:

    To install the module, all you need is:

    !pip install seaborn
    

    To upgrade it to the most updated version:

    !pip install --upgrade seaborn
    

    If you want to install a specific version

    !pip install seaborn==0.9.0
    

    I believe all the rules common to pip apply normally, so that pretty much should work.

提交回复
热议问题