简体   繁体   中英

How PyCharm decides what library to install

If you import a python library and if the library is not installed, PyCharm can automatically install the library for a developer (nice.) (this feature possibly available is other IDEs also). My question is more on how PyCharm determines what library needs to install from the import statement. I could not find a reference or explanation of how it is done. We are doing a study on library dependency management and I am asking the question for that purpose.

For example, consider the following import statement:

from wikibot import WikiBot

but the library needed for this import is: my-wiki-bot and one need to issue the following command: pip install my-wiki-bot (so, the name does not exactly match). An explanation (ie, how the decision is made with a link/reference) would be helpful.

PyCharm has python module to pypi package mapping inside.

Previously it was built by installing packages from https://pypi.org and inspecting what modules become available after some package installation.

Nowadays this mapping is being updated manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM