Blender for Scientists - Installing Python Packages in Blender

7,340
0
Published 2023-04-02
This is a walkthrough for the CGFigures Module Installer addon, which makes it easy to install specific python packages into the version of python that comes bundled with Blender.

Note*: At 3:00 I indicate that you should paste into 'site-packages'. It will still work if you paste the folder into 'lib'.

The addon is available for free on gumroad: cgfigures.gumroad.com/l/pymodinstall

The original script was largely developed by luckychris on github: github.com/luckychris/install_blender_python_modul…

Timestamps:
0:00 Python in Blender
0:45 The Addon and Installation
1:17 Wrong Directory Issue and Solution
3:05 Testing for Module Installation
4:00 Attribution to luckychris and conclusion

The blender.science Community Discord: discord.gg/p62E9qzHbT

For more CGFigures content checkout the links below:
Patreon: www.patreon.com/cgfigures
Website: www.cgfigures.ca/
Twitter: twitter.com/CgFigures
Blendswap: www.blendswap.com/profile/1324219/blends
Gumroad: gumroad.com/cgfigures

All Comments (8)
  • @cryora
    I find that by running "pip install scipy" from the command line in the C://Program Files/Blender Foundation/Blender 3.5/3.5/python/bin/ directory does the job. It installs it in the /site-packages/ folder. I use Anaconda for my regular python, which has a ton of packages and doesn't seem to be using the site-packages folder.
  • @TigranAivazian
    On Blender 3.6.1 it is failing to install scipy with a strange error, complaining that blender-3.6.1-linux-x64/3.6/python/sys.prefix/bin/python doesn't exist. But it shouldn't exist, as the proper path to the python executable is blender-3.6.1-linux-x64/3.6/python/bin/python3.10 instead. So, how do I proceed?
  • I've got a "ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'c:\\program files\\blender foundation\\blender 3.6\\3.6\\python\\lib\\site-packages\\pip-23.0.1.dist-info\\entry_points.txt' Consider using the `--user` option or check the permissions.". If I find a fix, I'll update. But throwing this out in case somebody nice comes first edit: ah. ok. it looks like things are actually ok. The plugin tried to update pip, but installed the package right
  • @jojolafrite90
    10 hours non stop of craziness and still can't install a simple moduile in that broiken mess. So... My code to make the object odf my wildest dreams a 4D object... LOST TO THE WORLD! I JUST NEEDED A MANIFOLD MODULE!!! I WILL KILL MYSELF OVER THIS! You cannot understand how important that was to me. Achievement of my life, tol be showed to all my friends and family.0 NOW I HAVE NOTHING. I SEE IT's IM PO SSI BLE! And it's NOT NORMAL! I SHOULD BE ABLE TO ADD A MANIFILD MODULE AND USE IT!!! AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHH!!!
  • @jojolafrite90
    The most frustrating moment in my actuial entire life... I found out I could do a very specific mathematical object in blender using an AI. And Python. BUT, after installing Python, AS WAS SAID I HAAD TO DO. Now I see the broken implementation was always so broken no one in the entire history of 3D ever cold use it with a addon, I want the manifold addon... Simpole, all I HAD TO DO WAS COPY PASTE MY CODE!!! And now I'm at the ACTUAL EDGE OF K1lling MYSELF OVER THIS! I HAD IT I HAD EXACLY WHAT I WANTEZD TO DO IN BLENDER FOR YEARS!!! I CAn't. .. WHY IS LITERALLY EVERITHING ALWAYS BROKEN?! If I actually k1ll myself THAT WILL HAVE SOMETHING TO DO WITH IT! WHY CAN't I AT ALL INSTALL A MODULE IN TGHAT BROKEN VERSION THEY FORCE US TO USE IN BLENDER??? MAKEZS NO SENSE!!! WhY WHGY WOULS IT BE SO IMPOSSIBNLE?! I've LOST MY LKAST AND ONLY INTEREST IN LIFE.
  • It's been hilarious watching the windows python newbs scramble to learn since Stable Diff. dropped. You've all done very well.