[Bf-committers] Proposal: include Python's distutils

Alex Fraser alex at vpac-innovations.com.au
Thu Feb 11 06:32:24 CET 2016


Hi all,

Recently I wanted to install some packages with pip to use with Blender's
Python. I thought I should be able to do it like this:

     PYTHON=blender-2.76b-linux-glibc211-x86_64/2.76/python/bin/python3.4
     wget https://bootstrap.pypa.io/get-pip.py
     ${PYTHON} get-pip.py
     ${PYTHON} -m pip install -r requirements.txt

But get-pip.py fails with "ImportError: No module named 'distutils'" [1].
The suggested alternative is to remove Blender's Python so it falls back to
the system install [2]. But this doesn't work for me: it causes Blender to
stop working at all, crashing with "ImportError: No module named
'encodings'" [3]. I think this indicates a version incompatibility (3.4.2
vs 3.4.3).

Campbell says the inclusion of the Python executable is fairly recent.
Given that Python itself is now included, I think it makes sense to include
distutils. A quick test on my system suggests it would add about 160k to
the size of package.

Cheers,
Alex

-- 
Alex Fraser
Software Engineer
VPAC Innovations Pty. Ltd.

[1]: http://www.pasteall.org/64483/python
[2]:
https://www.blender.org/api/blender_python_api_2_61_0/info_tips_and_tricks.html#bundled-python-extensions
[3]: http://www.pasteall.org/64484


More information about the Bf-committers mailing list