0

In the past I have installed the pymeep package in Google Colab with the following cell:

!wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!bash ./Miniconda3-latest-Linux-x86_64.sh -b -p ./anaconda
import os
os.environ['PATH'] += ":/content/anaconda/bin"
!conda create -n mp -c conda-forge pymeep
import sys
sys.path.append('/content/anaconda/envs/mp/lib/python3.7/site-packages/') 

Which is an exact copy from this website: https://rf5.github.io/2019/12/22/meep-intro.html

Sometimes the code I wrote doesn't work. It executes without errors, but when I try to execute import meep as mp. I get the following error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-f30f3b609667> in <module>()
----> 1 import meep

ModuleNotFoundError: No module named 'meep'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Is there a better way of installing meep or rather pymeep in Google Colab?

1 Answer 1

0

Replace 3.7 with 3.8 as the latest python version installed using conda is 3.8

sys.path.append('/content/anaconda/envs/mp/lib/python3.8/site-packages/') 

Example

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.