1

I deleted and reinstalled Ubuntu by following the instructions here but the same issues with pip installation persisted even after I've reinstalled Ubuntu. I suspect that the re-installation process did not totally help me remove Ubuntu.

Just to be clear that the Ubuntu I am installing is a bash shell and not a disk image that requires partitioning - just downloading a copy of Ubuntu from Windows Store would do in my case

How can I cleanly remove all of Ubuntu bash files on (Windows 10 Version 10.0.17763 Build 17763)?

The steps I took to reinstall are:

  1. Uninstall Ubuntu under programs and features
  2. Deselect Windows Subsystem of Linux from apps & features
  3. Restart on clean reboot (as prompted by windows)
  4. Reinstall Ubuntu on Windows Store
  5. Setup
  6. Run sudo apt-get update
  7. Run pip installation

I've seen other methods of uninstalling such as wslconfig.exe /u Ubuntu, but I did the aforementioned way because of the Fall Creators update which allows this method. I'm not sure what's the difference between them and if it will make a difference in my case.

However, the same pip issues persisted, does this way of reinstalling guarantee that I get a fresh copy of python environment? What have I possibly done wrong?

The reason why I wanted to reinstall Ubuntu is because my pip is not functioning properly on only Ubuntu and not on Windows OS. The example is as follows: example

Any advise will be greatly appreciated. Thank you!

Further details about what other stuff I have tried to troubleshoot the pip installation

CACHING

Some recommended to use --no-cache-dir but it did not work and I even tried rm -rf ./cache/pip but that also did not work. So I reinstalled Ubuntu WSL, hoping that it will work but it didn't.

NETWORK ISSUE

ping pypi.org does not work and returns the following message and freezes PING pypi.python.org(2a04:4e42:2::223 (2a04:4e42:2::223)) 56 data bytes

What I have done about this issue:

1.Tried disabling IPv6 as recommended by @Kulfy here

Got the following error:

sysctl: cannot stat /proc/sys/net/ipv6/conf/all/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/default/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/lo/disable_ipv6: No such file or directory

2.Copied and pasted the following into Ubuntu: Tried with sudo and root with the command below

sudo/root

cat >/etc/modprobe.d/blacklist-ipv6.conf <<EOF
# Turn of IPv6 by blacklisting the module.
# Even though it isn't needed.
blacklist ipv6

EOF
$

It returned the following -bash: /etc/modprobe.d/blacklist-ipv6.conf: Permission denied

as recommended here but also did not work

  1. Setting Preferences for IPv4 over IPv6

I have also set preferences for IPv4 by uncommenting these codes and editing the file by doing

sudo vi /etc/gai.conf

and then... uncommenting

#For sites which prefer IPv4 connections change the last line to
precedence ::ffff:0:0/96 100
...
#    For sites which use site-local IPv4 addresses behind NAT there is
#    the problem that even if IPv4 addresses are preferred they do not
#    have the same scope and are therefore not sorted first.  To change
#    this use only these rules:
#
scopev4 ::ffff:169.254.0.0/112  2
scopev4 ::ffff:127.0.0.0/104    2
scopev4 ::ffff:0.0.0.0/96       14

This is as recommended here

