Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

ScriptEditor Requirements and Path

$
0
0

@eirannejad I have the following script/package structure:

my_script.py
package/
    __init__.py
    module1.py
    module2.py

code in my_script.py

#! python3
from package import module1

code in module1.py

#! python3
# r: euclid, numpy, etc.
# env: /path/to/some/virtualenv/lib/site-packages

Neither # r: package nor # env: /path/… seem to work when not top level in my_script.py. May you confirm this? Is this a bug? If not a bug, may you add # r and # env to work in package modules? Thanks.

Our use-case is around 300 Rhino installations at a university, where we automatically distribute package. For various reasons we cannot rely on the following workarounds:

  1. Add the env path via the _ScriptEditor UI (Tools > Options > Python3 > Module Search Paths).
  2. Add the path on package import through code in package/__init__.py.

The more relevant feature would be # r over # env. Is there another option to make package self contained?

Rhino Version 8 SR25
(8.25.25287.14001, 2025-10-14)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles