Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install Google Colab locally

I have been unsucessfully trying to install google-colab on my computer (OS Windows).

The output I have when I run "pip install google-colab" is long but some of the errors that I receive are:

> Building wheel for pandas (setup.py) ... error   ERROR: Command
> errored out with exit status 1:    command:
> 'C:\Users\...\Anaconda3\python.exe' -u -c 'import sys, setuptools,
> tokenize; sys.argv[0] =
> '"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-ifymdm95\\pandas\\setup.py'"'"';
> __file__='"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-ifymdm95\\pandas\\setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d 'C:\Users\...\AppData\Local\Temp\pip-wheel-02i01qsx'

Then after a long error output, the end is:

 Rolling back uninstall of pandas
  Moving to c:\users\...\anaconda3\lib\site-packages\pandas-1.2.0.dist-info\
   from C:\Users\...\Anaconda3\Lib\site-packages\~andas-1.2.0.dist-info
  Moving to c:\users\...\anaconda3\lib\site-packages\pandas\
   from C:\Users\...\Anaconda3\Lib\site-packages\~-ndas
ERROR: Command errored out with exit status 1: 'C:\Users\...\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-ifymdm95\\pandas\\setup.py'"'"'; __file__='"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-ifymdm95\\pandas\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\...\AppData\Local\Temp\pip-record-67jzzkdh\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\...\Anaconda3\Include\pandas' Check the logs for full command output.

Any hint or help would be highly appreciated.

like image 216
Mateo Avatar asked Jan 06 '21 12:01

Mateo


People also ask

Can I install Google colab locally?

Colaboratory lets you connect to a local runtime using Jupyter. This allows you to execute code on your local hardware and have access to your local file system.

How do I mount local drive to Google Colab?

You can either use the upload option at the top of the file-explorer pane to upload any file(s) from your local file system to Colab in the present working directory.

Can we run Google colab offline?

Once you are in your Colab notebook you can use it just like any offline Jupyter notebook.

Can I PIP install in Colab?

Installing a Python package in Google Colab is simple using the pip command along with the exclamation mark (!). The exclamation mark at the start of a cell allows to run a shell command, and pip is the Python package installer that allows to install Python libraries.


Video Answer


1 Answers

From Colab's issues repo, Craig Citro (a software engineer on Google Colab) stated the following

There's no way to run the colab frontend locally.

To note, however, that Colaboratory lets you connect to a local runtime using Jupyter. This allows you to execute code on your local hardware and have access to your local file system (it's a Colab frontend with a local runtime). If that is your goal, here you can find a way to do that.

Setup instructions

In order to allow Colaboratory to connect to your locally running Jupyter server, you'll need to perform the following steps.

Step 1: Install Jupyter Install Jupyter on your local machine.

Step 2: Install and enable the jupyter_http_over_ws jupyter extension (one-time) The jupyter_http_over_ws extension is authored by the Colaboratory team and available on GitHub.

pip install jupyter_http_over_ws
jupyter serverextension enable --py jupyter_http_over_ws

Step 3: Start server and authenticate

New notebook servers are started normally, though you will need to set a flag to explicitly trust WebSocket connections from the Colaboratory frontend.

jupyter notebook \
  --NotebookApp.allow_origin='https://colab.research.google.com' \
  --port=8888 \
  --NotebookApp.port_retries=0

Once the server has started, it will print a message with the initial backend URL used for authentication. Make a copy of this URL as you'll need to provide this in the next step. Step 4: Connect to the local runtime

In Colaboratory, click the "Connect" button and select "Connect to local runtime...". Enter the URL from the previous step in the dialog that appears and click the "Connect" button. After this, you should now be connected to your local runtime.

like image 120
Gonçalo Peres Avatar answered Oct 04 '22 01:10

Gonçalo Peres