Apr-24-2021, 08:40 PM
(This post was last modified: Apr-24-2021, 08:40 PM by perfectlyGoodInk.)
(Apr-24-2021, 06:13 PM)perfectlyGoodInk Wrote:(Feb-07-2021, 12:41 PM)cezary123 Wrote: Could you please help me? The file is not there and i dont know what to do next. My dad really wants me to learn Python with the book.
We're running into the same problem. We found this link here that suggests running it manually, but that didn't seem to help.
https://nostarch.com/minecrafthelp#pipbug
Also found a setup.py after extracting the minecraftPythonAPI.zip, under the MC_Py_API, and we tried copying it to the directory in the error, but when we ran it again, it complained of a different directory (which I guess is why that directory was under a TEMP directory).
That's where we are now. Still trying to figure it out.
Okay, I got it working! Eventually, I gave up on trying to get the Install_API.bat file or using the command inside it, "python -m pip install minecraftPythonAPI.zip." I did try a few other things, but they didn't seem to do much, so I moved on and installed Spigot (we already had Python installed), and then launched the Spigot server and connected to it. But then the "Testing your Minecraft Python Setup" on page 24 failed.
But as we were somewhat familiar with the Minecraft Python API from David Whale and Martin O'Hanlon's Adventures in Minecraft, I looked for the "mcpi" directory where I had extracted the minecraftPythonAPI.zip file (at the same location as the setup.py I mentioned above).
I then found the place to place it in my Python installation by locating the IDLE (Python 3.7) menu option in the Start menu, right-clicking it, selecting "More" and clicking "Open file location." This brought me to the IDLE shortcut location. I then right-clicked that and again selected "Open file location."
That brought me to the Python directory, and hunting around here for modules brought me to:
"C:\Users\User1\AppData\Local\Programs\Python\Python37\Lib"
I then copied the "mcpi" directory (as well as the "test" directory, but not sure if that's necessary) from where I had extracted the MinecraftAPI into where the Python modules were. After that, the command:
"from mcpi.minecraft import Minecraft"
on page 24 now worked! As did the subsequent examples as well.
Hope that's helpful for you and anyone else who might see this. I didn't see a good place anywhere else documenting how to resolve this issue.