Python Forum
Problems while trying to download API
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems while trying to download API
#1
Hello, im new to Python and im learning it using a book that my dad bought me, titled "learn to program python with minecraft". I downloaded all the things i need, checked my java version, updated my pip, all of that, but when i try to download the API this error message pops up:
Error:
ERROR: Command errored out with exit status 1: command: 'C:\Users\CZAREK\AppData\Local\Programs\Python\Python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\CZAREK\\AppData\\Local\\Temp\\pip-req-build-9vufm6cc\\setup.py'"'"'; __file__='"'"'C:\\Users\\CZAREK\\AppData\\Local\\Temp\\pip-req-build-9vufm6cc\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\CZAREK\AppData\Local\Temp\pip-pip-egg-info-lair170x' cwd: C:\Users\CZAREK\AppData\Local\Temp\pip-req-build-9vufm6cc\ Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\CZAREK\AppData\Local\Programs\Python\Python39\lib\tokenize.py", line 392, in open buffer = _builtin_open(filename, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\CZAREK\\AppData\\Local\\Temp\\pip-req-build-9vufm6cc\\setup.py' ---------------------------------------- WARNING: Discarding file:///C:/Users/CZAREK/Documents/Minecraft%20Python/Minecraft%20Tools/Minecraft%20Tools/minecraftPythonAPI.zip. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I have no idea what any of that means, if anyone could help id greatly appreciate it. Thank you!
buran write Jan-29-2021, 04:23 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply
#2
It appears the critical problem is "FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\CZAREK\\AppData\\Local\\Temp\\pip-req-build-9vufm6cc\\setup.py'". Double check the filepath for that file (and ensure the file is there).
Reply
#3
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.
Reply
#4
(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.
Reply
#5
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  download with internet download manager coral_raha 0 2,960 Jul-18-2021, 03:11 PM
Last Post: coral_raha

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020