Remember
this thread?
I was trying to determine from you how you came to have several versions of Python on your Pi. The commands you used like:
Ivan219 wrote:rm /usr/bin/python3
ln -s /usr/local/bin/python3 /usr/bin/
ln -s /usr/local/bin/pip3 /usr/bin/
won't properly remove or delete python, they will however break your Python installation making it difficult to add, remove, or get anything to work.
Try the following commands to completely remove all versions of Python3, RPi.GPIO and pip3 from your Pi.
Code: Select all
sudo apt-get purge python3-pip
sudo apt-get purge python3-rpi.gpio
sudo apt-get purge python3*
Follow the prompts and report any error messages.
Hopefully, this will get rid your damaged Python3 installation.
Reboot.
Get your Pi up to date with:
Code: Select all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
Follow the prompts and report any error messages
Reboot.
Install Python3 with:
Report any messages from apt-get.
Install RPi.GPIO for Python3 with:
Code: Select all
sudo apt-get install python3-rpi.gpio
Report any messages from apt-get
Copy and save the following program to your home directory as "testing+RPI+P3.py"
Code: Select all
#!/usr/bin/env python3
import RPi.GPIO as GPIO
print(GPIO.VERSION)
Make the file executable with the command:
Run the program from your home directory with:
Report the output.
If you cannot get this to work, I would advise that you back up any data you have on the SD card, and re install Raspbian.
Hope this helps,
Dave.