Manim for Mac

**Update 02/19/20: This post is a little bit out of date with the current Manim library. For additional resources, please see https://repperiumsci.blogspot.com/2019/12/my-adventures-with-manim-part_22.html for additional ways to get Manim working on your computer.  Additionally, I have uploaded the version of Manim (09/18) pertinent to this this tutorial on GitHub. This should have been a fork, but it is what it is…**

The purpose of this post is to give another account of how to get Manim working on a Mac with Python 3.7, nothing more. I spent a few frustrating nights trying to get things to work, and I wanted to add my experiences to the growing resources for Manim. I highly recommend using this post in conjunction with Todd Zimmerman’s blog for learning how to use Grant Sanderson’s code.

I apologize ahead of time for including a lot of the simpler steps, but this post aims to make Manim accessible for someone with no programming background. I think Manim is relatively easy to learn once you have it installed it on your computer, so my hope is that those who don’t have much of a programming background are not inhibited by the frustration of getting this library to work and can focus on making great content.

This process should be relatively straight forward, if followed in order. The general process will involve:

  1. Downloading and installing Homebrew package manager and Python 3.7
  2. Installing necessary packages to your overall system
  3. Downloading and installing MacTex
  4. Cloning the Manim library and creating a virtual environment
  5. Modifying the code
  6. Running tests


_____________________________________________________________________

Step 1: Downloading and Installing Hombrew and Python3

The first thing  that is needed is the package manager Homebrew, which will help us install some packages that pip does not install properly. You can install Homebrew by opening Terminal and running the following line of code:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After Homebrew installed, Python can be installed by running:

brew install python3

If there is any problem during this process, I recommend turning to this video:

Once python is installed, there are a few packages that we need to get. Head back to your Terminal  and run the following lines of code for packages that are needed to install (cairo, pkg-config, virtualenv).

brew install cairo
brew install pkg-config
pip3 install virtualenv

virtualenv is the only package that is absolutely needed prior to getting the Manim library, however I personally had troubles pip3 installing or brew installing the above items into a virtual environment (will get to this later). This is why I recommend installing them directly on to your system before proceeding with the tutorial .

The next step took a lot of trial and error to figure out, especially since there is little documentation on 3b1b’s git hub. Manim uses different sub packages of LaTeX, so “pip3 install latex” may not get all of all of the necessary sub-packages that are needed.  I think the major problem is that many people already had different forms of LaTeX on their computers and so it is difficult to make sure everything is there when you might think you already have everything. After multiple installations and uninstallations, I found that the full installation of MacTex will do the trick, which can be found here:

http://www.tug.org/mactex/mactex-download.html

Make sure you install everything — I tried taking shortcuts several times and it did not end up working.

Now that LaTeX is installed, you can go ahead and start getting the Manim library. It is generally good practice to run projects in a virtual environment, that way you can easily control where all of files and additional packages are installed too. Here are the steps I recommend:

Step 2: Create Folder for Animations

Create the folder you want the Manim library to be stored in. I created a folder called animation in my home directory:

Step 3: Navigating Terminal

Head to the Manim GitHub and grab the URL to clone. Once copied, head to terminal and navigate to the folder you just made. Navigating to the specific folders within Terminal is pretty easy. You can find out what your current directory (current file path) is by typing:

pwd

You can find out what folders are are within your current directory by typing:

ls

and you can change your directory to enter one of those folders by running:

cd folder/subfolder/subsubfolder

Step 4: Clone Manim Respository

Now run the following command in Terminal to clone the Manim repository into your folder:

git clone https://github.com/3b1b/manim.git

Your folder should look something like this now (I renamed the folder to manim37):

Step 5: Set Up Virtual Environment

Now we need to set up a virtual environment. Essentially what this will do is reinstall a separate version of Python3 in the Manim folder. While operating in the virtual environment, you will be able to run Python and install packages to that specific folder rather than to the entire system. These are often used to make sure that specific versions of packages can be maintained on project-by-project basis.

To create a virtual environment, go to Terminal and navigate to the Manim folder. Now go ahead and run the following command into the Terminal:

virtualenv venv

“virtualenv” refers to the package that we installed earlier. “venv” is the name of the folder that you virtual environment will be installed to.

Now if you take a look in your Manim37 folder,  there should be a folder named “venv”. If not, and the “venv” folder ended up somewhere else, you can just click and drag it into the Manim37 folder.

