I did everything write but the import of minecraft on python wont work. Did they update the code to import it. The book says,"from mcpi.minecraft import Minecraft" The error message is this:
Error:
Traceback (most recent call last):
File "C:/Users/Sheep/OneDrive/Desktop/Ayden/Minecraft Python.py", line 1, in <module>
from mcpi.minecraft import Minecraft
ModuleNotFoundError: No module named 'mcpi'
Quote:I did everything write but the import of minecraft on python wont work.
well, not quite, You need to install 'mcpi'
pip install mcpi
It says install is invalid syntax
I did everything write but the import of minecraft on python wont work. Did they update the code to import it. The book says,"from mcpi.minecraft import Minecraft". I also tried putting "pip install mcpi" on line 1. The error message is this:
Error:
Traceback (most recent call last):
File "C:/Users/Sheep/OneDrive/Desktop/Ayden/Minecraft Python.py", line 1, in <module>
from mcpi.minecraft import Minecraft
ModuleNotFoundError: No module named 'mcpi'
(Nov-12-2018, 03:23 PM)SheeppOSU Wrote: [ -> ]It says install is invalid syntax
Pip is a program, not python syntax. Run
pip install mcpi
from the command line, not from within an interactive python session (or a python script).
I wrote it like this:
pip install mcpi
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
follow this list verbatim:
- open a terminal and bring up a command line (not python, and not in a file).
- on windows, click start
- in box at bottom type cmd
- in the cmd window, type pip install mcpi
- now import in your script. (remove the pip line)