How to install python package with a different name using PIP

前端 未结 10 2036
忘了有多久
忘了有多久 2020-12-09 07:56

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 p

相关标签:
10条回答
  • 2020-12-09 08:20

    This is not possible with the pip command line tool. All of the packages on PyPI have unique names. Packages often require and depend on each other, and assume the name will not change.

    0 讨论(0)
  • 2020-12-09 08:25

    If you are struggling to install the correct package when using pip install 'module', you could always download its corresponding wheel file (.whl extension) and then install this directly using pip. This has worked for me in various situations in the past.

    0 讨论(0)
  • 2020-12-09 08:25

    I Don't think it is possible to change the name of package by using pip. Because pip can install packages which are exist and gives error if there is no package name which you write for change the name of package.

    0 讨论(0)
  • 2020-12-09 08:27

    I'm guessing that at least one of the packages you refer is not installed from https://pypi.org/ since they enforce unique names for the packages; this means you're installing that package from source, which means you also have the freedom of changing its name to whatever you want. You would do this by changing the setup.py file in the root of the offending package.

    0 讨论(0)
提交回复
热议问题