# ScriptEditor reset Mac error

**URL:** <https://discourse.mcneel.com/t/scripteditor-reset-mac-error/181253>\
**Category:** Rhino Developer\
**Tags:** windows, mac\
**Created:** [May 1, 2024, 9:11pm UTC](https://discourse.mcneel.com/t/scripteditor-reset-mac-error/181253 "2024-05-01T21:11:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [May 1, 2024, 9:11pm UTC](https://discourse.mcneel.com/t/scripteditor-reset-mac-error/181253/1 "2024-05-01T21:11:48Z")

</div>

@eirannejad

After I reset script editor on Mac, it does not load anymore even after closing or restarting pc:

 ![Screenshot 2024-05-01 at 23.08.33](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/b/c/fbc635ca123f66ab0300d3e0901bf6c2d3a70c16.jpeg)

```auto

the log:

Info 05/01/2024 21:07:30 [RhinoCode] Language Registered: Plain Text 1.0 (rhinocode.builtin.text)
Info 05/01/2024 21:07:30 [RhinoCode] Language Registered: JSON 1.0 (rhinocode.builtin.json)
Info 05/01/2024 21:07:30 [RhinoCode] Storage Site Registered: Local Drive (mcneel.eto.file)
Info 05/01/2024 21:07:30 [RhinoCode] Storage Site Registered: Rhino Files (mcneel.rhinoFiles.file)
Info 05/01/2024 21:07:30 [RhinoCode] Storage Site Registered: Web (mcneel.eto.http)
Info 05/01/2024 21:07:30 [RhinoCode] Rhino3D Initialized on macOS - NETCoreApp
Info 05/01/2024 21:07:30 [RhinoCode] Platform Registered: Rhinoceros 3D @ 8.6.24101.5002 (mcneel.rhino3d.rhino)
Info 05/01/2024 21:07:30 [RhinoCode] RhinoCode server starting on /var/folders/cw/q8ncmynn475fsf585cq8qg600000gn/T/CoreFxPipe_rhinocode_remotepipe_666
Info 05/01/2024 21:08:05 [RhinoCode] Language Loader Registered: mcneel.pythonnet.python@3.*
Info 05/01/2024 21:08:05 [RhinoCode] Language Loader Registered: mcneel.ironpython.python@2.*
Info 05/01/2024 21:08:05 [RhinoCode] Language Loader Registered: mcneel.roslyn.csharp@9.*
Info 05/01/2024 21:08:05 [RhinoCode] Language Loader Registered: mcneel.gh1.grasshopper@1.*
Info 05/01/2024 21:08:05 [RhinoCode] Language Loader Registered: mcneel.markdig.markdown@0.*
Info 05/01/2024 21:08:05 [RhinoCode] Parsing configs schema "https://files.mcneel.com/schemas/rhinocode/editor.schema.v1.json" in /Users/petras/.rhinocode/editor.json
Info 05/01/2024 21:08:05 [RhinoCode] Language Registered: Python 3.9.10 (mcneel.pythonnet.python)
Info 05/01/2024 21:08:05 [RhinoCode] Using existing runtime: IronPython 2.7.12/3 (x64)
Info 05/01/2024 21:08:05 [RhinoCode] Loading IronPython 2.7.12/3 runtime
Info 05/01/2024 21:08:06 [RhinoCode] Added IronPython 2.7.12 (mcneel.ironpython.python) search path: /Users/petras/Library/Application Support/McNeel/Rhinoceros/8.0/scripts
Info 05/01/2024 21:08:06 [RhinoCode] Language Registered: IronPython 2.7.12 (mcneel.ironpython.python)
Info 05/01/2024 21:08:06 [RhinoCode] Added C# 9.0 (mcneel.roslyn.csharp) search path: /Users/petras/Library/Application Support/McNeel/Rhinoceros/8.0/scripts
Info 05/01/2024 21:08:06 [RhinoCode] Language Registered: C# 9.0 (mcneel.roslyn.csharp)
Info 05/01/2024 21:08:06 [RhinoCode] Language Registered: Grasshopper 1.0 (mcneel.gh1.grasshopper)
Info 05/01/2024 21:08:06 [RhinoCode] Language Registered: Markdown 0.30.4 (mcneel.markdig.markdown)
Info 05/01/2024 21:08:08 [RhinoCode] Initializing CPython 3.9.10/41 runtime
Error 05/01/2024 21:08:08 [RhinoCode] Error Initializing Python | Access to the path '/Users/petras/.rhinocode/py39-rh8/lib/python3.9/site-packages/wood_nano/libmpfr-4.dll' is denied.
   at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.DeleteDeployments(CPythonStartupSteps startup) in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code.Languages.PythonNet/CPythonRuntime.cs:line 399
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.<>c __DisplayClass105_0.<InitRuntime>b__ 0(Access access) in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code.Languages.PythonNet/CPythonRuntime.cs:line 246
   at Rhino.Runtime.Code.Languages.Runtime.Access.Run(String id, Action`1 task) in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code/Languages/_Runtime/Runtime.cs:line 94
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.InitRuntime(CPythonStartupSteps startup) in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code.Languages.PythonNet/CPythonRuntime.cs:line 233
   at Rhino.Runtime.Code.Languages.PythonNet.CPython`1.Start() in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code.Languages.PythonNet/CPythonLanguage.cs:line 219
Error 05/01/2024 21:08:08 [RhinoCode] [CPY001] Runtime failed to initialize (Python 3.9.10 (mcneel.pythonnet.python))
Access to the path '/Users/petras/.rhinocode/py39-rh8/lib/python3.9/site-packages/wood_nano/libmpfr-4.dll' is denied.
   at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.DeleteDeployments(CPythonStartupSteps startup) in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code.Languages.PythonNet/CPythonRuntime.cs:line 399
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.<>c __DisplayClass105_0.<InitRuntime>b__ 0(Access access) in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code.Languages.PythonNet/CPythonRuntime.cs:line 246
   at Rhino.Runtime.Code.Languages.Runtime.Access.Run(String id, Action`1 task) in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code/Languages/_Runtime/Runtime.cs:line 94
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.InitRuntime(CPythonStartupSteps startup) in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code.Languages.PythonNet/CPythonRuntime.cs:line 233
   at Rhino.Runtime.Code.Languages.PythonNet.CPython`1.Start() in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/DotNetSDK/RhinoCode/src/Rhino.Runtime.Code.Languages.PythonNet/CPythonLanguage.cs:line 219

```

