1

Some Python libraries are listed under one name in pip, but imported under a different name in the interpreter.

pycroptodome is a good example. In pip list, you see "pycryptodome". In a Python program, you have to call "import Crypto". "import pycryptodome" gives an error that the module doesn't exist.

Some libraries I've imported are giving me "module not found" errors. I want to see if they're imported under a different name from what appears in pip. Where can I find that data?

For reference, "pip show " and "pip inspect " don't seem to have this information.

Bagheera
  • 1,358
  • 4
  • 22
  • 35
  • 1
    Does this answer your question? [Get available modules](https://stackoverflow.com/questions/3952513/get-available-modules) – Axe319 Dec 02 '22 at 17:56
  • 2
    *"I want to see if they're imported under a different name"*, Best place to check is Package's documentation website - "installation" page in particular. – S.B Dec 02 '22 at 19:05

2 Answers2

0

Here's how you can get the import name:
Open the folder that your packages are installed ( Specified in Location in pip show pycryptodome). Then open the package dist-info folder (pycryptodome-3.16.0.dist-info). open top_level.txt. you can see the name you are looking for.

Masoud Gheisari
  • 949
  • 1
  • 9
  • 21
-1

go https://pypi.org/project/pycryptodome

download the tar file version you downloaded using pip and see the top-level view to see import names

Raqun Bob
  • 156
  • 1
  • 12