Google Colab Unrecognized Runtime - python

This might be a dumb question but I'm using Google Colab to host notebooks for my students. I create the notebooks in a local Anaconda Python 3 environment, and when I upload them to Google Colab this warning pops up:
I know that it won't cause problems, and the notebook will run just fine. But is there a way to change the the notebook runtime to Python 3 so my students don't see this message and panic?

You can open the notebook with a text editor. It's just a json file.
You can edit it, change conda-env-py3-py to python3

Related

Can i work locally on VS Code with a virtual environment while ssh'ed to google colab

I want to know if it's possible to work in a virtual environment while ssh'ed to google colab. I tried ssh'ing to google colab and did it but when I was going to code a .ipynb file I needed to select the kernel and when I tried selecting the one from my Conda Virtual Environment it did nothing. Wanted to know if it's possible or if I did something wrong. If you know some guide or video that teaches how to do this link it if possible, I already searched but found nothing. Thanks
After ssh'ing to google colab i tried inserting my conda env kernel in the VS Code kernel button but it did nothing so i couldn't run my .ipynb file
I'm not sure if it helps, but if you want to work on a running Jupyter server using VScode, you need to connect to that remote jupyter server.
Here's the link to doc https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_connect-to-a-remote-jupyter-server
But also I'm not sure if collab supports plugins which vscode needs to install to run Jupyter remotely. But you should definitely try and install the Jupyter add-on first.

How to run GitHub project in a Jupyter Notebook?

I try to run this code in my own computer: https://github.com/ThaiPham27/Depression_Detection_DNN
I've downloaded the zip file but I have no idea how can I run this code in Jupyter notebook and get the output. I couldn't find any complete guide for that.\
I have Python 3.9 on Windows 10.
you can only run notebook file on Jupyter Notebook, and the extension of notebook files is ".ipynb"
And you need to have jupyter notebook on your system, or you can download Anaconda package for that.
P.S: I also briefly looked into the notebook, seems like it was setup for Google Colab as it is using some CSV from google drive.

Share with anyone on the web interactive python jupyter notebook with dependent files and functions in another file (.py): Colab or something else?

What are the free solutions for sharing an interactive python Jupyter notebook with user-defined module and dependent input files?
I have python Jupyter notebook that serves as a code interface for non-technical users. The code itself is in another file code.py that contains many functions that are called from the python Jupyter notebook as needed. Running these functions reqires about ten input files with a size of 100 mb. I want anyone on the web to open this notebook in an executable environment such that the user can run the code with different user choices.
One approach I consider implementing is to use Google Colab, Google Drive, GitHub, and
the Python Package Index (PyPI) as follows:
Package the code.py as PyPI module
Add dependent input files on Google Drive and get their shared link id
Add Colab notebook on GitHub
Once the user run the Colab notebook then it will pip install and import the functions on code.py and download the dependent input files from Google Drive
How to improve or simplify this approach?
What would be a better Colab-based approach to do this job?
Is there any other environments (e.g., Binder) that are more suitable than Colab for this job ?
You can use MyBinder.org and use curl or wget in a postBuild or start configuration file to get your input files if they are elsewhere.
For non-technical users you may want to combine in the use of Voila and myBinder.org. See here about Voila. There's a launch binder badge you can use to demo there. There's a bunch of other examples that run on MyBinder at the Voila Gallery, too.

How to print an item in PyCharm without print function as Colab?

I'm testing codes from Colab, where you can just show the result without using print function, such as:
df.Quantity.dtypes
but in PyCharm, you have to run as the following to show the result:
print(df.Quantity.dtypes)
It's really time consuming if such commands are frequent.
How could I print out without using print functin in PyCharm just as Colab?
Thanks a lot!
You would have to create a Jupyter notebook, but note that this is a Professional feature, which means this won't work in PyCharm Community Edition.
Here's how to do it:
Create a new Python project, specify a virtual environment, and install the jupyter package.
Open or create an .ipynb file.
Add and edit source cells.
Execute any of the code cells to launch the Jupyter server.
More on PyCharms Jupyter features can be found here.
As an alternative, you could you the Python Console. Take a look at this question to learn more.

Ipython installation - creating nbserver profile - missing notebook_config.py file

I am trying to use the guidance on http://www.slideshare.net/fullscreen/randyzwitch/ipython-ec2/12 to install public Ipython notebooks in an AWS instance. One problem that i encounter is, when i try to create a profile, i do not not observe the creation of an ipython_notebook_config_py file (as explained in the tutoral, as per the screenshot), but i only get a ipython_kernel_config.py file, which has very different contents, and cannot be edited in the way as explained in the tutoral. Can someone help me to understand why this happens, and what i should do subsequently? Many thanks.
The notebook server is no longer part of IPython; it's a separate Jupyter project, which has its own config directory ~/.jupyter. The config file for the notebook server is ~/.jupyter/jupyter_notebook_config.py. You can use this to configure the notebook server. If you want to keep multiple configurations of the notebook server, you can use the environment variable JUPYTER_CONFIG_DIR to specify that a different directory should be used:
JUPYTER_CONFIG_DIR=~/jupyter_nbserver jupyter notebook
Note: IPython has not lost its profiles or config files, so ~/.ipython/profile_default/ipython_config.py and startup files, etc. continue to work as before for configuring the IPython kernel, just not the notebook server itself.
References:
Running a public notebook server
Jupyter configuration
Migration from IPython to Jupyter

Categories

Resources