How do I install pip modules on google compute engine?

Viewed 11774

I am trying to run some python script using ssh to log into the google compute engine but all the installed pip modules are not found as I do not have permission to the .cache/pip folder in my user is there a correct way to do this?

4 Answers

Use:

sudo apt-get install python3-pip

sudo runs this command as an administrator

apt-get is the standard package manager used on Debian Linux distributions

python3-pip is the package name for pip3

Once installed, you can install PIP modules with:

pip3 install MODULE_NAME

for example:

pip3 install tensorflow

You might want to install some basic libraries first -

  1. sudo apt-get install bzip2 libxml2-dev

Then install miniconda as given by @teoguso and restart your shell

  1. source ~/.bashrc

You can then use conda or pip to install your packages

Related