RhinoCode templates not opening

This is my first time trying out the new RhinoCode and none of the “Edit New Code” options work, I get messages about .tmp files not existing.

Same thing happens trying to open an existing python script.

Hi Jim - do you mean this stuff:


does not open the file?

-Pascal

Yeah, and I can’t open an existing file either.

OK - Ehsan is away at the moment but I will let him know - this is in quite a bit of churn at the moment, but it does work here, albeit with an error message along the way.

-Pascal

1 Like

This is the error message I get…

Info 9/28/2022 6:54:31 PM [RhinoCode] Parsing configs schema “https://files.mcneel.com/schemas/rhinocode/editor.schema.v1.json” in C:\Users\James Carruthers.rhinocode\editor.json
Info 9/28/2022 6:54:31 PM [RhinoCode] File watcher start: file:///C:/Users/James Carruthers/.rhinocode/editor.json
Info 9/28/2022 6:54:31 PM [RhinoCode] Stubs already exist for System.Windows.Controls.Ribbon, Version=6.0.2.0
Error 9/28/2022 6:54:38 PM [RhinoCode] System.Exception: “C:\Users\James Carruthers\AppData\Local\Temp\tmp6F42.tmp” does not exist
** at Rhino.Runtime.Code.Storage.StageStorage…ctor(String filePath)**
** at Rhino.Runtime.Code.Storage.StageStorage…ctor()**
** at Rhino.Runtime.Code.Code…ctor(ILanguage lang)**
** at Rhino.Runtime.Code.Languages.PythonNet.CPythonCode…ctor(ILanguage lang, IEnviron env)**
** at RhinoCPython.McNeelCPythonCode…ctor(ILanguage lang, IEnviron env)**
** at RhinoCPython.McNeelPython.CreateCode()**
** at Rhino.Runtime.Code.Languages.Language`1.Rhino.Runtime.Code.Languages.ILanguage.CreateCode(String text)**
** at Rhino.Runtime.Code.Template.CreateCode()**
** at Rhino.Runtime.Code.Eto.Editor.Commands.CodeNewOfLanguageTemplateCommand.ExecuteWith(RCE rce)**

@JimCarruthers Seems like there has been files saved from an open instance of editor in the temp directory that has gotten cleaned up. Remove the ~/.rhinocode/editor.json file and run Rhino again. Let me know if that works. If the templates are note opening, I’d appreciate if you can send me the error logs for that as well

I tried that, and tried that after updating the WIP, same result.

Here’s the log:

...
Error 10/17/2022 3:40:21 AM [RhinoCode] System.Exception: "C:\Users\James Carruthers\AppData\Local\Temp\tmp2622.tmp" does not exist
   at Rhino.Runtime.Code.Storage.StageStorage..ctor(String filePath)
   at Rhino.Runtime.Code.Storage.StageStorage..ctor()
   at Rhino.Runtime.Code.Code..ctor(ILanguage lang)
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonCode..ctor(ILanguage lang, IEnviron env)
   at RhinoCPython.McNeelCPythonCode..ctor(ILanguage lang, IEnviron env)
   at RhinoCPython.McNeelPython.CreateCode()
   at Rhino.Runtime.Code.Languages.Language`1.Rhino.Runtime.Code.Languages.ILanguage.CreateCode(String text)
   at Rhino.Runtime.Code.Template.CreateCode()
   at Rhino.Runtime.Code.Eto.Editor.Commands.CodeNewOfLanguageTemplateCommand.ExecuteWith(RCE rce)

Thank you! I got this fixed and will push with next WIP

Hi I’m still getting errors trying to start anything.

