I uploaded a package on PyPi using twine, and it went fine. Now I'm trying to install that package and importing it into a script.
According to pip the module is already installed correctly:
PS C:\Users\alber> pip install ethbotutils
Requirement already satisfied: ethbotutils in c:\users\alber\appdata\local\programs\python\python39\lib\site-packages (1.1)
But when I try to import it in a script or in a IDE or in Python IDLE i get:
>>> import ethbotutils
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import ethbotutils
ModuleNotFoundError: No module named 'ethbotutils'
This is the pyproject.toml file (stored in the project root):
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
And this the setup.py file (stored withing the package directory):
from setuptools import setup
setup(
name='ethbotutils',
version=1.0,
packages=["."],
install_requires=["requests~=2.25.1", "PyYAML~=5.4.1"],
python_requires=">=3.6"
)
EDIT:
What @a_guest suggested seems to be working: if I import a script present in the package, like "bot_utils" everything works, but it still doens't when I try to import the whole package by its name. How can I fix that?