All the ways to import Python libraries into your Blender scripts

When we code a blender script sometimes we need to use some other python libraries.

Standard Solution

The standard solution is to include into your script code the library code.

An easy workaround is to use virtualenv

python3.7 -m venv external_libraries
source venv/bin/activate
pip install -r requirements.txt

From the Blender script we can find the coode of the library at external_libraries/lib_bame/…

Global solution

Sometimes we use some library every day and we want that this library are in every project. The solution is to add this libraries directly to blender.

cd ....//home/mint/blender-2.83.1-linux64/2.83/python/bin
./python3.7m -m ensurepip
./python3.7m -m pip install your_libraries

Conclusion

To release an addon obviously the first solution is the best one, because we cannot ask to the user to install library inside blender, and different plugin can have different version of the same library, so it can be a problem.

But if we use very offen plugin with some library for experimental reason or we develop every day may be it can be a great solution to be more efficient in particular for learn.

--

--

--

Linux user and Open Source fun. Deep learning PhD Student, Full stack web developer, Mobile developer, Musitian.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Fifa 13 Crash Dump Fix Windows 7 Download

AWS announces availability of Amazon Workspaces in Mumbai region

Tableau Consulting — A Tableau Consultant POWERING UP! “manual data entry on a table”

A Brief History of Tech

Working with the OpenCV Camera for Android: Rotating, Orienting, and Scaling

Hello, World!🌏

Documenting a rails API using Dox and RSpec

The Complete Beginner’s Guide to Apple Shortcut Deep Linking for Developers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nicola Landro

Nicola Landro

Linux user and Open Source fun. Deep learning PhD Student, Full stack web developer, Mobile developer, Musitian.

More from Medium

Build your own website with Flask, Docker and Heroku for peanuts

Build Your First Transliterator Text Editor with Python Tkinter

How to Create A Simple Flask Application on Windows

create-project-folder

Today Let’s talk about Python environment setup and HTTP REST API using Flask.