Computational Electromagnetics with MEEP Part 1: Getting Started

Lesson 1: Getting Started


Installing Python, Anaconda

If you haven't done so already, you will need to install python. There's a huge number of tutorials available on the web, but since we will subsequently be using miniconda to install MEEP, I suggest downloading and installing Miniconda, The Conda Website. If you already have python installed (you are on a mac or linux machine), you will want to do this anyway because we will be installing MEEP through anaconda.

Installing MEEP

Once that is done, you will need to install MEEP. The instructions for that can be found here: MEEP Installation. I followed the instructions under the "Conda Packages" section. Since I am on a mac, I ran into the problem that I already have a version of python installed, and so I had to make sure that I was using the python bundled with miniconda.

Troubleshooting

Q: I am getting "ImportError: No module named meep" when I follow the instructions.
A: I ran into this problem. This is probably because you are using a different version of python to try and import meep than the one that came with miniconda. Try running "which python" if you are on a linux / OS X machine to make sure that the python version you are running is inside a folder with the name "miniconda" in it. If not, you will need to find that version of python and use that. On windows, you should just be able to open up the miniconda program and everything should just work. A: It's also possible you restarted your terminal, and you might need to run 'conda activate mp' again.

All Done!

That may or may not have been pretty painful, depending on your background. Fear not, we can now get started doing some simulations..

A quiz question






If you found this content helpful, it would mean a lot to me if you would support me on Patreon. Help keep this content ad-free, get access to my Discord server, exclusive content, and receive my personal thanks for as little as $2. :)

Become a Patron!