Discussion:
[Bf-python] Third party modules in Blender
Bastien Montagne
2013-02-17 17:24:08 UTC
Permalink
Hi devs,

My problem is rather simple: I want to use enchant module from within
Blender! :)

Now, currently we only copy "core" modules into blender's own python. We
only have one exception for numpy, with a whole set of custom install
directives for that.

I wonder whether it would be possible to add system's python path to
Blender's one (as e.g. a build option)? Or add enchant into copied
modules (I guess we do not want that :p )? Or should I just rely on a
ugly hack, like adding another setting to my code, containing the path
to my /usr/lib/python3/dist-package dir?

With kind regards,
Bastien
Stephen Swaney
2013-02-17 19:08:28 UTC
Permalink
Post by Bastien Montagne
My problem is rather simple: I want to use enchant module from within
Blender! :)
...
Post by Bastien Montagne
I wonder whether it would be possible to add system's python path to
Blender's one (as e.g. a build option)? Or add enchant into copied
modules (I guess we do not want that :p )? Or should I just rely on a
ugly hack, like adding another setting to my code, containing the path
to my /usr/lib/python3/dist-package dir?
One solution would be similar to what Python itself does: run a known
file at startup to add whatever local paths and initialization needs
to be done.

In python's case (on linux), it uses /etc/pythonstartup. We could put
something in our blender config folder.
--
Stephen Swaney sswaney at centurytel.net
Campbell Barton
2013-02-19 08:04:41 UTC
Permalink
Post by Stephen Swaney
Post by Bastien Montagne
My problem is rather simple: I want to use enchant module from within
Blender! :)
...
Post by Bastien Montagne
I wonder whether it would be possible to add system's python path to
Blender's one (as e.g. a build option)? Or add enchant into copied
modules (I guess we do not want that :p )? Or should I just rely on a
ugly hack, like adding another setting to my code, containing the path
to my /usr/lib/python3/dist-package dir?
One solution would be similar to what Python itself does: run a known
file at startup to add whatever local paths and initialization needs
to be done.
In python's case (on linux), it uses /etc/pythonstartup. We could put
something in our blender config folder.
--
Stephen Swaney sswaney at centurytel.net
Talked with Bastien on IRC, in this case its probably easiest to
remove the bundled python and so blender falls back to the systems
python - making all its modules available too.

http://www.blender.org/documentation/blender_python_api_2_65_release/info_tips_and_tricks.html#bundled-python-extensions
Loading...