On any operating system, I want to recommend download of standalone Blender instead of using the installer. The installer tries to copy the executable and necessary libraries at locations that need super privileges to make any changes. These situations can be avoided if you are running from a stand-alone Blender instance.
One hiccup when using a standalone Blender is that the bundled python usually lacks “
- On windows use Conda environment for Blender
- Ubuntu and Mac, install the python interpreter Blender needs
- or empower Blender’s bundled python
What I will discuss here is the 3rd option of empowering the Blender’s bundled python by adding distutils and setuptools. This way you don’t have to worry about downloading the huge anaconda setup for windows or go through a possible headache of compiling python from source for other systems. On Ubuntu you have the deadsnakes ppa but again this comes only with the dev packages and the interpreter itself. For the pip tools you have to manually do the get-pip.py step to install the required empowering tools. Rather this same idea of get-pip.py can be used to fix the bundled python of Blender.
First of all download the zipped or tarball of standalone Blender and unzip it to the location of your choice. Once you have downloaded and extracted it a location you should find the Blender folder with the much needed files and sub-folders inside it. Let us by an example to understand this better. If the choice is download version 2.79 then you shall find the embedded python at
. Navigating to this directory will show you the below directoriesblenderlocation/2.79/python
- bin – location that contains the embedded python interpreter
- include – contains the include files for cythonic and other purposes
- lib – the meaty part containing all the python packages
Fire up a terminal or command line utility and navigate to blenderlocation/2.79/python/bin
Run the command as shown in the below screenshot
Once you have finished getting the get-pip.py then proceed to
Step by step
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- ./python3.5m get-pip.py
Once the get-pip.py has finished executing then the bin folder will be populated with executables of pip, easy_install etc.,
Now that we have installed the setuptools and distutils it is time to test its ability to install third-party packages. The below screenshot shows an example of installing scikit-learn using the pip tool we just arranged.
Shall we call it a day? or has the day just begun with the tools in place now?
Regards,
#0K