Cant run sample python scripts

Hi there

I’m new to scripting in Rhino but keen to get started.
I have been following the documentation on using python scripts in rhino but am having trouble running any of Rhino’s sample python scripts.

I have included a screenshot of the error I get when I try run the “Hellopython” script using the “Runpythonscripts” from within rhino:

Am I overlooking something simple here? … probably…

What version of Rhino for Mac do you have?

Sorry forgot to included that in my original post. I’m on 5.2

Works fine here in the 6 WIP, I could test later. I maybe missing something since it has been a while since I looked at where the rhino python files need to be. If that matters now. This is a script I have to calculate metal weight from objects. Ran fine.

Randy

Have you by any chance installed different versions of Python independently from Rhino?

I’m sorry mate you’ll have to forgive my negligence.

-Maybe?

I have installed Atom and with it the rhino python scripting package as I have also been trying to make that work.

No, an Atom install shouldn’t cause a problem, it doesn’t install Python.

I know we have had problems on the Windows side with multiple IronPython installs, but I don’t know how it works on the Mac side. Installing the current versions of Rhino for Mac should install the correct IronPython for Rhino automatically. Someone else who is more familiar with the Mac environment will have to answer here…

Here is where your IronPython should reside … I can check later. I did post something years ago about checking to make sure you have the right python installed on macOS for Rhino. I believe it is still using 2.7 and not 3. I do have separate installs of python but in my Applications folder and not in my system Phyton that comes with macOS.

maybe reinstall rhino or try a restart of your computer. Off to work I will check later.

Hmmmm looks like mine is in a similar place

34

I like the theme you are using for finder there by the way, is that third party software or is this now a new feature for the os ?

Mojave (10.14.*) dark theme.

1 Like

The only time I’ve seen this error was on windows and restarting Rhino fixed it.

Do scripts that don’t import the scriptcontext work? A simple script like:

print "Hello Rhino"

for example.

1 Like

Yes, Mojave dark theme and columns view in Finder. Like @nathanletwory said!

1 Like

Heya Guys

I’m really sorry for the late reply. Work took up all of my available attention for the rest of yesterday

After coming in this morning, on start up, this problem seems to have resolved itself.
I must assume that as suggested in your helpful posts above that a restart may have been all that was needed to resolve this issue.

Thanks again for throwing in your two cents

1 Like