0

I have an application which should running on Python3 with Kivy and Postgresql.

I had my Python3 installed according to the guide from this blog below:

Install Python3

but I realize the Python 3.7 was installed in /home/pi/Python-3.7.2 instead of inside /usr/bin or /usr/local/bin.

I had run the command below to install it in /usr directory

update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2

then I point my python back to Python2 with command below:

sudo update-alternatives --config python

Then, I run my python application with Python3 as below:

python3 script.py

I get segmentation fault

However, if I run it with default python2, the apps able to launch. Does anyone know how can I solve the segmentation fault issue?

  • That command will not install ANYTHING. It will just break python2 – Milliways May 16 at 3:27
  • what do you mean break python2? i thought it is install the python 3.7 into the /usr/bin directory – alpha91 May 16 at 6:26
  • 1
    You continue to fiddle with update-alternatives and try to setup python to point to python 3.7. I am not an expert with update-alternatives, but that like looks like nonsense. YOU DO NOT NEED IT - if you install properly python 3 should just work. – Milliways May 16 at 6:40
  • In addition to the comments by @Milliways, the most recent version of Raspian comes with Python 3 installed already, although it's 3.5 rather than 3.7 according to what I have on my (updated) system right now. You may be better off upgrading your distribution overall. – Brick May 16 at 15:43
  • Separately from the installation, the simplest answer to your question seems to be to run it with the default python2 since you said that works and you haven't given any details about the nature of the segmentation fault or why this is not adequate. – Brick May 16 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.