AdamMercado
Posts: 22
Joined: Thu Jul 16, 2015 11:55 pm
Location: Fullerton, CA
Contact: Website Yahoo Messenger AOL

Minecraft Pi installed, but no mcpi folder

Fri Jul 17, 2015 1:33 am

Hi, total Pi noob here.

Recently got a Pi B kit with an SD card already set up with Rasbian so my son can learn a little programming with Python. It's a great little bit of kit and we are really excited to set off on this path of learning. The resources available are great and so appreciated.

So far it's been good, teaching the basics of set up and running Rasbian and some Unix command line stuff. Today though we tried to do the first Minecraft lesson and were stumped right off the bat.

We were able to run and play Minecraft, obviously came pre installed on the card. Great. But when we got to run the first line of Python code in the lesson we got an error. After snooping around its obvious there is no mcpi folder in the home folder and I cannot find any instance of the Minecraft app.

So why, and how do I get it? Do I need to download a special programming version of MC? I am not set up with network access on the Pi yet. Without it I guess I'm out of luck at this point?

Thanks for any advice
AdamM
Raspberry Pi 2 B, Rasbian OS, No mods whatsoever
MacPro3,1, MacOSX 10.8.5, 16GB RAM 2TB

User avatar
B.Goode
Posts: 8024
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Minecraft Pi installed, but no mcpi folder

Fri Jul 17, 2015 6:44 am

I think you might be following an outdated tutorial.

Try this one: https://www.raspberrypi.org/learning/ge ... ecraft-pi/

(There will not be an mcpi folder in your home directory unless you choose to create one. If you are able to run and interact with MineCraft then it is clearly installed.)

User avatar
DougieLawson
Posts: 35525
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Minecraft Pi installed, but no mcpi folder

Fri Jul 17, 2015 9:01 am

Take a look at the Xmas edition of The MagPi Magazine there's six pages on getting Minecraft running on the Pi (and it was updated for the "pre-installed" version before that edition of the mag was published).

http://www.themagpi.com/issue/issue-se1/
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

AdamMercado
Posts: 22
Joined: Thu Jul 16, 2015 11:55 pm
Location: Fullerton, CA
Contact: Website Yahoo Messenger AOL

Re: Minecraft Pi installed, but no mcpi folder

Sun Jul 19, 2015 1:41 am

B.Goode wrote:I think you might be following an outdated tutorial.

Try this one: https://www.raspberrypi.org/learning/ge ... ecraft-pi/

(There will not be an mcpi folder in your home directory unless you choose to create one. If you are able to run and interact with MineCraft then it is clearly installed.)

Thanks for the reply. That is exactly the tutorial I was following. I entered the first line of code and got an error. I'm not near the Pi now so I can't check the exact verbiage of the error. I did some reading trying to find a solution and came across the 'stuffaboutcode' website. There I read that there should be an mcpi folder and I needed to copy some files from it.

Now I'm really stumped
Raspberry Pi 2 B, Rasbian OS, No mods whatsoever
MacPro3,1, MacOSX 10.8.5, 16GB RAM 2TB

User avatar
jbeale
Posts: 3469
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Minecraft Pi installed, but no mcpi folder

Sun Jul 19, 2015 2:59 am

Are you referring to this Python code?

Code: Select all

from mcpi import minecraft
mc = minecraft.Minecraft.create()
mc.postToChat("Hello world")
If so, 'mcpi' is a Python library, not a folder in your home directory. I just tried that first line in Python 2.7.3 interactively on my R-Pi and it worked, even though there is no folder by that name in my home directory. If that first line gives you an error, you don't have the correct Python Minecraft library, meaning you do not have a current updated version of Raspbian (mine is a fresh, current install). However for me the second line failed, because I did not have Minecraft actually running on the Pi ("connection refused"). I tried it again when I had a Minecraft game running, and all three lines worked (and "Hello world" appeared in front of the player.)

Code: Select all

