Currently experiencing an issue with Rhino where it is failing to install the Python runtime. This occurs when opening the ScriptEditor or when running Grasshopper and attempting to add a Python component to the canvas.
The ScriptEditor window displays a message of ‘Error occured during language initialization’.
The log shows:
"C:\Users\username\AppData\Local\Temp\colorama-0.4.4-py2.py3-none-any.whl"
Error 26/09/2024 10:51:52 [RhinoCode] Process exited with code 1
Error 26/09/2024 10:51:52 [RhinoCode] Error Initializing Python | Error deploying package "pylint-2.10.2-py3-none-any.whl" | ERROR: Can not combine '--user' and '--target'
at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.DeployPackages(CPythonStartupSteps startup)
at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.<>c__DisplayClass98_0.<InitRuntime>b__0(Access access)
at Rhino.Runtime.Code.Languages.Runtime.Access.Run(String id, Action`1 task)
at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.InitRuntime(CPythonStartupSteps startup)
at Rhino.Runtime.Code.Languages.PythonNet.CPython`1.Start()
This problem only seems to occur on machines that also have Anaconda installed and uninstalling Anaconda seems to resolve the problem. As a lowly Desktop Engineer unfortunately I am not so well versed in all things Python related and was hoping to be pointed in the right direction.
We’re currently running Rhino 8.5 and Anaconda 2024.06-1 on Windows 11 Education 10.0.22621.4169 x64 (2009)
If I can provide any further information please let me know.
Thanks for replying I have gone ahead and updated a test machine to 8.11 unfortunately still receiving ‘Error Occured During Language Initialization’. when loading the ScriptEditor.
There seems to be an issue with the log file at C:\Users\Username.rhinocode\logs as it is incomplete.
@Luke14 Anaconda manages its own environments and configures system to force pip (Python’s default package manager) to install to a user local directory.
It usually sets the PIP_USER environment variable on your system (See --user flag
Alternatively it might add this option to the pip configuration file on the system (See Pip configs)
[global]
user = true
This is not a Rhino python deployment issue however I am gonna make some modifications to make sure our pip installer does not listen to these global configurations. I made a ticket here and will get this fixed ASAP:
RH-83985 Rhino pip listens to PIP_USER global env var
Sorry to be the bearer of bad news but the problem still appears to exist in SR13. If the pip.ini at C:\ProgramData\pip\ is set as:
[global]
user = true
Then the python component will fail to install. The above setting appears to be the default after an Anaconda installation.
I can get around this by closing Rhino and setting the pip.ini to:
[global]
user = false
and then deleting the .rhinocode directory at C:\Users\username and relaunching Rhino. The python component will then launch successfully upon loading the ScriptEditor.