← Back to list

[SOLVED] Colab cannot find an installed a package

Ted James · 2024-04-27 19:34 · 0 claps · 0.4 min read paywalled
#pip #google-colaboratory #apt #fenics
Open on Medium ↗
Wiki topics: 🔬 · Science · General 📊 · Economic Policy

Colab cannot find an installed a package

I’m trying to install a package called fenics in Google Colab.

I tried both:

!pip install fenics

>> fenics in /usr/local/lib/python3.6/dist-packages (2019.1.0)

and

!apt-get install fenics

Then a simple import fenics raises ModuleNotFoundError. Restarting the runtime doesn't solve the problem. Any clues?

Solution

Following the instruction

!apt-get install software-properties-common
!add-apt-repository ppa:fenics-packages/fenics
!apt-get update
!apt-get install --no-install-recommends fenics

Then you can import fenics. Here's the notebook I tested.

Answered By — korakot

Answer Checked By — Pedro (FixIt Volunteer)

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0


메타데이터
post_id
b118d320cbf2
slug
solved-colab-cannot-find-an-installed-a-package-b118d320cbf2
url
https://medium.com/@fixitblog/solved-colab-cannot-find-an-installed-a-package-b118d320cbf2
canonical_url
https://medium.com/@fixitblog/solved-colab-cannot-find-an-installed-a-package-b118d320cbf2
author_url
https://medium.com/@fixitblog
status
ok
fetched_at
2026-07-23 23:41:22