Using Anaconda in Blender16 Sep 2017
Sometimes you need other packages when scripting in Blender. Blender already includes Numpy in its newer versions out of the box which is quite handy. However I often have the need to install new packages to use for my own scripts and add-ons. There is also a way to use an already installed version of Anaconda which I’ll show in this post. It worked for me for Blender 2.77 and 2.79 on Windows.
Anaconda is a package manager and Python distribution which simplifies installing new packages for Python and has many useful packages pre-installed, which is especially useful when working with Windows where some packages are sometimes troublesome to install.
- First step is to install Anaconda and Blender. I use Anaconda3 x64 and Blender 2.79 x64.
- Then create a Python 3.5 environment with Anaconda by using the command
conda create -n py35 python=3.5 anaconda. I compiled some tipps on virtual environments in Anaconda in this post.
- Rename the folder of the Blender Python environment
C:\Program Files\Blender Foundation\Blender\2.79\pythonto something different like
- Finally you can either copy the contents of the folder
C:\Program Files\Blender Foundation\Blender\2.79\pythonor alternatively you can use a link to the Anaconda folder. To create a link make sure to run the console as administrator and then create a hard link to a directory by running
C:\Program Files\Blender Foundation\Blender\2.79>mklink /j python C:\Anaconda3\envs\py3
After these steps try to import the packages included in the Anaconda packages (e.g.
import scipy) and the Blender packages (e.g.
import bmesh) inside the Python console in Blender or the text editor. If this works, you should be able to use every python module available through the Anaconda environment and also install new packages when needed.