Step 6: Activate Virtual Environment

Now that you have virtual environment set up, you now need to enter from the terminal. Make sure your current working directory is Manim37, and then run:

source venv/bin/activate

Your terminal line will change and “(venv)” will appear at the beginning of the prompt:

Everything you do with Manim will need to be done within this virtual environment, that means installing additional packages, running your animation code, etc.  If you reopen terminal, you will have to activate the virtual environment folder again. You can exit the virtual environment at any time by executing “deactivate“.

Step 7: pip3 install packages

Now we need to get some more packages: sox, ffmepg, latex, pycairo, etc. Go ahead and run each of the following:

pip3 install sox
pip3 install ffmpeg
pip3 install latex
pip3 install pycairo
pip3 install -r requirements.txt

This last line of code will run an install of more packages that are needed. You can take a look at the requirements.txt file within the Manim37 folder to see what exactly is needed, but once this process is done you won’t need any more packages.

Step 8:  Modify Code

Now all of the packages have been downloaded, we can start fixing some of the code to match your computer. The first thing that needs to be done is to add a folder to the Manim37 directory called “output”.

Then we need to change a line of code in the file constants.py located in the Manim37 folder.

Once open, go to line 23 and find the line that says “Dropbox (3Blue1Brown)/3Blue1Brown Team Folder”

We need to change this line to match the output folder you just created. In my case, I replaced that line with “animation/manim37/output”. You should replace it with whatever your file path is (keeping in mind that “~” in the line above is a short for the file path to your home directory).

Step 9: TEST

Now we need to run a quick test to see if some of the animations are working. Still within the virtual environment, run:

python3 extract_scene.py example_scenes.py SquareToCircle -pl

This should pull up QuickTime to run your sample video. If you are having problems at this point, I recommend searching through the issues section of the Manim GitHub.

Step 10: LaTeX

All shapes and animations should be working at this point. However, to get words to work we will need to make a few more modifications to a couple files. These are the changes that worked for me.

Open  utils/tex_file_writing.py and scroll down to the last two functions, and change them so that they look like this (sorry for the screenshot — currently having issues posting the code while maintaining formatting):

The last file that needs to be modified is tex_template.tex.Go ahead and make yours look like:

Step 11: Final Test

Now that those changes have been made, go ahead and try running:

python3 extract_scene.py example_scenes.py WriteStuff -pl

Hopefully all has worked for you!

If there are problems, I recommend posting an issue on 3b1b’s git hub. There are a lot more knowledgeable people there and your chances of fixing a problem are greater with the combined help.

Please comment below for suggestions on how to make this Tutorial more helpful.