> Info 11/27/2022 1:41:29 AM [RhinoCode] Language Registered: Plain Text @ 1.0 (rhinocode.builtin.text)
> Info 11/27/2022 1:41:29 AM [RhinoCode] Platform Registered: Rhinocerous 3D @ 8.0.22326 (mcneel.rhino3d.rhino)
> Info 11/27/2022 1:41:29 AM [RhinoCode] Language Registered: C# @ 9.0 (mcneel.roslyn.csharp)
> Info 11/27/2022 1:41:29 AM [RhinoCode] Storage Site Registered: File (mcneel.eto.file)
> Info 11/27/2022 1:41:29 AM [RhinoCode] Storage Site Registered: Web (mcneel.eto.http)
> Info 11/27/2022 1:41:29 AM [RhinoCode] Language Registered: Markdown @ 0.30.4 (mcneel.markdig.markdown)
> Info 11/27/2022 1:41:29 AM [RhinoCode] RhinoCode server starting on \\.\pipe\rhinocode_remotepipe_2052
> Info 11/27/2022 1:41:29 AM [RhinoCode] Creating python 3.9.10 runtime
> Info 11/27/2022 1:41:29 AM [RhinoCode] Language Registered: Python3 @ 3.9.10 (mcneel.pythonnet.python)
> Info 11/27/2022 1:41:29 AM [RhinoCode] Configuring runtime@1.24 for the first time on X64
> Info 11/27/2022 1:41:45 AM [RhinoCode] File watcher start: file:///C:/Users/James Carruthers/.rhinocode/editor.json
> Warn 11/27/2022 1:41:46 AM [RhinoCode] Language Python3 @ 3.9.10 (mcneel.pythonnet.python) is not yet ready: "Initialize Python Runtime?"
> Info 11/27/2022 1:41:46 AM [RhinoCode] Deploying python runtime
> Info 11/27/2022 1:41:46 AM [RhinoCode] Clearing exiting runtime
> Info 11/27/2022 1:41:46 AM [RhinoCode] Unpacking python standard library from: C:\Users\James Carruthers\.rhinocode\python3.9-1.24\python39.zip
> Info 11/27/2022 1:41:46 AM [RhinoCode] Installing pip
> Info 11/27/2022 1:41:46 AM [RhinoCode] Running async process: C:\Users\James Carruthers\.rhinocode\python3.9-1.24\python.exe get_pip.py --no-warn-script-location pip-21.2.4-py3-none-any.whl setuptools-57.4.0-py3-none-any.whl wheel-0.37.0-py2.py3-none-any.whl
> Info 11/27/2022 1:41:48 AM [RhinoCode] C:\Users\JAMESC~1\AppData\Local\Temp\tmp2mspyy_i\pip.zip
> Info 11/27/2022 1:41:48 AM [RhinoCode] Processing c:\users\james carruthers\.rhinocode\python3.9-1.24\pip-21.2.4-py3-none-any.whl
> Info 11/27/2022 1:41:48 AM [RhinoCode] Processing c:\users\james carruthers\.rhinocode\python3.9-1.24\setuptools-57.4.0-py3-none-any.whl
> Info 11/27/2022 1:41:48 AM [RhinoCode] Processing c:\users\james carruthers\.rhinocode\python3.9-1.24\wheel-0.37.0-py2.py3-none-any.whl
> Info 11/27/2022 1:41:48 AM [RhinoCode] Installing collected packages: wheel, setuptools, pip
> Info 11/27/2022 1:41:49 AM [RhinoCode] Successfully installed pip-21.2.4 setuptools-57.4.0 wheel-0.37.0
> Info 11/27/2022 1:41:49 AM [RhinoCode] Copying python engine assembly @C:\Program Files\Rhino 8 WIP\Plug-ins\RhinoCode\McNeel.Python39.Runtime.dll -> @C:\Users\James Carruthers\.rhinocode\python3.9-1.24\McNeel.Python39.Runtime.dll
> Info 11/27/2022 1:41:49 AM [RhinoCode] Deploying python packages
> Info 11/27/2022 1:41:49 AM [RhinoCode] Deploying package from "site-interop.zip"
> Info 11/27/2022 1:41:49 AM [RhinoCode] Clearing exiting scripts at C:\Users\James Carruthers\.rhinocode\python3.9-1.24\site-interop
> Info 11/27/2022 1:41:49 AM [RhinoCode] Deploying package from "utils.zip"
> Info 11/27/2022 1:41:49 AM [RhinoCode] Clearing exiting scripts at C:\Users\James Carruthers\.rhinocode\python3.9-1.24\utils
> Info 11/27/2022 1:41:49 AM [RhinoCode] Deploying package from "pylint==2.10.2"
> Info 11/27/2022 1:41:49 AM [RhinoCode] Running async process: C:\Users\James Carruthers\.rhinocode\python3.9-1.24\python.exe -m pip --disable-pip-version-check install --target "C:\Users\James Carruthers\.rhinocode\python3.9-1.24\site-support" --upgrade --no-warn-script-location --retries 0 --timeout 1 --no-dependencies C:\Users\James Carruthers\AppData\Local\Temp\pylint-2.10.2-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\toml-0.10.2-py2.py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\platformdirs-2.3.0-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\isort-5.9.3-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\mccabe-0.6.1-py2.py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\astroid-2.7.3-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\wrapt-1.12.1-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\lazy_object_proxy-1.6.0-cp39-cp39-win_amd64.whl C:\Users\James Carruthers\AppData\Local\Temp\colorama-0.4.4-py2.py3-none-any.whl
> Error 11/27/2022 1:41:51 AM [RhinoCode] ERROR: Invalid requirement: 'C:\\Users\\James'
> Error 11/27/2022 1:41:51 AM [RhinoCode] Hint: It looks like a path. File 'C:\Users\James' does not exist.
> Error 11/27/2022 1:41:51 AM [RhinoCode] Process exited with code 1
> Error 11/27/2022 1:41:51 AM [RhinoCode] [CPY001] CPython runtime failed to initialize (Python3 @ 3.9.10 (mcneel.pythonnet.python))
> Error deploying package "pylint==2.10.2" | ERROR: Invalid requirement: 'C:\\Users\\James'
> Hint: It looks like a path. File 'C:\Users\James' does not exist.
>    at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.DeployPackagesAsync(CPythonStartupContext startup)
>    at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.<>c__DisplayClass63_0.<InitRuntimeAsync>b__0()
>    at System.Threading.Tasks.Task`1.InnerInvoke()
>    at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
>    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
> --- End of stack trace from previous location ---
>    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
>    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
> --- End of stack trace from previous location ---
>    at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.InitRuntimeAsync(CPythonStartupContext startup)
>    at Rhino.Runtime.Code.Languages.PythonNet.CPython`1.Start()
> Error 11/27/2022 1:41:51 AM [RhinoCode] Error Initializing Python | Error deploying package "pylint==2.10.2" | ERROR: Invalid requirement: 'C:\\Users\\James'
> Hint: It looks like a path. File 'C:\Users\James' does not exist.
>    at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.DeployPackagesAsync(CPythonStartupContext startup)
>    at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.<>c__DisplayClass63_0.<InitRuntimeAsync>b__0()
>    at System.Threading.Tasks.Task`1.InnerInvoke()
>    at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
>    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
> --- End of stack trace from previous location ---
>    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
>    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
> --- End of stack trace from previous location ---
>    at Rhino.Runtime.Code.Languages.PythonNet.CPythonRuntime.InitRuntimeAsync(CPythonStartupContext startup)
>    at Rhino.Runtime.Code.Languages.PythonNet.CPython`1.Start()
> Info 11/27/2022 1:41:51 AM [RhinoCode] Clearing exiting scripts at C:\Users\James Carruthers\.rhinocode\python3.9-1.24\site-rhinopython
> Error 11/27/2022 1:42:20 AM [RhinoCode] C# @ 9.0 (mcneel.roslyn.csharp) can not create new code | System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\James%20Carruthers\.rhinocode\stage\2dogtw4h.kzi'.
>    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
>    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
>    at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
>    at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
>    at Rhino.Runtime.Code.Storage.StageStorage.Store(StorageData data)
>    at Rhino.Runtime.Code.Code.Stage()
>    at Rhino.Runtime.Code.Eto.Editor.RCEState.AddCode(Code code, Boolean locked, Boolean readOnly, Boolean updateWorkspace)
>    at Rhino.Runtime.Code.Eto.Editor.Commands.CodeNewOfLanguageCommand.NewCode(RCE rce, Code code)
>    at Rhino.Runtime.Code.Eto.Editor.Commands.CodeNewOfLanguageCommand.NewCode(RCE rce, ILanguage lang)
> Error 11/27/2022 1:42:30 AM [RhinoCode] System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\James%20Carruthers\.rhinocode\stage\3w3n2why.ca2'.
>    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
>    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
>    at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
>    at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
>    at Rhino.Runtime.Code.Storage.StageStorage.Store(StorageData data)
>    at Rhino.Runtime.Code.Code.Stage()
>    at Rhino.Runtime.Code.Eto.Editor.RCEState.AddCode(Code code, Boolean locked, Boolean readOnly, Boolean updateWorkspace)
>    at Rhino.Runtime.Code.Eto.Editor.Commands.CodeNewOfLanguageCommand.NewCode(RCE rce, Code code)
>    at Rhino.Runtime.Code.Eto.Editor.Commands.CodeNewOfLanguageTemplateCommand.ExecuteWith(RCE rce)
> Error 11/27/2022 1:42:59 AM [RhinoCode] Plain Text @ 1.0 (rhinocode.builtin.text) can not create new code | System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\James%20Carruthers\.rhinocode\stage\rypybqvx.egm'.
>    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
>    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
>    at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
>    at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
>    at Rhino.Runtime.Code.Storage.StageStorage.Store(StorageData data)
>    at Rhino.Runtime.Code.Code.Stage()
>    at Rhino.Runtime.Code.Eto.Editor.RCEState.AddCode(Code code, Boolean locked, Boolean readOnly, Boolean updateWorkspace)
>    at Rhino.Runtime.Code.Eto.Editor.Commands.CodeNewOfLanguageCommand.NewCode(RCE rce, Code code)
>    at Rhino.Runtime.Code.Eto.Editor.Commands.CodeNewOfLanguageCommand.NewCode(RCE rce, ILanguage lang)

