-
I've been trying out basilisp-blender and I would like to make a library of utility functions that I can install and reuse in other basilisp projects. My dev env words great and I can package the library however, I am having trouble at the next step - trying to import /require the libraries. Basically my new namespaces are not picked up by Thank you! (edit: repo I'm working on is here. ) |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Hi @zachcp, Requiring I looked into the I assume the expectation is that this option would allow This behavior aligns with the --python-use-system-env documentation, which states that this option enables Python to use system environment variables such as
As a result, dependencies declared by Could you please share the output of By the way, the project looks great! I was able to run the |
Beta Was this translation helpful? Give feedback.
-
@ikappaki , thank you - your work is an inspiration. I think you are right about the system path and I still don't quite grok the basilisp compilation model. Here is my system path. pixi run repl: repl# pixi run repl
(println (sys/path))
#py ["/Applications/Blender.app/Contents/Resources/4.3/scripts/startup"
"/Applications/Blender.app/Contents/Resources/4.3/scripts/modules"
"/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python311.zip"
"/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11"
"/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/lib-dynload"
"/Users/zcpowers/Library/Application Support/Blender/4.3/extensions/.local/lib/python3.11/site-packages"
"/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages"
"/Users/zcpowers/Documents/Projects/basimol/src"
"/Applications/Blender.app/Contents/Resources/4.3/scripts/freestyle/modules"
"/Users/zcpowers/Library/Application Support/Blender/4.3/scripts/addons/modules"
"/Applications/Blender.app/Contents/Resources/4.3/scripts/addons_core"
"/Users/zcpowers/Library/Application Support/Blender/4.3/scripts/addons"
"/Users/zcpowers/Library/Application Support/Blender/4.3/extensions/blender_org"]
Pixi run repl: script window['/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages/bpy/4.3/scripts/startup',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages/bpy/4.3/scripts/modules',
'/Users/zcpowers/Documents/Projects/basimol/docs',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python311.zip',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/lib-dynload',
'',
'/Users/zcpowers/Library/Application Support/Blender/4.3/extensions/.local/lib/python3.11/site-packages',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages',
'/Users/zcpowers/Documents/Projects/basimol/src',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages/bpy/4.3/scripts/freestyle/modules',
'/Users/zcpowers/Library/Application Support/Blender/4.3/scripts/addons/modules',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages/bpy/4.3/scripts/addons_core',
'/Users/zcpowers/Library/Application Support/Blender/4.3/scripts/addons'] Pixi run docs: qmdHere are the docs - e.g. I wanted to dynamically recreate a set of images by loading/using my WIP library. # pixi run docs
['/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages/bpy/4.3/scripts/startup',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages/bpy/4.3/scripts/modules',
'/Users/zcpowers/Documents/Projects/basimol/docs',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python311.zip',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/lib-dynload',
'',
'/Users/zcpowers/Library/Application Support/Blender/4.3/extensions/.local/lib/python3.11/site-packages',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages',
'/Users/zcpowers/Documents/Projects/basimol/src',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages/bpy/4.3/scripts/freestyle/modules',
'/Users/zcpowers/Library/Application Support/Blender/4.3/scripts/addons/modules',
'/Users/zcpowers/Documents/Projects/basimol/.pixi/envs/default/lib/python3.11/site-packages/bpy/4.3/scripts/addons_core',
'/Users/zcpowers/Library/Application Support/Blender/4.3/scripts/addons'] |
Beta Was this translation helpful? Give feedback.
-
Also, as a note: pixi run docs ImportWhen I use import, the init.py is picked up. However that is not the same case with the Require(require '[basimol.core :as core])
core |
Beta Was this translation helpful? Give feedback.
-
Note: the docs are using Basilisp-kernel under the hood. So I think you are absolutely right about the path being the issue, however: git clone https://github.com/zachcp/basimol.git
cd basimol
pixi shell # sets up and enters the venv
jupyter lab # run a notebook using the basilisp kernel... The image below seems to me to suggest the paths are okay. But maybe the basilisp compiler does not see the |
Beta Was this translation helpful? Give feedback.
-
Hi @zachcp, Let's take a step back and establish a common understanding of Python's import behavior and its relevance to Blender and Basilisp. Using
|
Beta Was this translation helpful? Give feedback.
Hi @zachcp,
Let's take a step back and establish a common understanding of Python's import behavior and its relevance to Blender and Basilisp.
Using
basimol
virtual environment in BlenderPremise 1:
To
import
a Python package, its directory must be a subpath of a directory insys.path
.Step 1: Check Blender’s
sys.path
I've installed Blender 4.3.2 on macOS and checked its
sys.path
in Blender scripting tab: