0

So I built and installed a package in python and once I typed pip list it even showed up there:

enter image description here

But when I try importing it within a python script it keeps throwing me errors like this:

enter image description here

I tried using the actual name with which I had built it but to no avail. Please help!

  • 4
    package name cannot include `-`. use `_`. – Boseong Choi Mar 16 '20 at 07:27
  • I did but still is giving me errors, telling me that no such module was found – Abhijith Rao Mar 16 '20 at 07:29
  • My mistake. package can do that. See https://stackoverflow.com/questions/7583652/python-module-with-a-dash-or-hyphen-in-its-name. (Still, not recommended by PEP8) – Boseong Choi Mar 16 '20 at 07:29
  • Now its telling me that no module named my-hist is defined – Abhijith Rao Mar 16 '20 at 07:33
  • What exactly is the module's actual directory name? What's its name given in `setup.py` (may be different)? How have you installed it? How are you trying to import it? — In your original question the immediate problem is that `import my-hist` is invalid syntax, since dashes are invalid in any symbol name (since it's ambiguous with the subtraction operator). If you're going to change something from there, you'll need to tell us what exactly you changed, not just what new problem you're facing. – deceze Mar 16 '20 at 07:50

0 Answers0