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

GH Python3 Dependency Versions Behavior?

$
0
0

Hi,

I wonder what the expected behavior is when multiple Grasshopper Python3 components try and pip-install dependencies with different versions? How should we anticipate that the system will behave in that case?

For instance, what if I have a GH definition that includes one component like:

# r: pydantic==1.10
import pydantic
print(pydantic.VERSION)

and then another component in the same Grasshopper definition which includes:

# r: pydantic==2.4
import pydantic
print(pydantic.VERSION)

How would the system work in that case? Would the ‘last’ component to run win and get its version installed? Or would the second component be ignored and the first version installed gets preserved?


From my own tests, I get some slightly odd behavior, which is why I wonder how it is ‘supposed’ to work?

Example 1:

If I install v1.10, it installs v1.10. That’s good

Example 2:

If I install v2.4, it installs v2.4. Also good.

Example 3:

However, if I install v1.10 first, then install v2.4, it appears to install v2.4 within the site-env directory, but the interpreter continues to show v1.10:

Is this maybe just a ‘reload’ issue do you think?

But mostly I would just like to understand how its ‘supposed’ to work so we can anticipate that and develop towards that behavior?

thanks!
@ed.p.may

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 4125