Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Learn to program with Minecraft
#11
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
Quote
#12
(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:
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'

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
Quote
#13
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.
Quote
#14
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.
Age Doesn't Matter, Your Passion Does
- Shreya Jain
Quote
#15
(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
comment on peut choisir un joueur avec

pos = mc.player.getTilePos()

et si non, quelle commande permet de faire ça?
merci de votre reponse
  1. Please start a new thread for your question
  2. Not everyone understands French, so translate and write in english
Translation in French :
  1. Veuillez commencer un nouveau fil pour votre question
  2. Tout le monde ne comprend pas le français, alors traduisez et écrivez en anglais
(Jun-04-2020, 06:18 AM)ArmansMom Wrote: 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.
Please start a new thread when you have a problem, don't post it in a thread by another user
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Quote
#16
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.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  how to draw terrain like minecraft in python using opengl with perlin noise value? hsunteik 0 3,136 Jan-21-2017, 11:45 AM
Last Post: hsunteik
  how to generate random 3d world (like minecraft) in python hsunteik 3 3,253 Jan-06-2017, 06:35 PM
Last Post: metulburr

Forum Jump:


Users browsing this thread: 2 Guest(s)