Python 3 fails to install pip and initialize

Hello,
We’re currently having some issues when users attempt to run Script Editor in Rhino8.

Each time it fails to launch with an error of “Error Occurred During Language Initialization”:

Has anyone encountered this before? If so how can I remedy this.

Thanks!

Hi Licencing -

The current version of Rhino 8 is 8.5. Please update your installation.
-wim

Hi Wim,

Thanks for that, unfortunately I’ve updated to Rhino 8.5 and still encounter the same error when attempting to launch ScriptEditor

Thanks,
Brett

Here is the log if this helps

error dump from get_pip.py run with wheel packages:

stderr: Traceback (most recent call last):  File "C:\Users\patbj\.rhinocode\py39-rh8\get_pip.py", line 24274,
 in <module> main()  File "C:\Users\patbj\.rhinocode\py39-rh8\get_pip.py", line 101,
 in main    bootstrap(tmpdir=tmpdir)  File "C:\Users\patbj\.rhinocode\py39-rh8\get_pip.py", line 76,
 in bootstrap    monkeypatch_for_cert(tmpdir)  File "C:\Users\patbj\.rhinocode\py39-rh8\get_pip.py", line 57,
 in monkeypatch_for_cert    from pip._internal.commands.install import InstallCommand  File "<frozen zipimport>", line 259,
 in load_module  File "C:\Users\patbj\AppData\Local\Temp\tmp8jqh2kqi\pip.zip\pip\_internal\commands\__init__.py", line 9,
 in <module>  File "<frozen zipimport>", line 259,
 in load_module  File "C:\Users\patbj\AppData\Local\Temp\tmp8jqh2kqi\pip.zip\pip\_internal\cli\base_command.py", line 4,
 in <module>  File "<frozen zipimport>", line 259,
 in load_module  File "logging\config.py", line 30,
 in <module>  File "<frozen zipimport>", line 259,
 in load_module  File "logging\handlers.py", line 26,
 in <module>  File "<frozen zipimport>", line 259,
 in load_module  File "socket.py", line 51,
 in <module>ImportError: dynamic module does not define module export function (PyInit__socket) 
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.DeployCPythonRuntime(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()

@licencing

See this thread please (Rhino 8 - Importing Python 3 Libraries - #18 by Thomas_Dowse)

Python is failing to import the _socket module and it is throwing this error:

in <module>ImportError: dynamic module does not define module export function (PyInit__socket) 

It is identical to the error message in the post that I shared above. This ususally happens when security policies on windows prevent Rhino from loading external libraries. Would you mind checking with your IT department on this?

On a related note, Python 3 tries to install pip from internet if it has access and if not it falls back on its own embedded pip. I will improve the install process

RH-80990 Try to install pip from embedded if get_pip fails

Thanks Ehsan, appreciate it!