WillWam
Posts: 11
Joined: Fri May 17, 2019 9:18 pm

OctaPi - Python Pickle Error

Mon May 20, 2019 10:10 pm

I'm currently figuring out how to make an "OctaPi", but on step 8 of this tutorial (https://projects.raspberrypi.org/en/pro ... n-octapi/8) I get the following error from Dispy when I try to run compute.py:

Dispy - Ignoring node 192.168.1.249 (ValueError: unsupported pickle protocol 4)

I've been trying to fix this for days. Thanks for your help :D

Andyroo
Posts: 3373
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: OctaPi - Python Pickle Error

Mon May 20, 2019 10:23 pm

Are you running under Python 2?

Python 2 does not support protocol 4 so you would need to use Python 3.4 or above. Four is documented here

You can try your version of Python 3 on the Pi by using the command line

Code: Select all

python3 ––version
and check it’s 3.4 or above.
Need Pi spray - these things are breeding in my house...


Andyroo
Posts: 3373
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: OctaPi - Python Pickle Error

Tue May 21, 2019 8:37 am

Any reason you are on Python 3.7? My boxes are a bit out of date but only on 3.5.3

What does the software say to run it on?
Need Pi spray - these things are breeding in my house...

WillWam
Posts: 11
Joined: Fri May 17, 2019 9:18 pm

Re: OctaPi - Python Pickle Error

Tue May 21, 2019 12:18 pm

The tutorial just says 3, (hint from "python3 compute.py", etc.). But since it doesn't say what version, I just did this:

sudo apt-get install python3-dev libffi-dev libssl-dev -y
wget https://www.python.org/ftp/python/3.7.3 ... 7.3.tar.xz
tar xJf Python-3.7.3.tar.xz
cd Python-3.7.3
./configure
make
sudo make install
sudo pip3 install --upgrade pip

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

Re: OctaPi - Python Pickle Error

Tue May 21, 2019 1:16 pm

WillWam wrote:
Tue May 21, 2019 12:18 pm
The tutorial just says 3, (hint from "python3 compute.py", etc.). But since it doesn't say what version, I just did this:

sudo apt-get install python3-dev libffi-dev libssl-dev -y
wget https://www.python.org/ftp/python/3.7.3 ... 7.3.tar.xz
tar xJf Python-3.7.3.tar.xz
cd Python-3.7.3
./configure
make
sudo make install
sudo pip3 install --upgrade pip

I have never used this tutorial, but I wonder if you might have navigated into uncharted waters not considered by the authors at the Raspberry Pi Foundation when they did the documentation?

In the sections about setting up an OctaPi client and an OctaPi server it says "On your micro SD card, install the latest version of Raspbian". And if you do that today the version of Python3 that is installed will be 3.5.3 -

Code: Select all

[email protected]:~ $ apt-cache policy python3
python3:
  Installed: 3.5.3-1
  Candidate: 3.5.3-1
  Version table:
 *** 3.5.3-1 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
        100 /var/lib/dpkg/status
[email protected]:~ $
[email protected]:~ $
[email protected]:~ $ python3 --version
Python 3.5.3
[email protected]:~ $
[email protected]:~ $

Just curious, but not with any inside knowledge, as to whether advancing the version of Python3 beyond that documented might be the source of the problem?

A simple comparison with python v3.5.3 as the interpreter would be interesting...

ejolson
Posts: 3073
Joined: Tue Mar 18, 2014 11:47 am

Re: OctaPi - Python Pickle Error

Tue May 21, 2019 8:12 pm

WillWam wrote:
Mon May 20, 2019 10:10 pm
I'm currently figuring out how to make an "OctaPi", but on step 8 of this tutorial (https://projects.raspberrypi.org/en/pro ... n-octapi/8) I get the following error from Dispy when I try to run compute.py:

Dispy - Ignoring node 192.168.1.249 (ValueError: unsupported pickle protocol 4)

I've been trying to fix this for days. Thanks for your help :D
That's a nice tutorial, except for the pickle.

I have put together an alternate set of instructions for building a Pi cluster here using a more standard approach based on Slurm and MPI. If you continue to have trouble, I recommend trying to setup Slurm and MPI because those systems also work with Python.

WillWam
Posts: 11
Joined: Fri May 17, 2019 9:18 pm

Re: OctaPi - Python Pickle Error

Tue May 21, 2019 9:25 pm