pi@rp22 ~ $ python
Python 2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mcpi import minecraft
>>> mc = minecraft.Minecraft.create()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/mcpi/minecraft.py", line 171, in create
    return Minecraft(Connection(address, port))
  File "/usr/lib/python2.7/dist-packages/mcpi/connection.py", line 17, in __init__
    self.socket.connect((address, port))
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 111] Connection refused

User avatar
jbeale
Posts: 3469
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Minecraft Pi installed, but no mcpi folder

Sun Jul 19, 2015 3:19 am

AdamMercado wrote:Recently got a Pi B kit with an SD card already set up with Rasbian [...] I am not set up with network access on the Pi yet. Without it I guess I'm out of luck at this point?
Sorry I didn't fully read your post. Yes, you want network access in order to update your install to the current version (sudo apt-get update ; sudo apt-get upgrade )

AdamMercado
Posts: 22
Joined: Thu Jul 16, 2015 11:55 pm
Location: Fullerton, CA
Contact: Website Yahoo Messenger AOL

Re: Minecraft Pi installed, but no mcpi folder

Sun Jul 19, 2015 7:21 pm

DougieLawson wrote:Take a look at the Xmas edition of The MagPi Magazine there's six pages on getting Minecraft running on the Pi (and it was updated for the "pre-installed" version before that edition of the mag was published).

http://www.themagpi.com/issue/issue-se1/
Thanks Dougie

Another fantastic learning resource for the Pi. Amazing. I will read through it and see how far I get
Raspberry Pi 2 B, Rasbian OS, No mods whatsoever
MacPro3,1, MacOSX 10.8.5, 16GB RAM 2TB

AdamMercado
Posts: 22
Joined: Thu Jul 16, 2015 11:55 pm
Location: Fullerton, CA
Contact: Website Yahoo Messenger AOL

Re: Minecraft Pi installed, but no mcpi folder

Tue Jul 21, 2015 4:53 am

jbeale wrote:Are you referring to this Python code?

Code: Select all

from mcpi import minecraft
mc = minecraft.Minecraft.create()
mc.postToChat("Hello world")
refused"). I tried it again when I had a Minecraft game running, and all three lines worked (and "Hello world" appeared in front of the player.)
Great reply. Thanks for the details. Yes that's exactly what I was entering into IDLE 3. I read somewhere else that the Minecraft API needed to be copied into the mcpi and I assumed that it was a directory. Makes sense now.

I noticed you were using a shell. I will try that.
Thx so much
Raspberry Pi 2 B, Rasbian OS, No mods whatsoever
MacPro3,1, MacOSX 10.8.5, 16GB RAM 2TB

AdamMercado
Posts: 22
Joined: Thu Jul 16, 2015 11:55 pm
Location: Fullerton, CA
Contact: Website Yahoo Messenger AOL

Re: Minecraft Pi installed, but no mcpi folder

Tue Jul 21, 2015 10:01 pm

Okay, still no luck and started to really ticked off. This is supposed to be easy for teachers and kids. I've followed numerous basic beginner lessons over the past two weeks and none of them yield anything close to the correct result.

I am not an idiot, I know it's not me. I've used computers for almost 30 years. While not a programmer, I know my way around the command line and how to self teach. I repeat, I'm not an idiot. This should be easier.

None of the advice in previous replies above works. None. I've followed it to the character. If I can't get past step one then this whole idea is a complete waste of time.

Please look at the screen images I posted to see exactly what I'm typing and the error messages I get. There is still no mcpi folder and there absolutely unequivocally should be.

Can someone please please please offer some advice that will get me on my way.

https://www.dropbox.com/s/fte94ot53c9ro ... l.jpg?dl=0

https://www.dropbox.com/s/eruhmxb1qpufv ... n.jpg?dl=0

https://www.dropbox.com/s/ax02gn4mpl8vh ... n.jpg?dl=0

Thanks
Adam
Raspberry Pi 2 B, Rasbian OS, No mods whatsoever
MacPro3,1, MacOSX 10.8.5, 16GB RAM 2TB

thomasd538
Posts: 11
Joined: Thu Sep 20, 2012 3:01 pm