That looks like paths aren’t properly escaped - the space in your user directory isn’t being handled properly.

@eirannejad

Still can’t get anything to work here.

@JimCarruthers, does the error still look like this?

> Info 11/27/2022 1:41:49 AM [RhinoCode] Running async process: C:\Users\James Carruthers\.rhinocode\python3.9-1.24\python.exe -m pip --disable-pip-version-check install --target "C:\Users\James Carruthers\.rhinocode\python3.9-1.24\site-support" --upgrade --no-warn-script-location --retries 0 --timeout 1 --no-dependencies C:\Users\James Carruthers\AppData\Local\Temp\pylint-2.10.2-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\toml-0.10.2-py2.py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\platformdirs-2.3.0-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\isort-5.9.3-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\mccabe-0.6.1-py2.py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\astroid-2.7.3-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\wrapt-1.12.1-py3-none-any.whl C:\Users\James Carruthers\AppData\Local\Temp\lazy_object_proxy-1.6.0-cp39-cp39-win_amd64.whl C:\Users\James Carruthers\AppData\Local\Temp\colorama-0.4.4-py2.py3-none-any.whl
> Error 11/27/2022 1:41:51 AM [RhinoCode] ERROR: Invalid requirement: 'C:\\Users\\James'

Yes it does.

Logged as RH-72386 Python initialization fails due to space in path.

Seems to be fixed now