ejolson wrote:
Tue May 21, 2019 8:12 pm
WillWam wrote:
Mon May 20, 2019 10:10 pm
I'm currently figuring out how to make an "OctaPi", but on step 8 of this tutorial (https://projects.raspberrypi.org/en/pro ... n-octapi/8) I get the following error from Dispy when I try to run compute.py:

Dispy - Ignoring node 192.168.1.249 (ValueError: unsupported pickle protocol 4)

I've been trying to fix this for days. Thanks for your help :D
That's a nice tutorial, except for the pickle.

I have put together an alternate set of instructions for building a Pi cluster here using a more standard approach based on Slurm and MPI. If you continue to have trouble, I recommend trying to setup Slurm and MPI because those systems also work with Python.
I would except I've worked through MPI, not a huge fan, and I've gone through 8 different ways of doing this, and this is the most promising. I have to stick with this one

WillWam
Posts: 11
Joined: Fri May 17, 2019 9:18 pm

Re: OctaPi - Python Pickle Error

Tue May 21, 2019 9:27 pm

B.Goode wrote:
Tue May 21, 2019 1:16 pm
WillWam wrote:
Tue May 21, 2019 12:18 pm
The tutorial just says 3, (hint from "python3 compute.py", etc.). But since it doesn't say what version, I just did this:

sudo apt-get install python3-dev libffi-dev libssl-dev -y
wget https://www.python.org/ftp/python/3.7.3 ... 7.3.tar.xz
tar xJf Python-3.7.3.tar.xz
cd Python-3.7.3
./configure
make
sudo make install
sudo pip3 install --upgrade pip

I have never used this tutorial, but I wonder if you might have navigated into uncharted waters not considered by the authors at the Raspberry Pi Foundation when they did the documentation?

In the sections about setting up an OctaPi client and an OctaPi server it says "On your micro SD card, install the latest version of Raspbian". And if you do that today the version of Python3 that is installed will be 3.5.3 -

Code: Select all

[email protected]:~ $ apt-cache policy python3
python3:
  Installed: 3.5.3-1
  Candidate: 3.5.3-1
  Version table:
 *** 3.5.3-1 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
        100 /var/lib/dpkg/status
[email protected]:~ $
[email protected]:~ $
[email protected]:~ $ python3 --version
Python 3.5.3
[email protected]:~ $
[email protected]:~ $

Just curious, but not with any inside knowledge, as to whether advancing the version of Python3 beyond that documented might be the source of the problem?

A simple comparison with python v3.5.3 as the interpreter would be interesting...
'python3' wasn't a command on my fresh version of Raspbian Lite

Andyroo
Posts: 3373
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: OctaPi - Python Pickle Error

Tue May 21, 2019 9:34 pm

Strange, I’ve built two Pi Zeros and one 3B+ since the new version of Lite came out and all are running Python3 fine.

I would be tempted to create a new SD card and let’s try to work out why you cannot see Python 3...
Need Pi spray - these things are breeding in my house...

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

Re: OctaPi - Python Pickle Error

Tue May 21, 2019 10:21 pm

'python3' wasn't a command on my fresh version of Raspbian Lite
I have been trying to help on the premise that you were following the Raspberry Pi Foundation documentation referenced in your initial post.

Since that is not the case I will withdraw from the discussion.

WillWam
Posts: 11
Joined: Fri May 17, 2019 9:18 pm

Re: OctaPi - Python Pickle Error

Wed May 22, 2019 9:20 pm

Andyroo wrote:
Tue May 21, 2019 9:34 pm
Strange, I’ve built two Pi Zeros and one 3B+ since the new version of Lite came out and all are running Python3 fine.

I would be tempted to create a new SD card and let’s try to work out why you cannot see Python 3...
I got python 3.5 to work, but still getting the error

Andyroo
Posts: 3373
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: OctaPi - Python Pickle Error

Thu May 23, 2019 12:17 am

WillWam wrote:
Wed May 22, 2019 9:20 pm
Andyroo wrote:
Tue May 21, 2019 9:34 pm
Strange, I’ve built two Pi Zeros and one 3B+ since the new version of Lite came out and all are running Python3 fine.

I would be tempted to create a new SD card and let’s try to work out why you cannot see Python 3...
I got python 3.5 to work, but still getting the error
Which error?
Need Pi spray - these things are breeding in my house...

Return to “Beginners”