---

<div class="post-metadata">

**Author:** ![eirannejad](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/eirannejad/32/477962_2.png) [@eirannejad](https://discourse.mcneel.com/u/eirannejad)\
**Post date:** [May 1, 2024, 9:15pm UTC](https://discourse.mcneel.com/t/scripteditor-reset-mac-error/181253/3 "2024-05-01T21:15:12Z")

</div>

> [@Petras\_Vestartas](#):
>
> ```auto
> Access to the path '/Users/petras/.rhinocode/py39-rh8/lib/python3.9/site-packages/wood_nano/libmpfr-4.dll' is denied.
> 
> ```

Seems like you have placed a `wood_nano` folder under `site-packages`. The `libmpfr-4.dll` is loaded by a process and Rhino fails at deleting it when reinitializing the runtime.

It’s best practice not to change the runtime directories manually. You can install the `wood_nano` package in a separate folder outside of the runtime (see `--target` option on pip) and add the path to the python search paths.

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [May 1, 2024, 9:20pm UTC](https://discourse.mcneel.com/t/scripteditor-reset-mac-error/181253/4 "2024-05-01T21:20:51Z")

</div>

> [@Petras\_Vestartas](#):
>
> `/Users/petras/.rhinocode/py39-rh8/lib/python3.9/site-packages/wood_nano/`

Manually deleting solves the issue.  
According to your advice I will use:

`pip install --target=/path/to/installation_directory package_name`

Will this error happen if a package is installed via PyPi when specifying r: #packagename keyword?

I quite sure that this happens due to windows dll on Mac… which is my fault. But I am wondering if the same thing could happen for MAC .dylib?

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [May 1, 2024, 9:59pm UTC](https://discourse.mcneel.com/t/scripteditor-reset-mac-error/181253/5 "2024-05-01T21:59:40Z")

</div>

This is actually a bit difficult to maintain. Specially on MAC.

On windows I can pip install to rhinoscripteditor and temporary work that way for development. But for MAC, it always refers to PYPI if does not find a library it won’t load even if it is install in the site-packages folder.

---

<div class="post-metadata">

**Author:** ![Petras\_Vestartas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/petras_vestartas/32/480531_2.png) [@Petras\_Vestartas](https://discourse.mcneel.com/u/Petras_Vestartas)\
**Post date:** [May 1, 2024, 10:33pm UTC](https://discourse.mcneel.com/t/scripteditor-reset-mac-error/181253/6 "2024-05-01T22:33:30Z")

</div>

After some trials, I will stay to this workflow:

` sudo -H /Users/petras/.rhinocode/py39-rh8/python3.9 -m pip install .`

that copies files here:  
`/Users/petras/.rhinocode/py39-rh8/lib/python3.9/site-packages`

after I deploy PYPI package I manually delete that.

If you can show a simpler method with --target it would be much appreciated, with Conda I could not make it work. I built packages locally then pip install to the directory of script editor.