Re: Minecraft Pi installed, but no mcpi folder

Thu Jul 30, 2015 4:36 pm

Are you running Python 3 or Python 2. We started with 3 and saw the same error message. We switched to Python 2 and it worked!

I hope that helps.

Tom

User avatar
jbeale
Posts: 3469
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Minecraft Pi installed, but no mcpi folder

Thu Jul 30, 2015 5:06 pm

> There is still no mcpi folder and there absolutely unequivocally should be.

Was my earlier post useful? viewtopic.php?f=91&t=115897#p790874

There is no "mcpi" folder in the home directory /home/pi/ on my RPi 2 with current Raspbian installed, but despite that fact, this tutorial
https://www.raspberrypi.org/learning/ge ... worksheet/ does work for me as expected. If it is not working for you then there must be some other cause for the problem.

Your second screenshot shows a Python error that "no module named mcpi" (note- "module" not "folder"). That means the Python module "mcpi" is not installed. To fix this, you can update your Raspbian install to the current version. You can do that with

Code: Select all

sudo apt-get update
sudo apt-get upgrade
assuming the Pi is connected to the internet. I don't know how to fix it without having the Pi connected to the internet, except by moving it somewhere that you can connect.

If you believe you have a fully updated version, please report the result of typing at the shell prompt:

Code: Select all

uname -a

User avatar
B.Goode
Posts: 8024
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Minecraft Pi installed, but no mcpi folder

Thu Jul 30, 2015 7:18 pm

With apologies for having referred you to the Raspberry Pi Foundation tutorial which I assumed would be reliable, I think there might be a small - but significant - error therein.

It clearly instructs you to use the Python3 entry, which runs the IDLE3 IDE for you, which relies on the python3.2.3 interpreter.

The installed python mcpi module requires to be accessed from python2. You can do this by using the Python entry, which runs the IDLE IDE instead.

On the assumption that this is an error in documentation I have raised it as an Issue with the maintainers of the documentation. https://github.com/raspberrypilearning/ ... /issues/14

AdamMercado
Posts: 22
Joined: Thu Jul 16, 2015 11:55 pm
Location: Fullerton, CA
Contact: Website Yahoo Messenger AOL

Re: Minecraft Pi installed, but no mcpi folder

Sat Aug 01, 2015 2:37 am

Thanks much folks for the replies. After a lot of headbanging and digging around the 'net I found out that in earlier versions of MC that did not come pre installed there was an mcpi folder where all the API files were located. It took forever to realize that things are much different I later versions that come pre installed.

And I found several different methods of initiating the lesson (loading the classes, connecting to the server etc), which confused the issue even more.

Also, yes several tutorials I found stated Python 3 should be used, until I found one that mentioned using Python 2. I tried that and everything worked as expected.

There have been a few hiccups along the way. Some of the code in the Foundation lesson did not work for me (x, y, z position variables for instance) but I was able to workaround by declaring them individually. No worries.

So I was able to work thorough the lesson and then teach it to some 11 yr olds who loved it. Boning up on the next class. Just trying to stay a half step ahead.

So lesson learned, its confusing when things change and you are chasing outdated info. Would be really nice if those who wrote the lessons were able to update the post to mention this is no longer valid. Especially when they have gone to the trouble to write further lessons that are more current. Unfortunately Google is not yet smart enough to discern between the two. Anyhow that's neither here nor there and probably too much to wish for anyway.

Thanks again
Adam
Raspberry Pi 2 B, Rasbian OS, No mods whatsoever
MacPro3,1, MacOSX 10.8.5, 16GB RAM 2TB

mbearden
Posts: 1
Joined: Mon Aug 03, 2015 2:08 am
Location: Georgia, USA

Re: Minecraft Pi installed, but no mcpi folder

Mon Aug 03, 2015 2:20 am

