0

I just got Jupyter running in python 3 on Google Cloud but I have a lot of trouble getting the libraries installed while working on a tutorial online. How exactly am I supposed to install libraries on the cloud Vm?(Numpy, mathplotlib) I tried using !pip install numpy and even the jupyter terminal to install libraries but noting seems to work. I even tried installing before I got the server running in the SSH because after it starts I dont have any control to do anything beside exit the server. I really need some python libraires can anyone help?

ImportError                               Traceback (most recent call last)
<ipython-input-7-cdbc221dd3db> in <module>()
      1 import numpy as np
----> 2 import matplotlib.pyplot as plt
      3 from sklearn.datasets import load_digits
      4 digits=load_digits()
      5 import pylab as pl

ImportError: No module named matplotlib.pyplot
Chinmay Gopal
  • 59
  • 1
  • 6
  • When are you getting this error? Meantime, I have researched and found this [page](https://stackoverflow.com/questions/18176591/importerror-no-module-named-matplotlib-pyplot), might be helpful – Shafiq I May 03 '20 at 23:57
  • After I get the Vm instance working well I succesfully got Jupyter running on that VM. Everything works except that i cant seem to import any libraries. How exactly do people import libraries in Jupyter on the cloud? – Chinmay Gopal May 04 '20 at 07:49

1 Answers1

0

You can install dependencies on your Jupyter Notebooks by following this doc.

You can choose one of these options:

  • Run %pip install LIBRARY in a Notebook's cell and restart the AI Platform Notebook's Kernel. Doing this will allow you to the import and use the "LIBRARY" in your code.

  • Run pip install LIBRARY from a Jupyter Notebook's terminal. This way is the most similar as installing the libraries on your local computer.

In the provided doc, you will find how to reach the terminal or how to restart your AI Platrofm Notebook's kernel.

Hope this is helpful! :)

Kevin Quinzel
  • 1,430
  • 1
  • 13
  • 23