How to install pip for python 3 in ubuntu 18.04?

I have followed some online solution , Please help thank!

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install libssl-dev openssl libreadline-dev
$ cd ~
$ wget
$ tar zxf Python-3.6.1.tgz
$ cd Python-3.6.1
$ ./configure
$ make
$ sudo make install

but after install the Python3 i can not import the telepot

peter@dvr:~$ python3 --version
Python 3.6.1
peter@dvr:~$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
peter@dvr:~$ python3
Python 3.6.1 (default, Dec 27 2019, 10:01:53)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import telepot
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/peter/.local/lib/python3.6/site-packages/telepot/__init__.py", line 346, in <module> from . import api File "/home/peter/.local/lib/python3.6/site-packages/telepot/api.py", line 1, in <module> import urllib3 File "/home/peter/.local/lib/python3.6/site-packages/urllib3/__init__.py", line 7, in <module> from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url File "/home/peter/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 39, in <module> from .response import HTTPResponse File "/home/peter/.local/lib/python3.6/site-packages/urllib3/response.py", line 3, in <module> import zlib
ModuleNotFoundError: No module named 'zlib'
>>>
1

1 Answer

Step 1: Updating the package list using the following command:

sudo apt update

Step 2: Use the following command to install pip for Python 3:

sudo apt install python3-pip

Step 3: Once the installation is complete, verify the installation by checking the pip version:

pip3 --version

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like