AdamMercado, you saved us with your research and careful explanations. Thanks very much. We too wasted hours attempting to follow online tutorials and a currently in-press Raspberry Pi book. I am concerned for the Raspberry Pi community; hopefully your post will make more people aware of the poor state of affairs for "getting started" documentation. [It seems from the lack of helpful responses to your original post that many RPi users are unaware of just how things are "disintegrating" w.r.t. clear documentation for new beginners. Seemingly there are MAJOR changes to what is installed in a kit, yet with no clear identification of this, or updating of, instructions.] Our problems went beyond just not being able to access the Minecraft API; they began with our kit's documentation not even matching what was on the pre-installed microSD card, so that we could not even follow the first several "getting started" steps. This appears to me to portend failure for the continued spread of this wonderful project platform. It appears that getting started with a new kit is already reaching the point of being "for existing Raspberry Pi experts only" or otherwise for very patient people willing to spend hours Googling and experimenting after discovering that most of their introductory instructions are wrong.

User avatar
ben_nuttall
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 228
Joined: Sun Aug 19, 2012 11:19 am
Location: Cambridge, UK
Contact: Website

Re: Minecraft Pi installed, but no mcpi folder

Mon Aug 03, 2015 4:23 pm

We added Python 3 support a couple of months ago. Run

```bash
sudo apt-get update
sudo apt-get upgrade
```

from the Terminal and you'll have the Python 3 version too.
Community Manager - Raspberry Pi Foundation
Author of GPIO Zero and creator of piwheels

AdamMercado
Posts: 22
Joined: Thu Jul 16, 2015 11:55 pm
Location: Fullerton, CA
Contact: Website Yahoo Messenger AOL

Re: Minecraft Pi installed, but no mcpi folder

Sun Aug 09, 2015 3:53 pm

mbearden wrote:AdamMercado, you saved us with your research and careful explanations. Thanks very much.
Thank you for the reply. I'm glad my rant was in some small way a little help. I wish I was able to help more, I'm such a beginner too as I stumble my way through learning this platform.

It is a shame, but somewhat understandable considering the state of flux something as new and developing as this area of computing. In which case I think it needs special attention, by those reporting or developing resources for, to keep the flow of information in the right direction. Outdated info helps no one in the end. Inconsistent advice will only put off new arrivals to the game.

I wish you the best of luck as you push forward with your learning. I must say once I got over the initial set of frustrations, I have been enjoying playing around with it. My students even completed their first game programmed in minecraft last week, an exercise from the stuffaboutcode site. Very satisfying to see progress as last. I hope we can continue in this manner.
Raspberry Pi 2 B, Rasbian OS, No mods whatsoever
MacPro3,1, MacOSX 10.8.5, 16GB RAM 2TB

AdamMercado
Posts: 22
Joined: Thu Jul 16, 2015 11:55 pm
Location: Fullerton, CA
Contact: Website Yahoo Messenger AOL

Re: Minecraft Pi installed, but no mcpi folder

Sun Aug 09, 2015 3:59 pm

ben_nuttall wrote:We added Python 3 support a couple of months ago. Run

```bash
sudo apt-get update
sudo apt-get upgrade
```

from the Terminal and you'll have the Python 3 version too.
I'll stop short of saying this isn't true, you may very well have added support for Python 3. However the lessons that call for Python 3 to be used do not work for me, and I have to resort to using Python 2. This is a confusing source of confusion that needs to be straightened out I feel.

