When installing a new python package with PIP, can I change the package name because there is another package with the same name?
Or, how can I change the existing package's name?
How do I Install a Specific Version of a Python Package? To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1.
To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
It's not possible to change "import path" (installed name) by specifying arguments to pip. All other options require some form of "changes to the package":
A. Use pip install -e git+http://some_url#egg=some-name
: that way even if both packages have the same import path, they will be saved under different directories (using some-name
provided after #egg=
). After this you can go to the source directories of packages (usually venv/src/some-name
) and rename some folders to change import paths
B-C. Fork the repository, make changes, then install the package from that repository. Or you can publish your package on PyPI using different name and install it by name
D. use pip download
to put one of the packages in your project, then rename folders as you like
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