43 Replies to “Manim for Mac”

    1. Unfortunately I have yet to go through the install process on Linux. One of these days when I have time, I will sit down and figure out how go through this procedure on Linux and Windows.

      1. Thanks for your consideration. I’ve made it through for my Linux based Ubuntu Operating System. We can make the tutorial together if it’s possible if you provide an email to contact you.

  1. Pretty sure I followed these instructions to the letter. When I got to editing constants.py, I found it was not at the top level, but within the subdirectory manimlib. I edited it all the same.

    When I got to the first test, extract_scene.py was also in manimlib, so I used the command:

    python3 manimlib/extract_scene.py example_scenes.py SquareToCircle -pl

    This failed with:

    Traceback (most recent call last):
    File “manimlib/extract_scene.py”, line 9, in
    from manimlib.scene.scene import Scene
    ModuleNotFoundError: No module named ‘manimlib’

    Any ideas?

    1. Hi Paul,

      It looks as though Manim has been updated since I last installed it. There is now a file called manim.py that seems to run all of the background code needed. In terminal, make sure you are in the root directory (top level) and run:

      python3 manim.py example_scenes.py SquareToCircle -l

      This will create your video in the output file that you made within the manimlib subfolder. Let me know if this works for you. At some point this week I will update the tutorial to match new updates in the software.

      There are also a few more resources that I found. Check out the new README.MD file in the root directory, as well as https://manim.readthedocs.io/en/latest/?badge=latest.

    2. To run the example:
      1) First you need to activate the environment .
      2) change working directory, to your manim directory, eg: cd manim
      3) Run command:
      python3 manimlib/extract_scene.py example_scenes.py SquareToCircle -pl

      instead of python3 manimlib/extract_scene.py example_scenes.py SquareToCircle -pl

      if everything is setup correctly, u will see the video after the process completes.

    3. @Paul Gadiner —

      This is a python specific thing.

      1. When you run `python3 manimlib/extract_scene.py`, the `extract_scene.py` file looks for manimlib in the current directory you’re in.
      2. If it can’t find manimlib in the current directory you’re in, it’ll give you that ModuleNotFound error.

      So, change into the directory above manimlib and run there instead.

    4. I got the same error when running that command in manimlib; Seems one has to run manim commands, not in manimlib, but up one dir in manim.

  2. Thank you for the reply. I did notice, after posting here, that the github readme suggests

    python3 -m manim example_scenes.py SquareToCircle -pl

    and that worked for me. I would have posted a follow up here to save you the trouble of replying but I was confused by my first post not showing immediately and thought it hadn’t been accepted.

    Thank you for this excellent tutorial. It’s got me there, with only a tiny hiccup, where my several previous attempts to install manim have failed.

  3. Getting this error in Step 9, I have followed all the previous steps

    (venv) MacBook-Pro-2:manim AbhilashShukla$ pip3 install ffmpeg
    Requirement already satisfied: ffmpeg in ./venv/lib/python3.7/site-packages (1.4)
    (venv) MacBook-Pro-2:manim AbhilashShukla$ python3 -m manim example_scenes.py SquareToCircle -pl
    /Users/AbhilashShukla 1/Animations/manim/venv/lib/python3.7/site-packages/pydub/utils.py:165: RuntimeWarning: Couldn’t find ffmpeg or avconv – defaulting to ffmpeg, but may not work
    warn(“Couldn’t find ffmpeg or avconv – defaulting to ffmpeg, but may not work”, RuntimeWarning)

    Traceback (most recent call last):
    File “/Users/AbhilashShukla 1/Animations/manim/manimlib/extract_scene.py”, line 153, in main
    scene = SceneClass(**scene_kwargs)
    File “/Users/AbhilashShukla 1/Animations/manim/manimlib/scene/scene.py”, line 54, in __init__
    self.construct()
    File “example_scenes.py”, line 81, in construct
    self.play(ShowCreation(square))
    File “/Users/AbhilashShukla 1/Animations/manim/manimlib/scene/scene.py”, line 448, in wrapper
    self.file_writer.begin_animation(allow_write)
    File “/Users/AbhilashShukla 1/Animations/manim/manimlib/scene/scene_file_writer.py”, line 158, in begin_animation
    self.open_movie_pipe()
    File “/Users/AbhilashShukla 1/Animations/manim/manimlib/scene/scene_file_writer.py”, line 244, in open_movie_pipe
    self.writing_process = subprocess.Popen(command, stdin=subprocess.PIPE)
    File “/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py”, line 775, in __init__
    restore_signals, start_new_session)
    File “/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py”, line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: ‘ffmpeg’: ‘ffmpeg’

    1. Have you found a solution since you posted on Feb. 5?

      I’m getting the same “No such file or directory: ‘ffmpeg’: ‘ffmpeg'” error on a brand new MacBook (Mojave, 10.14.2) even though pip confirms that ffmpeg is installed.

      I suspect it may be related to starting a subprocess. I know there can be issues seeing a virtual environment in a subprocess.

      CONFIRMING ffmpeg:

      pip3 install ffmpeg
      Requirement already satisfied: ffmpeg in /Users/me/.environments/manim/lib/python3.7/site-packages (1.4)

      FULL STACK TRACE

      python3 -m manim example_scenes.py SquareToCircle -pl
      /Users/me/.environments/manim/lib/python3.7/site-packages/pydub/utils.py:165: RuntimeWarning: Couldn’t find ffmpeg or avconv – defaulting to ffmpeg, but may not work
      warn(“Couldn’t find ffmpeg or avconv – defaulting to ffmpeg, but may not work”, RuntimeWarning)

      Traceback (most recent call last):
      File “/Users/me/Code/python3/manim/manimlib/extract_scene.py”, line 153, in main
      scene = SceneClass(**scene_kwargs)
      File “/Users/me/Code/python3/manim/manimlib/scene/scene.py”, line 52, in __init__
      self.construct()
      File “example_scenes.py”, line 81, in construct
      self.play(ShowCreation(square))
      File “/Users/me/Code/python3/manim/manimlib/scene/scene.py”, line 403, in wrapper
      self.file_writer.begin_animation(allow_write)
      File “/Users/me/Code/python3/manim/manimlib/scene/scene_file_writer.py”, line 158, in begin_animation
      self.open_movie_pipe()
      File “/Users/me/Code/python3/manim/manimlib/scene/scene_file_writer.py”, line 244, in open_movie_pipe
      self.writing_process = subprocess.Popen(command, stdin=subprocess.PIPE)
      File “/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py”, line 775, in __init__
      restore_signals, start_new_session)
      File “/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py”, line 1522, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: ‘ffmpeg’: ‘ffmpeg’

      1. I fixed it for my installation with:

        brew install ffmpeg

        ffmpeg is listed as a prerequisite on the main README page of manim, so I should have done this ahead of time. (And it had nothing to do with subprocesses.)

        Good luck!

    2. I had the same problem. For simplicity, you first might want to try Homebrew’s ffmpeg.

      I ended up building ffmpeg from sources and installing it in the default location chosen by ‘configure’. That solved the “ffmpeg not found” PATH issue, but the default ./configure build was missing libx264

      In short, the following FIX (see Stack Overflow) link worked for me:

      **FIX** for: Unknown encoder ‘libx264’
      https://stackoverflow.com/questions/9764740/unknown-encoder-libx264

      For x264 :
      git clone git://git.videolan.org/x264.git
      cd x264
      ./configure –enable-static –enable-shared
      make -j8
      sudo make install

      For ffmpeg:
      rebuild with this configure
      ffmpeg-4.2.1> ./configure –enable-gpl –enable-libfreetype –enable-libx264 –enable-shared –enable-nonfree
      make -j8
      sudo make install

      Good luck.

  4. I successfully installed manim on Debian9. Here is the procedure:
    1) First install miniconda/anaconda

    Now using terminal:
    2) create virtual environment using conda create –name manim python through terminal. here manim is the virtual environment name.
    3) Now run command: git clone https://github.com/3b1b/manim.git. It will create manim folder in your home directory.
    4) Now activate the manim environment: conda activate manim ; It will show manim before your username in terminal, which means manim environment is activated.
    5) Next run command: pip install -r /home/user/manim/requirements.txt ; Here user is the name of user account in which you are currntly logged in. So replace user with your username.
    6) After successfully installing all the requirements, run:
    cd manim ; to change your current working directory to manim
    7) now run example using:
    python3 -m manim example_scenes.py SquareToCircle -pl

    if you see the video after process completion of the command, then u have successfully install manim.

      1. this website is replacing “– ” with “-“. So modify the command accordingly, if u get the error while running commands.

  5. Great! Thanks Brian!
    Steps 1 to 9 worked well for me on macOS 10.14.3.

    I struggled a little with this issue though: a had a previous version of cairo installed (1.12.16), and pkg-config was only detecting this one. So I kept getting the following error message when trying to install pycairo via “pip3 install pycairo”:

    Requested ‘cairo >= 1.13.1’ but version of cairo is 1.12.16
    Command ‘[‘pkg-config’, ‘–print-errors’, ‘–exists’, ‘cairo >= 1.13.1′]’ returned non-zero exit status 1.

    —————————————-
    Command “/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c “import setuptools, tokenize;__file__=’/private/var/folders/2j/k9hmz3dj03z1rrl5r1nd3yyh0000gn/T/pip-install-0htr7o6t/pycairo/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, __file__, ‘exec’))” install –record /private/var/folders/2j/k9hmz3dj03z1rrl5r1nd3yyh0000gn/T/pip-record-90mlnpks/install-record.txt –single-version-externally-managed –compile” failed with error code 1 in /private/var/folders/2j/k9hmz3dj03z1rrl5r1nd3yyh0000gn/T/pip-install-0htr7o6t/pycairo/

    This was resolved by first finding the correct cairo.pc file:
    find /usr -name cairo.pc

    then by redefining the PKG_CONFIG_PATH:
    export PKG_CONFIG_PATH=/usr/local/Cellar/cairo/1.16.0/lib/pkgconfig

  6. I’m trying to execute different animations like the ones in old_projects but the following error appears every time:

    ModuleNotFoundError: No module named ‘big_ol_pile_of_manim_imports’

    Any advice?

  7. Thank you very much for this tutorial !
    My problem is that I have an error when I want to install pycairo.
    I have this error message :
    Collecting pycairo
    Using cached https://files.pythonhosted.org/packages/a6/54/23d6cf3e8d8f1eb30e0e58f171b6f62b2ea75c024935492373639a1a08e4/pycairo-1.18.0.tar.gz
    Building wheels for collected packages: pycairo
    Building wheel for pycairo (setup.py) … error
    Complete output from command /Users/cusset/Animation/manim/venv/bin/python -u -c “import setuptools, tokenize;__file__=’/private/var/folders/2s/v1d3n29s77db0590732lvcgr0000gn/T/pip-install-e0qeh4zm/pycairo/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, __file__, ‘exec’))” bdist_wheel -d /private/var/folders/2s/v1d3n29s77db0590732lvcgr0000gn/T/pip-wheel-96i_cait –python-tag cp37:
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.7
    creating build/lib.macosx-10.7-x86_64-3.7/cairo
    copying cairo/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/cairo
    copying cairo/__init__.pyi -> build/lib.macosx-10.7-x86_64-3.7/cairo
    copying cairo/py.typed -> build/lib.macosx-10.7-x86_64-3.7/cairo
    running build_ext
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc’
    to the PKG_CONFIG_PATH environment variable
    Package ‘libffi’, required by ‘gobject-2.0’, not found
    Command ‘[‘pkg-config’, ‘–print-errors’, ‘–exists’, ‘cairo >= 1.13.1′]’ returned non-zero exit status 1.

    —————————————-
    Failed building wheel for pycairo
    Running setup.py clean for pycairo
    Failed to build pycairo
    Installing collected packages: pycairo
    Running setup.py install for pycairo … error
    Complete output from command /Users/cusset/Animation/manim/venv/bin/python -u -c “import setuptools, tokenize;__file__=’/private/var/folders/2s/v1d3n29s77db0590732lvcgr0000gn/T/pip-install-e0qeh4zm/pycairo/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, __file__, ‘exec’))” install –record /private/var/folders/2s/v1d3n29s77db0590732lvcgr0000gn/T/pip-record-2n2kioo6/install-record.txt –single-version-externally-managed –compile –install-headers /Users/cusset/Animation/manim/venv/include/site/python3.7/pycairo:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.7
    creating build/lib.macosx-10.7-x86_64-3.7/cairo
    copying cairo/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/cairo
    copying cairo/__init__.pyi -> build/lib.macosx-10.7-x86_64-3.7/cairo
    copying cairo/py.typed -> build/lib.macosx-10.7-x86_64-3.7/cairo
    running build_ext
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc’
    to the PKG_CONFIG_PATH environment variable
    Package ‘libffi’, required by ‘gobject-2.0’, not found
    Command ‘[‘pkg-config’, ‘–print-errors’, ‘–exists’, ‘cairo >= 1.13.1′]’ returned non-zero exit status 1.

    —————————————-
    Command “/Users/cusset/Animation/manim/venv/bin/python -u -c “import setuptools, tokenize;__file__=’/private/var/folders/2s/v1d3n29s77db0590732lvcgr0000gn/T/pip-install-e0qeh4zm/pycairo/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, __file__, ‘exec’))” install –record /private/var/folders/2s/v1d3n29s77db0590732lvcgr0000gn/T/pip-record-2n2kioo6/install-record.txt –single-version-externally-managed –compile –install-headers /Users/cusset/Animation/manim/venv/include/site/python3.7/pycairo” failed with error code 1 in /private/var/folders/2s/v1d3n29s77db0590732lvcgr0000gn/T/pip-install-e0qeh4zm/pycairo/

    Any idea (I am rather new to programming…) ?

    1. @Pierre-yves — I just fixed this, actually.

      When you call `brew install libffi`, you’ll see something that says:

      `
      For compilers to find libffi you may need to set:
      export LDFLAGS=”-L/usr/local/opt/libffi/lib”

      For pkg-config to find libffi you may need to set:
      export PKG_CONFIG_PATH=”/usr/local/opt/libffi/lib/pkgconfig”
      `

      So, run those commands:
      export LDFLAGS=”-L/usr/local/opt/libffi/lib”
      export PKG_CONFIG_PATH=”/usr/local/opt/libffi/lib/pkgconfig”

      you might also need to put these commands into your ~/.bashrc file, or else they won’t be there permanently the next time you close the command line.

      1. Thank you !
        Actually, I followed an advice close to yours given to me on the github page of Manim and I ran the command :
        export PKG_CONFIG_PATH=”${PKG_CONFIG_PATH}:/usr/local/opt/libffi/lib/pkgconfig”
        And it worked (Pycairo installed successfully)
        PS : After that, I had a problem making th example work : I had an error message signaling a missing ffpmeg (even though I had it pip3 installed). I had to “brew install” ffmpeg, and after that, it worked just fine. I understand that brew installing means intalling globally, not just in the virtual environment, am I right ? Anyway, if someone has this problem, it is something that can help.
        Thanks again for your reply.

  8. Man, thank you very much for your help and to the people who wrote comments here too,
    keep up with the good work.

  9. thank you very much.for me ,below is ok :

    python3 -m manim example_scenes.py SquareToCircle -pl
    python3 -m manim example_scenes.py WriteStuff -pl

    python3 manim.py example_scenes.py SquareToCircle -l
    python3 manim.py example_scenes.py WriteStuff -pl

    but when I run:
    python3 manimlib/extract_scene.py example_scenes.py SquareToCircle -pl

    I got a error message:

    Traceback (most recent call last):
    File “manimlib/extract_scene.py”, line 163, in
    main()
    TypeError: main() missing 1 required positional argument: ‘config’

  10. The first test gives me this error does anyone know how to fix it.
    (venv) Samuels-MBP:manim Sam$ python3 manimlib/extract_scene.py example_scenes.py SquareToCircle -pl
    Traceback (most recent call last):
    File “manimlib/extract_scene.py”, line 9, in
    from manimlib.scene.scene import Scene
    ModuleNotFoundError: No module named ‘manimlib’
    (venv) Samuels-MBP:manim Sam$ pwd
    /Users/Sam/Documents/Freizeit/python/animation_with_manim/manim
    (venv) Samuels-MBP:manim Sam$

    Thanks

  11. (venv) TYLORGAN-MB0:manim37 omen$ pip3 install pycairo
    Collecting pycairo
    Using cached https://files.pythonhosted.org/packages/48/20/5e83af98eb897935bf7dc39455e892ba866feebb9b7c3b392982866f9958/pycairo-1.18.1.tar.gz
    Building wheels for collected packages: pycairo
    Building wheel for pycairo (setup.py) … error
    ERROR: Command errored out with exit status 1:
    command: /Users/omen/OneDrive/manim37/venv/bin/python3.7 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘/private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-install-xgolj3k_/pycairo/setup.py'”‘”‘; __file__='”‘”‘/private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-install-xgolj3k_/pycairo/setup.py'”‘”‘;f=getattr(tokenize, ‘”‘”‘open'”‘”‘, open)(__file__);code=f.read().replace(‘”‘”‘\r\n'”‘”‘, ‘”‘”‘\n'”‘”‘);f.close();exec(compile(code, __file__, ‘”‘”‘exec'”‘”‘))’ bdist_wheel -d /private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-wheel-jx43bzh7 –python-tag cp37
    cwd: /private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-install-xgolj3k_/pycairo/
    Complete output (15 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/cairo
    copying cairo/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/cairo
    copying cairo/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.7/cairo
    copying cairo/py.typed -> build/lib.macosx-10.9-x86_64-3.7/cairo
    running build_ext
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc’
    to the PKG_CONFIG_PATH environment variable
    Package ‘libffi’, required by ‘gobject-2.0’, not found
    Command ‘[‘pkg-config’, ‘–print-errors’, ‘–exists’, ‘cairo >= 1.13.1′]’ returned non-zero exit status 1.
    —————————————-
    ERROR: Failed building wheel for pycairo
    Running setup.py clean for pycairo
    Failed to build pycairo
    Installing collected packages: pycairo
    Running setup.py install for pycairo … error
    ERROR: Command errored out with exit status 1:
    command: /Users/omen/OneDrive/manim37/venv/bin/python3.7 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘/private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-install-xgolj3k_/pycairo/setup.py'”‘”‘; __file__='”‘”‘/private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-install-xgolj3k_/pycairo/setup.py'”‘”‘;f=getattr(tokenize, ‘”‘”‘open'”‘”‘, open)(__file__);code=f.read().replace(‘”‘”‘\r\n'”‘”‘, ‘”‘”‘\n'”‘”‘);f.close();exec(compile(code, __file__, ‘”‘”‘exec'”‘”‘))’ install –record /private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-record-4qh3nv1b/install-record.txt –single-version-externally-managed –compile –install-headers /Users/omen/OneDrive/manim37/venv/bin/../include/site/python3.7/pycairo
    cwd: /private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-install-xgolj3k_/pycairo/
    Complete output (15 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/cairo
    copying cairo/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/cairo
    copying cairo/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.7/cairo
    copying cairo/py.typed -> build/lib.macosx-10.9-x86_64-3.7/cairo
    running build_ext
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc’
    to the PKG_CONFIG_PATH environment variable
    Package ‘libffi’, required by ‘gobject-2.0’, not found
    Command ‘[‘pkg-config’, ‘–print-errors’, ‘–exists’, ‘cairo >= 1.13.1′]’ returned non-zero exit status 1.
    —————————————-
    ERROR: Command errored out with exit status 1: /Users/omen/OneDrive/manim37/venv/bin/python3.7 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘/private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-install-xgolj3k_/pycairo/setup.py'”‘”‘; __file__='”‘”‘/private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-install-xgolj3k_/pycairo/setup.py'”‘”‘;f=getattr(tokenize, ‘”‘”‘open'”‘”‘, open)(__file__);code=f.read().replace(‘”‘”‘\r\n'”‘”‘, ‘”‘”‘\n'”‘”‘);f.close();exec(compile(code, __file__, ‘”‘”‘exec'”‘”‘))’ install –record /private/var/folders/r2/4gmx13td7x1cb973kdr7rncw0000gn/T/pip-record-4qh3nv1b/install-record.txt –single-version-externally-managed –compile –install-headers /Users/omen/OneDrive/manim37/venv/bin/../include/site/python3.7/pycairo Check the logs for full command output.

  12. Hi,

    When I run this “pip3 install -r requirements.txt” , there is some error.
    “ERROR: Could not find a version that satisfies the requirement opencv-python==3.4.2.17 (from -r requirements.txt (line 8)) (from versions: none)
    ERROR: No matching distribution found for opencv-python==3.4.2.17 (from -r requirements.txt (line 8))”
    I don’t know how to fix it.

  13. Great set up guide.

    Just a note, however: my Nov. 2019 GitHub clone version of manim works fine without Step 10 and does not work with it — at least with Step 10 as posted.

    Also, MacTeX’s “latex” command is not found without adding it post Mac 10.11 + location ( ‘/Library/Tex/texbin’ ) to the PATH.
    https://tex.stackexchange.com/questions/38627/commands-paths-in-texstudio-on-mac-os-x-with-could-not-start-the-command-err

    Old paths in /usr are not valid anymore in OS X 10.11+. All paths starting with /usr/texbin/ should be changed to /Library/TeX/texbin/

  14. Well! What a struggle to get this working! Not helped by my unfamiliarity with Python, working with Mac Terminal, and the impact of Catalina on nearly everything.
    But in the end it worked.
    Many thanks.

  15. Unfortunately, the LaTex portion of this tutorial does not work. I’m on Mac and everything seems to have installed correctly, although I get the error:

    “LaTeX Error: Option clash for package inputenc”

    when I run any LaTex commands in my python files. Does anyone know how to fix this?

  16. Thanks a lot for the tutorial, it really is a massive help to a software noob:)
    However I’ve ran into a wall in Step 9, when I try to run the example scene- it says manim cannot be directly executed. Any ideas on how to make it work?

    python3 -m manim example_scenes.py SquareToCircle -pl
    /Users/—-/Documents/manim/venv/bin/python3: No module named manim.__main__; ‘manim’ is a package and cannot be directly executed

  17. Hello,
    I’m using pydroid3 on android for python stuff.
    Is there any way of installing and running mamin packages on android device?

  18. Traceback (most recent call last):
    File “extract_scene.py”, line 9, in
    from manimlib.scene.scene import Scene
    ModuleNotFoundError: No module named ‘manimlib’
    can someone help me with any suggestions? Thanks

  19. Thank you for this very helpful tutorial. I used MacPorts. While I ran into many errors along the way, all of them seemed to be resolved by downloading additional packages and making sure to download everything through MacPorts except the huge LaTex package.

Leave a Reply

Your email address will not be published. Required fields are marked *