packaging-problems icon indicating copy to clipboard operation
packaging-problems copied to clipboard

Cannot import installed package

Open icedwater opened this issue 2 years ago • 2 comments

OS version

Ubuntu 22.04

Python version

3.10.12

Pip version

23.1.2

Guide link

https://packaging.python.org/en/latest/tutorials/packaging-projects/#installing-your-newly-uploaded-package

Problem description

I uploaded a package called example_package_xyz-uncontactable to TestPyPi and installed it with the pip command in this section.

However, I was not able to find a correct way to type the package name to import it.

Error message

No response

icedwater avatar Nov 13 '23 15:11 icedwater

The package name you use is independent from the names of the modules or packages that are installed.

What name did you use inside the src directory (from the step https://packaging.python.org/en/latest/tutorials/packaging-projects/#a-simple-project) ? For that, the Python rules about importable modules apply: hyphens are not possible, only letters numbers underscores.

merwok avatar Nov 13 '23 15:11 merwok

The package name you use is independent from the names of the modules or packages that are installed.

What name did you use inside the src directory (from the step https://packaging.python.org/en/latest/tutorials/packaging-projects/#a-simple-project) ? For that, the Python rules about importable modules apply: hyphens are not possible, only letters numbers underscores.

Thanks for the quick reply! I'm sorry I guess I missed that part of the instructions. I'll try the package name in the morning.

icedwater avatar Nov 13 '23 16:11 icedwater