Score:0

Unable to install pip into WSL (Ubuntu)?

kz flag

I have successfully setup WSL on my Windows 10. I have also successfully downloaded and installed Python3. However, I am unable to get pip. How do I get pip?

gyu@LAPTOP-PR3:/mnt/c/Windows/system32$ python3 --version
Python 3.8.2
gyu@LAPTOP-PR3:/mnt/c/Windows/system32$ python3 -m pip list
/usr/bin/python3: No module named pip
gyu@LAPTOP-PR3:/mnt/c/Windows/system32$ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-pip' has no installation candidate
gyu@LAPTOP-PR3:/mnt/c/Windows/system32$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip

EDIT:

Here is the output from the sudo apt-get update

Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out
Err:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
Err:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
Err:4 http://security.ubuntu.com/ubuntu focal-security InRelease
  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
karel avatar
sa flag
Does this answer your question? [0% \[Connecting to archive.ubuntu.com (2001:67c:1360:8001::17)\]](https://askubuntu.com/questions/949663/0-connecting-to-archive-ubuntu-com-200167c1360800117)
kz flag
ok what I can see is that using ping6 does not work, ping6 www.google.com fails
muru avatar
us flag
Have you run `sudo apt-get update` yet? What's the output?
kz flag
Is the apt-get update supposed to work in the WSL?
user535733 avatar
cn flag
Looks like you have two separate, unrelated problems. 1) You have a networking problem. Solve that first. 2) python3-pip is in the `universe` pocket of the Ubuntu repositories. Looks like you don't have that pocket enabled. [How to enable the Universe pocket](https://askubuntu.com/questions/148638/how-do-i-enable-the-universe-repository)
NotTheDr01ds avatar
vn flag
@quantum231 And yes, to be clear, `sudo apt update` should work on WSL (all versions). As noted, if it isn't, there's a more general issue going on. Can you access other sites? E.g. `ping stackoverflow.com`?
kz flag
Yes, ping works fine. There is no VPN. This is the first time I am using WSL. I only installed in today you see.
kz flag
I just tried ping command with security.ubuntu.com and archive.ubuntu.com, both work with ping but the apt-get update still does not work, I am lost.
dboggs95 avatar
to flag
I would wipe my python install and try the instructions here. https://askubuntu.com/a/1459889/1682329 I had a similar issue, different error message. This should work. The benefit of this approach is that you are only installing pip for the version of python you want, whereas the normal apt command will cause it to install pip with the latest python.
sy flag
Can you get a `pip` update package so you can update locally if the network is blocked?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.