This still has not worked. So, it may not be an issue with IPv6

  • What issues did you face with pip? – Kulfy May 23 '20 at 08:46
  • The installation of pip modules took longer than usual. It get stuck at collecting [module name]... Some recommended to use the --no-cache-dir option but I used it to no avail. So I decided to reinstall Ubuntu. – Tan Kin Meng May 23 '20 at 08:48
  • Are you using some antivirus such as KasperSky or firewall? – Kulfy May 23 '20 at 08:49
  • Thank you so much for your quick replies!I currently have McAfee which expired and I tried uninstalling the antivirus as well and I have also disabled Windows defender while running Ubuntu. This issue also does not occur on my Windows. Have added to my original post an image for a more detailed version of my installation procedure – Tan Kin Meng May 23 '20 at 08:56
  • Are you able to run other commands such as sudo apt update successfully? – Kulfy May 23 '20 at 09:03
  • yep all the Ubuntu related installations are normal, but the moment when I try to install pip, the exact same issues like stated repeated itself, which puzzles me because I thought wiping out Ubuntu would have removed all python environments related to Ubuntu – Tan Kin Meng May 23 '20 at 09:05
  • Can you ping pypi.python.org from the venv? – Kulfy May 23 '20 at 09:11
  • It gets stuck like so: ping pypi.python.org -------------------------------------------------------------------------------------------- PING pypi.python.org(2a04:4e42:2::223 (2a04:4e42:2::223)) 56 data bytes and doesn't return anything after that. But, ping 8.8.8.8 has no issues. If it helps, all my issues occured after I made a huge API call to yfinance, I don't know if this clue will help in your troubleshooting? – Tan Kin Meng May 23 '20 at 09:15
  • Try disabling IPv6. – Kulfy May 23 '20 at 09:27
  • Is there a way to know if Ubuntu is running IPv4 or IPv6? I tried to disable IPv6 by going on windows system properties and disabling IPv6 from there, but pinging and pip installing still does not work – Tan Kin Meng May 23 '20 at 09:41
  • https://askubuntu.com/a/484487/816190 – Kulfy May 23 '20 at 09:42
  • I updated my original post, with what I've tried... Thank you for your help so far! – Tan Kin Meng May 23 '20 at 10:18
  • https://askubuntu.com/q/958876 is more specific for WSL. – Kulfy May 23 '20 at 16:37
  • I tried this: "sudo vi /etc/gai.conf". The changes were successfully made, however, running pip3 install [module name] still takes a long time like before. – Tan Kin Meng May 23 '20 at 17:08
  • I'm out of clue for now. This is surely not an issue with PIP. May be someone with more experience in WSL look into this. – Kulfy May 23 '20 at 17:12
  • We have come such a long way, I appreciate your help. Thank you! – Tan Kin Meng May 23 '20 at 17:12
  • Hi Kulfy, I have come back with some more clues. I realised that I pinged 8.8.8.8 and there are packets returned. But, when I ping-ed google.com nothing returns. More research tells me that this could be a network issue. Also, on another laptop connected to the same wifi network, pip installation has no issues. If I provide ifconfig files on both laptops, would that help? – Tan Kin Meng May 24 '20 at 05:42

1 Answers1

1

What to check after reinstallation

In my case, I realised that even after re-installation, the issues persist. However, I realised that Hamachi's LogMeIn client was not in offline mode, which caused its Ethernet connection to interfere with Ubuntu's internet connection (but not on Windows OS). This is why when I pinged google.com it returned PING google.com(2404:6800:4003:c03::8a (2404:6800:4003:c03::8a)) 56 data bytes and stopped. The steps that @Kulfy took to help troubleshoot pointed me in the right direction, which made me realise that there was an additional Ethernet connection running.

In the future, if anyone still faces issue with their internet connection, even after reinstalling, please check that you do not have any antivirus software or other servers running at the same time, which may interfere with your Ubuntu's internet connection.

Go to Control Panel→Network and Internet→Network Connections on Windows to check whether you have additional servers running. Disable them (if found) and retry.

enter image description here

  • 1
    Just out of curiousity, did you got PING pypi.python.org(2a04:4e42:2::223 (2a04:4e42:2::223)) 56 data bytes while pinging google.com? Seems little unconsistency. – Kulfy May 25 '20 at 18:45
  • Hi Kulfy, thanks for the reminder. To answer, your question, yes, when I pinged pypi.python.org I got PING pypi.python.org(2a04:4e42:2::223 (2a04:4e42:2::223)) 56 data bytes . This happens every time the LogMeIn Hamachi server is online, which activated the Ethernet connection. Why is that inconsistent, in your opinion? This only happens with Ubuntu and does not happen with Windows OS command prompt, I'm not sure why that is so? – Tan Kin Meng May 26 '20 at 01:07
  • It seems you didn't read my comment carefully. I wonder why you got PING pypi.python.org while pinging google.com since you mentioned in the answer: when I pinged google.com it returned PING pypi.python.org(2a04:4e42:2::223 (2a04:4e42:2::223)) 56 data bytes and stopped. But you mentioned you got PING pypi.python.org while pinging pypi.python.org. Did you mistype things in the answer? – Kulfy May 26 '20 at 12:00
  • yes, I missed that out, will correct the post for clarification. The correct answer should be PING google.com(2404:6800:4003:c03::8a (2404:6800:4003:c03::8a)) 56 data bytes when google.com is pinged – Tan Kin Meng May 26 '20 at 12:04