Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colab Problem import repositories (new -- started today) #1875

Closed
davetew opened this issue Feb 24, 2021 · 9 comments
Closed

Colab Problem import repositories (new -- started today) #1875

davetew opened this issue Feb 24, 2021 · 9 comments

Comments

@davetew
Copy link

davetew commented Feb 24, 2021

A new problem developed today when importing a repository in a Colab notebook that I have used many times over the past ~month.

When attempting to import the repository using !apt-add-repository -y ppa:speth/cantera, I get an error message stating that there is an issue related to gi--a python module that seems to be employed by apt-add-repository.

ImportError: cannot import name '_gi' from 'gi' (/usr/lib/python3/dist-packages/gi/__init__.py)

A link to a workbook that contains an example of the problem is below.

Example Notebook

Thank you for any help that you might be able to offer.

Regards,
Dave
PS: The problem occurs in both Safari & Chrome.

@craigcitro
Copy link
Contributor

Thanks for the report -- this was related to the python 3.7 update, and we're working on rolling out a fix already. It should land shortly, but I'll update this issue when it does.

@craigcitro
Copy link
Contributor

Also, as a short-term workaround until the fix is live, you can do

!python3.6 /usr/bin/add-apt-repository ...

and it'll work just as before.

@drew-parsons
Copy link

The most appropriate and simplest fix is to upgrade the Colab host environment from Ubuntu bionic 18.04 to Ubuntu groovy 20.04.

@craigcitro
Copy link
Contributor

This should be fixed -- if you either reconnect or (if you've got a session running) Factory reset runtime, you should once again have a working add-apt-repository.

@davetew
Copy link
Author

davetew commented Feb 25, 2021

Thank you very much. The fix did seem to resolve the issue with add-apt-repository. However, when I try to import the module that is installed from the repository, it fails with a somewhat similar error.

(ModuleNotFoundError: No module named 'cantera._cantera')

_cantera.pxd does indeed seem to be where is should be in /usr/lib/python3/dist-packages/cantera; however, the import fails. This import also worked yesterday (2/23).

A link to an updated workbook with the additional import statement is below
Cantera Notebook

Thanks again for any additional help that you might be able to offer!

Regards,
Dave

@craigcitro
Copy link
Contributor

It looks like the ubuntu installation you're following only works with 3.6, unfortunately.

I don't know anything about cantera; I'd try asking upstream.

@francesco-ballarin
Copy link

The most appropriate and simplest fix is to upgrade the Colab host environment from Ubuntu bionic 18.04 to Ubuntu groovy 20.04.

@drew-parsons @craigcitro I agree with that. Are there any plans to upgrade to 20.04?

@colaboratory-team
Copy link
Contributor

#1880 tracks the 20.04 update.

@davetew
Copy link
Author

davetew commented Jan 10, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants