Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I force pip to install a package directly from the Internet not local cache?

I was installing the package ibm_db using the command:

pip3 install ibm_db

However, there was a power outage and the installation stopped midway. Now, the package is available in my system:

pip3 list --local | grep ibm
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
ibm-db (3.0.1)

But when I try to import it, it doesn't work.

>>> import ibm_db
>>> ModuleNotFoundError: No module named 'ibm_db

I'm suspecting that something went wrong with the package installation, but every time I try to reinstall (uninstalling, then installing it again) it it uses the locally cached version now, and the problem continues.

I would like to try reinstalling the package straight from the internet, without having to use my local cache, but I don't want to clear the entire local cache.

like image 929
Lusayo Nyondo Avatar asked Aug 24 '19 11:08

Lusayo Nyondo


1 Answers

https://pip.readthedocs.io/en/stable/reference/pip_install/#caching

pip install --no-cache-dir …

PS. But I doubt the problem is in cache. After uninstalling and installing packages again everything must be ok. If it's not — the problem is somewhere else.

like image 117
phd Avatar answered Sep 27 '22 18:09

phd