The Python Oracle

pip: force install ignoring dependencies

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT


Music by Eric Matyas
https://www.soundimage.org
Track title: A Thousand Exotic Places Looping v001

--

Chapters
00:00 Pip: Force Install Ignoring Dependencies
00:20 Accepted Answer Score 449
00:37 Answer 2 Score 12
01:09 Answer 3 Score 27
01:24 Answer 4 Score 2
01:52 Thank you

--

Full question
https://stackoverflow.com/questions/1275...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pip

#avk47



ACCEPTED ANSWER

Score 449


pip has a --no-dependencies switch. You should use that.

For more information, run pip install -h, where you'll see this line:

--no-deps, --no-dependencies
                        Ignore package dependencies



ANSWER 2

Score 27


Try the following:

pip install --no-deps <LIB_NAME>

or

pip install --no-dependencies <LIB_NAME>

or

pip install --no-deps -r requirements.txt

or

pip install --no-dependencies -r requirements.txt



ANSWER 3

Score 12


When I was trying install librosa package with pip (pip install librosa), this error appeared:

ERROR: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

I tried to remove llvmlite, but pip uninstall could not remove it. So, I used capability of ignore of pip by this code:

pip install librosa --ignore-installed llvmlite

Indeed, you can use this rule for ignoring a package you don't want to consider:

pip install {package you want to install} --ignore-installed {installed package you don't want to consider}



ANSWER 4

Score 2


I came up to this question looking for a resolution when first package requires foo-lib<=1.1 and second package requires foo-lib>=1.0, so incompatible foo-lib==1.2 is forcefully installed (as the newest) during the installation of a second package.

The version can be additionally limited with pip install {second_package} "foo-lib==1.1". (doc)