Platform: GCP ✅

Hi I’ve updated fastai but juypter can’t find download_images

I’ve noticed when I go to the conda tab, I get this error.

EnvironmentLocationNotFound: Not a conda environment: /home/jupyter/.conda/envs/anaconda3

Hi hanqi,
No need for these two commands, as no terminal is being created on your local machine.
I am on Windows 7 also and the commands at this link (https://arunoda.me/blog/ideal-way-to-creare-a-fastai-node) work just fine to get Jupyter - along with the fastai ecosystem - running on a remote server.
Need to type the commands directly into the Google cloud shell (https://cloud.google.com/shell/)

2 Likes

Thanks for this offer and appreciate your intent to help us to learn!! I have filled up the form…

Has anyone enabled jupyter mb extensions in this setup. If yes, it will be great if you could share how to do that.

Try to set up an individual account in non-European location. You can set up an instance in Europe no matter which location you choose.

Yeah, I’ve had limited success running sudo /opt/anaconda3/bin/pip install jupyter_contrib_nbextensions from ssh. I’m having trouble with enabling the gist it extension tho.

Got nbextensions and Gist-it working on GCP in the end via ssh as the jupyter user:

  1. uninstalling both jupyter_contrib_nbextensions and jupyter-nbextensions-configurator both via conda and pip
  2. sudo /opt/anaconda3/bin/pip install --upgrade pip
  3. sudo /opt/anaconda3/bin/pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master
  4. jupyter contrib nbextension install --user
  5. Reboot the instance and ssh back in
  6. sudo jupyter nbextension install gist_it
  7. sudo jupyter nbextension enable gist_it

After this, reloading http://localhost:8080/tree#nbextensions_configurator showed Gist-it as correctly installed and opening a notebook showed the gist icon.

3 Likes

The sudo shouldn’t be necessary AFAIK, since you should always be ssh’ing in as the jupyter user (at least, that’s what our setup docs suggest).

I’d tried a few different ways to resolve my previously failed install and not sure what state my instance was in @Jeremy, so you may be right (YMMV folks!).

That said, it wasn’t working without sudo for me:

jupyter@my-fastai-instance:~$ jupyter nbextension install gist_it
Copying: gist_it -> /usr/local/share/jupyter/nbextensions/gist_it
Traceback (most recent call last):
  File "/opt/anaconda3/bin/jupyter-nbextension", line 11, in <module>
    sys.exit(main())
  File "/opt/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/anaconda3/lib/python3.6/site-packages/notebook/nbextensions.py", line 988, in start
    super(NBExtensionApp, self).start()
  File "/opt/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 255, in start
    self.subapp.start()
  File "/opt/anaconda3/lib/python3.6/site-packages/notebook/nbextensions.py", line 716, in start
    self.install_extensions()
  File "/opt/anaconda3/lib/python3.6/site-packages/notebook/nbextensions.py", line 695, in install_extensions
    **kwargs
  File "/opt/anaconda3/lib/python3.6/site-packages/notebook/nbextensions.py", line 199, in install_nbextension
    _maybe_copy(src, full_dest, logger=logger)
  File "/opt/anaconda3/lib/python3.6/site-packages/notebook/nbextensions.py", line 1046, in _maybe_copy
    shutil.copy2(src, dest)
  File "/opt/anaconda3/lib/python3.6/shutil.py", line 257, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/opt/anaconda3/lib/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'gist_it'
jupyter@my-fastai-instance:~$ sudo jupyter nbextension install gist_it

Making directory: /usr/local/share/jupyter/nbextensions/gist_it/

Copying: /opt/anaconda3/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/gist_it/readme.md -&gt; /usr/local/share/jupyter/nbextensions/gist_it/readme.md

Copying: /opt/anaconda3/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/gist_it/icon.png -&gt; /usr/local/share/jupyter/nbextensions/gist_it/icon.png

Copying: /opt/anaconda3/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/gist_it/gist_it.yaml -&gt; /usr/local/share/jupyter/nbextensions/gist_it/gist_it.yaml

Copying: /opt/anaconda3/lib/python3.6/site-packages/jupyter_contrib_nbextensions/nbextensions/gist_it/main.js -&gt; /usr/local/share/jupyter/nbextensions/gist_it/main.js

To initialize this nbextension in the browser every time the notebook (or other app) loads:

jupyter nbextension enable &lt;the entry point&gt;
jupyter@my-fastai-instance:~$

hey … thanks a ton… I got a mail confirming the coupon. Really appreciate your time and thoughtfulness!!
Regards

Yeah if your first login was not using jupyter user then your instance is in an odd state forever more.

1 Like

For any one trying to get a VNC going on GCP instance .Below link should help.


Only change is once you have VNC up and running ssh into the corresponding port and you are good to go.

2 Likes

Does anyone know how to download the files that are in the .fastai/models folder to your Windows PC?

If you want something with a gui on windows check out WinSCP. Has kind of an explorer/commander interface. Connect to server using ssh credentials.

You can also use scp on windows in the commandline, using cygwin or on win10 ubuntu bash.

1 Like

I have created a new instance since the old one, which I successfully used last week didn’t connect. After creating instance and using the
“gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME – -L 8080:localhost:8080” (have specified a new zone here, since the old instance it asked me to try a different zone ), it’s connected.
Now when I use [localhost:8080/tree] to access notebooks, it shows connection refused error.
Can anyone help me with this?

Thanks.

I am having this error when i try to starting my instance.

Error: The zone ‘projects/fast-ai-217410/zones/us-west1-b’ does not have enough resources available to fulfill the request. Try a different zone, or try again later.

I wonder if it is related with preemptible choice. I am going to try again tomorrow early hours. I would appreciate if anyone have any advice regarding this issue.

Thank you for the kind offer.

1 Like

I had the same error, I created another instance with a different zone and it worked for me, since I was not able to find a way to change default zone in the already created instance, if you can find that, please let me know if not I suggest create another instance with a different zone.

1 Like

What host name and port do you use?

I don’t use it, because I am not on windows. :wink: But I have used winscp extensively in former jobs when I had to use windows
But hostname will be the public ip adress, port should be 22. Re password, this depends how your instance was set up. Chances are you don’t have a password, you will have to use the ssh key generated for your instance before (or create a new one). How to do this with gcp is here: https://winscp.net/eng/docs/guide_google_compute_engine. But I have not tried myself, so I don’t know whether this is 100% compatible with the setup of the fastai image or whether you have to make some adjustments to it.