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/
Related
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 ?
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
If I uninstall pip with
pip uninstall pip
does it remove all installed packages too?
No. pip is a tool that handles downloading packages and installing them to various locations; those locations are not part of pip's own install directories. As such, removing pip has no effect on installed packages.
(Common paths for installing packages include /usr/lib/<pythonversion> or /usr/local/lib/<pythonversion>.)
That's it, I've some package installed using setuptools i.e. I ran the command python setup.py install from the package source.
My question is, how do I uninstall the package or upgrade it?
Install pip using easy_install:
easy_install pip
and then:
pip uninstall <package>
PS. Probably duplicate.
What are the sequence of steps when we do
$ pip install <package name>
More specific questions
How does pip find the package?
Where does pip store the package?
How to uninstall the package?
1. How does pip find the package?
On the web, from the official repository PyPI (Python Package Index). A complete list of all packages can be found here.
2. Where does pip store the package?
They are installed in your Python directory, depends of your OS. Search about PYTHON_PATH/Lib/sites-packages, you may found packages install through pip :)
3. How to uninstall the package?
pip uninstall <package-name>
In the Python Package Index a.k.a. PyPI.
In your Python installation's Lib\site-packages directory.
Usually with pip uninstall <package-name>