0

The Pi was originally installed with Python 2.7

To install python 3.4.2, I did the following:

sudo apt install python3; mkdir ~/bin; ln -s /usr/bin/python3
 ~/bin/python

which Python:

/home/pi/bin/python

To revert Python 2.7:

rm ~/bin/python

which Python

/usr/bin/python

If I am in Python 3.4.2:

pi@raspberrypi:~ $ python --version
Python 3.4.2

pi@raspberrypi:~ $ pip install progressbar2

Requirement already satisfied (use --upgrade to upgrade): progressbar2 in /usr/local/lib/python2.7/dist-packages/progressbar2-3.34.3-py2.7.egg
Requirement already satisfied (use --upgrade to upgrade): python-utils>=2.1.0 in /usr/local/lib/python2.7/dist-packages/python_utils-2.2.0-py2.7.egg (from progressbar2)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from python-utils>=2.1.0->progressbar2)
Cleaning up...

The problem is progressbar2 is installed on Python 2.7.

How do I install progressbar2 for Python 3.4.2?

1

If the package is available in Raspbian you should use that repository in preference to the pip repository.

If you must use pip then use the pip3 command to install for Python 3.

  • I tried what you suggested> – Patrick0525 Dec 19 '17 at 18:51
  • pi@raspberrypi:~ $ pip3 install progressbar2 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting progressbar2 Could not fetch URL pypi.python.org/simple/progressbar2: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping Could not find a version that satisfies the requirement progressbar2 (from versions: ) No matching distribution found for progressbar2 pi@raspberrypi:~ $ – Patrick0525 Dec 19 '17 at 18:51
  • I tried pip3 install progressbar2 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available – Patrick0525 Dec 19 '17 at 18:54

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.