Learn to program with Minecraft - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Learn to program with Minecraft (/thread-14027.html) Pages:
1
2
|
RE: Learn to program with Minecraft - bolospinga - Aug-07-2019 bonjour je voulais créer un programme de defense anti-joueur avec mes amis en serveur local et je voulais savoir comment on peut choisir un joueur avec pos = mc.player.getTilePos() et si non, quelle commande permet de faire ça? merci de votre reponse RE: Learn to program with Minecraft - railhead - Aug-10-2019 (Nov-11-2018, 11:22 PM)SheeppOSU Wrote: 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: the answer is a lot simpler than you might think, i had the same problem and you just need to make sure your .py file is saved in the same folder that contains your "mcpi" folder RE: Learn to program with Minecraft - ArmansMom - Jun-04-2020 Hi there Larz60+ I have the same problem. I followed your advice but it didn't help. I'm no computer guru. I read in another forum that mcpi has to be in the folder below: program files>python38>lib>site-packages in site-packages folder I have an mcpi folder and an mcpi-1.2.0.dist-info folder despite all these, I get this error in python shell: no module named mcpi your help is greatly appreciated. RE: Learn to program with Minecraft - SheeppOSU - Jun-04-2020 From what you say it looks like it should be working just fine. I suppose it's possible that Python is looking in some other folder. If the mcpi folder is in the right place, then you should be able to import it just fine. I used pip to install it, it somehow ended up in the wrong folder so I moved it to the right one, and then it was working. You can try opening up your Python installer, clicking customize -> next and then seeing what path it says, I think that's the one that it will look in. RE: Learn to program with Minecraft - pyzyx3qwerty - Jun-04-2020 (Aug-07-2019, 04:54 PM)bolospinga Wrote: bonjour je voulais créer un programme de defense anti-joueur avec mes amis en serveur local et je voulais savoir
(Jun-04-2020, 06:18 AM)ArmansMom Wrote: Hi there Larz60+Please start a new thread when you have a problem, don't post it in a thread by another user RE: Learn to program with Minecraft - Larz60+ - Jun-04-2020 SheeppOSU: when you use pip to install a package, never move it from where python installs it. It's put there for a reason, and your code will find it if all was done properly, and probably won't find it if you move it. |