pip install -find-links search order - python

I am trying to install a package built by myself, but there is a package with same name on PYPI.
I tried with pip install my_package==1.2.0 --find-links page_html_with_link_to_package, but it downloaded the package from PYPI with same version 1.2.0.
Then I tried with pip install my_package==1.2.0 --find-links page_html_with_link_to_package --no-index, and it downloaded my package.
It's that normal? And if there is any other ways to download my package without --no-index?
Thanks!

Yes, this is normal. Check these examples below on official documentation of pip install, example 9. Install from alternative package repositories > Install from a local flat directory containing archives (and don’t scan indexes):
pip install --no-index --find-links=file:///local/dir/ SomePackage
pip install --no-index --find-links=/local/dir/ SomePackage
pip install --no-index --find-links=relative/dir/ SomePackage
or if you have it hosted somewhere else, then you can just use:
pip install --index-url http://my.package.repo/simple/ SomePackage

Related

How to tell pip to install all packages in build-system.requires

I am transitioning from requirements.txt to pyproject.toml
In it I specified a list of required packages in project.dependencies, and the same list + additional packages in build-system.requires.
However if I run:
python -m pip install .
It seems to install only packages listed in project.dependencies
How do I tell pip to install all packages listed in build-system.requires ?

How to prevent pip install the latest version package if the package has installed [duplicate]

Is there any way to force install a pip python package ignoring all it's dependencies that cannot be satisfied?
(I don't care how "wrong" it is to do so, I just need to do it, any logic and reasoning aside...)
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
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
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}

Python install_requires points to test-pypi

If I publish a package A on pypi that depends on package B on test-pypi, how to make user able to run pip install A instead of pip install -i https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ PACKAGE_NAME?

Uninstall a package installed with `pip install .`

When installing Python packages from development repositories, I usually navigate to wherever setup.py is found and do
pip install .
This installs the package in $HOME/.local/. Nice.
How can I uninstall a package installed this way?
Simply run pip uninstall package-name
That's all you need.
For more follow this link : https://pip.pypa.io/en/stable/reference/pip_uninstall/

pip: force install ignoring dependencies

Is there any way to force install a pip python package ignoring all it's dependencies that cannot be satisfied?
(I don't care how "wrong" it is to do so, I just need to do it, any logic and reasoning aside...)
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
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
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}

Categories

Resources