jebukaty
Posts: 9
Joined: Tue May 02, 2017 4:31 pm

Downloading python won't work

Tue May 02, 2017 4:35 pm

I have been trying to download python on to my raspberry pi but I keep getting this message:
Sub-process /usr/bin/dpkg returned an error code (1)
If someone could help me that would be great

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Downloading python won't work

Tue May 02, 2017 5:03 pm

What OS do you use?
Python is already installed on Raspbian, so what exactly are you trying to install?

Please post full command you used plus the *full* error message.

jebukaty
Posts: 9
Joined: Tue May 02, 2017 4:31 pm

Re: Downloading python won't work

Tue May 02, 2017 5:32 pm

I just downloaded Raspbian Jessie the other day, but then I was having issues with python. So, I uninstalled python and tried to re-install it. But I kept getting the error.

pi@raspberrypi:~ $ sudo apt-get install python
Reading package lists... Done
Building dependency tree
Reading state information... Done
python is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
/bin/sh: 1: /usr/bin/apt-listchanges: not found
Setting up alacarte (3.11.91-2+rpi4) ...
/var/lib/dpkg/info/alacarte.postinst: 6: /var/lib/dpkg/info/alacarte.postinst: pycompile: not found
dpkg: error processing package alacarte (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up python-sense-hat (2.2.0-1) ...
/var/lib/dpkg/info/python-sense-hat.postinst: 6: /var/lib/dpkg/info/python-sense-hat.postinst: pycompile: not found
dpkg: error processing package python-sense-hat (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up python-virtualenv (1.11.6+ds-1) ...
/var/lib/dpkg/info/python-virtualenv.postinst: 6: /var/lib/dpkg/info/python-virtualenv.postinst: pycompile: not found
dpkg: error processing package python-virtualenv (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up python-minecraftpi (0.1.1-4) ...
/var/lib/dpkg/info/python-minecraftpi.postinst: 6: /var/lib/dpkg/info/python-minecraftpi.postinst: pycompile: not found
dpkg: error processing package python-minecraftpi (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
alacarte
python-sense-hat
python-virtualenv
python-minecraftpi
E: Sub-process /usr/bin/dpkg returned an error code (1)

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

Re: Downloading python won't work

Wed May 03, 2017 10:21 am

Since no-one knowledgeable about fixing this has contributed, this is my take on it...

Both Python and Python3 are installed and ready to use in the 'full' release of Raspbian Jessie.

So it seems you set about 'fixing' something that was not - or should not have been - broken. In the absence of details about what you changed it seems possible that your OS installation may now be damaged/corrupted in unknown ways with consequent unknown implications.

I would suggest doing a fresh installation of Raspbian Jessie, maybe onto a new/spare microSD card, and retry your initial experiments with Python and seek advice at that stage if Python does not run as you expect.

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Downloading python won't work

Wed May 03, 2017 10:39 am

^ i concur
have you got a fake sdcard ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

hippy
Posts: 7909
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Downloading python won't work

Wed May 03, 2017 1:35 pm

Code: Select all

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
I have ended up in that situation. It is worth rebooting, doing an 'update', 'upgrade' and 'dist-upgrade' to see if that fixes things. If not there's always a complete re-installation - The best feature of the Pi that you cannot brick it unless you damage its hardware.

Return to “Troubleshooting”