I have already run the update/upgrade process to no avail. In fact, checking in the GUI package update manager (sorry I cannot recall its name presently, I'm still learning all the nomenclature) it shows minecraft as having an update available, but whenever I try to manually update those packages it fails.



Thanks
Raspberry Pi 2 B, Rasbian OS, No mods whatsoever
MacPro3,1, MacOSX 10.8.5, 16GB RAM 2TB

gman98
Posts: 29
Joined: Sat Jan 02, 2016 4:28 pm

Re: Minecraft Pi installed, but no mcpi folder

Sat Jan 02, 2016 4:35 pm

Oh Adam,

I wish I had read this before spending 3hrs going through the same woes :cry:

I have the exact same issue, I've updated my PI with the latest updates and tried to running through this: https://www.raspberrypi.org/learning/ge ... worksheet/

And it fails saying there's no module named mcpi.minecraft

I spent ages trying to sort this out and remembered and found this thread and remembered I followed a Minecraft whack a mole set of instructions and that also failed, then out of luck I tried to run the Whack a mole using Python 2 and it was fine.

So... there's something wrong here: https://www.raspberrypi.org/learning/ge ... worksheet/ if we've both had the same issue

Can anyone provide a fix to this as it would be great to follow the Python 3 based examples on this site

TIA

gman98
Posts: 29
Joined: Sat Jan 02, 2016 4:28 pm

Re: Minecraft Pi installed, but no mcpi folder

Sat Jan 02, 2016 5:56 pm

Also... I'd just like to say... I think the PI is amazing :D

My 7yr old Son loves Scratch and I'm wanting him to get into Python now and then go further by adding extra goodies to the PI

So for all involved in PI and its support (you guys on here) you have my upmost thanks !!

gman98
Posts: 29
Joined: Sat Jan 02, 2016 4:28 pm

Re: Minecraft Pi installed, but no mcpi folder

Sun Jan 03, 2016 12:23 pm

So after a bit more reading its clear that Minecraft PI does not work with Python 3 but some (including Ben) have looked to port Minecraft PI to Python 3 as you can see here: https://github.com/py3minepi/py3minepi

So for me one of two things should happen really to clear this up:

Either

This https://www.raspberrypi.org/learning/ge ... worksheet/ needs updating (or regressing) to show Python 2 commands not 3

Or

This https://www.raspberrypi.org/learning/ge ... worksheet/ needs updating to say you need to download this https://github.com/py3minepi/py3minepi but bear in mind its still WIP

This would save people a lot of frustration

Thanks

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Minecraft Pi installed, but no mcpi folder

Sun Jan 03, 2016 12:50 pm

If you have the latest version of Raspbian, the Minecraft Pi API python library (mcpi) is Python 3 compatible.

Its important to keep software on the Pi up to date.
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

gman98
Posts: 29
Joined: Sat Jan 02, 2016 4:28 pm

Re: Minecraft Pi installed, but no mcpi folder

Sun Jan 03, 2016 12:58 pm

Thanks LetHopeItsSnowing I can confirm I did this:

https://www.raspberrypi.org/documentati ... pdating.md

Yesterday and restarted the PI before starting on using Minecraft PI with Python 3 and had the same issues Adam had

Is there anything else I should be checking specifically?

TIA

greendogs
Posts: 5
Joined: Sun Oct 11, 2015 4:51 am

Re: Minecraft Pi installed, but no mcpi folder

Mon Jan 04, 2016 9:36 am

Minecraft Pi on Rasbian Jessi has no longer the "mcpi folder". Instead, the installation can be found in "/opt/minecraft-pi".

Python 3 works properly with the Minecraft installation. The problem is that most of the Python examples are old and based on
1. the "mcpi-folder" installation, which needs another import statement
2 the Python scripts are Python 2

And because I plan to use the recent installation for a Python course in school, I started a blog where I try to update all the information related to Python coding and Minecraft Pi.

The blog is not ready but I'm working on it continuously.
http://python-with-minecraft.goprogramming.space/

gman98
Posts: 29
Joined: Sat Jan 02, 2016 4:28 pm

Re: Minecraft Pi installed, but no mcpi folder

Mon Jan 04, 2016 11:32 am

Thanks greendogs

I understand what you are saying but the instructions here: https://www.raspberrypi.org/learning/ge ... worksheet/

And on your site state to use this command:

Code: Select all

from mcpi.minecraft import Minecraft
Which is where it fails for me using Python 3

Even if I type that directly into the Shell it fails saying it cannot find the module mcpi.minecraft

So if you are saying that works fine for you, I must be different? And I'm trying to understand where I should be looking for those differences :)

User avatar
DougieLawson
Posts: 35525
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Minecraft Pi installed, but no mcpi folder

Mon Jan 04, 2016 11:39 am

sudo apt-get install python{,3}-minecraftpi
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Gaming”