arpruss / raspberryjammod

Raspberry Jam Mod - a Mod Forge Minecraft mod implementing most of Raspberry Juice/Pi API
http://www.instructables.com/id/Python-coding-for-Minecraft/
Other
348 stars 94 forks source link

Cannot run program on Mac #62

Closed KyngK closed 2 years ago

KyngK commented 2 years ago

I was following the instructable (https://www.instructables.com/Python-coding-for-Minecraft/), and it says if the error with "cannot run program" comes up, then you should add python to your path. I added python to my path, but when running my script it comes up with an error that says "Error java.io.IOException: Cannot run program "python" (in directory "mcpipy"): error=2, No such file or directory". I know the script is there, since when I try to run a script name that isn't there it says "Cannot find script". Is there something else I need to do for it to work?

I'm using version 1.8.9

arpruss commented 2 years ago

Do you have python installed on your machine? (Try it in Terminal.) If so, go to the mod's options and set the directory for the python binary.

KyngK commented 2 years ago

Do you have python installed on your machine? (Try it in Terminal.) If so, go to the mod's options and set the directory for the python binary.

I do. Where are the mod options?

arpruss commented 2 years ago

In the game menu.

KyngK commented 2 years ago

In the game menu.

That worked, thanks! One quick question: Where is the documentation for the api? It says it's at mcpipy.com but that link doesn't exist

arpruss commented 2 years ago

You can probably find the old website on the way back machine at archive.org Does the example code, e.g., donut.py, work?

KyngK commented 2 years ago

You can probably find the old website on the way back machine at archive.org Does the example code, e.g., donut.py, work?

I found it - thank you!

Does the example code, e.g., donut.py, work?

The donut.py does not work, since it is using the from mine import *, which the mine module is not defined (it needs to be mcpi). I tried fixing this but then more errors in the code came up from the actual mcpi module. I tried the benchmark.py file, however, and it worked with no modification.

By the way, thank you so much for this mod!! I've always wanted to program in Minecraft (without mcfunction/datapacks), and I know python fairly well, so this is super helpful to me (:

arpruss commented 2 years ago

There is no mine.py in the same directory as donut.py?

KyngK commented 2 years ago

There is no mine.py in the same directory as donut.py?

OHHHH I didn't put all the py files in there... that makes sense. Sorry that was a stupid mistake on my part. Everything works otherwise. Thank you!!