Any sort of pip command that contacts pypi is running extremely slow on Ubuntu 18.04.
$ pip install -v pandas
Created temporary directory: /tmp/pip-ephem-wheel-cache-hvbcg1k_
Created temporary directory: /tmp/pip-install-7_spppvw
Collecting pandas
1 location(s) to search for versions of pandas:
* https://pypi.org/simple/pandas/
Getting page https://pypi.org/simple/pandas/
Looking up "https://pypi.org/simple/pandas/" in the cache
Current age based on date: 324440
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
Starting new HTTPS connection (1): pypi.org
Which hangs for ~1-2 minutes (at least).
Using the option --index-url=http://pypi.python.org/simple/
speeds it up a lot, but doesn't seem to be ideal because it skips encryption. Is there any workaround for this?
Going (very slightly) faster by disabling the version check On startup pip may check if you're running the latest version or not, and print a warning if you're not. You can disable this check like so: pip --disable-pip-version-check install ...
If you want to force pip to clear out its download cache and use the specific version you can do by using --no-cache-dir command. If you are using an older version of pip than upgrade it with pip install -U pip. This will help you clear pip cache.
A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python on your computer. To fix it, you will either need to re-install Python and check the box to add Python to your PATH or install pip on your command line.
npm, Homebrew, Yarn, RequireJS, and Bower are the most popular alternatives and competitors to pip.
This symptom can indicate an IPv6 routing or DNS problem. Anyone hitting this might try disabling IPv6 as a workaround until you find the root cause. You can temporarily disable IPv6 on Ubuntu (until next reboot) by doing this:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With