Python setuptools develops the command: "No module named ..."

I am trying to install the python package that I developed using the setuptools development team.

[sidenote: There is a wealth of information about this on the Internet (distutils, distutils2, setuptools, distribution). setuptools and development is, as far as I can tell, the most modern / best way to use a piece of code that is in development. Maybe I'm wrong.]

Here is what I did:

(1) I placed an empty __init__.py in the directory with my Python code.

(2) I did setup.py:

from setuptools import setup, find_packages
setup(name = "STEM_pytools",
      version = "0.1",
      packages = find_packages(),

      author = "Timothy W. Hilton",
      author_email = "my@email.address",
      description = "visualization and data pre-/post-processing tools for STEM",
      license = "",
      keywords = "STEM",
      url = "")

(3) I ran

python setup.py develop

It seemed to go on without problems.

However, when I try to use the package, I get:

>>> import STEM_pytools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named STEM_pytools

: , " STEM_pytools". . !

+4
1

, , . , setup.py .

, setup.py:

STEMpytools/
    setup.py
    stem_pytools/
        __init__.py
        source1.py
        source2.py
        ...
        sourceN.py

, , setup.py:

STEMpytools/
    setup.py
    __init__.py
    source1.py
    source2.py
    ...
    sourceN.py

: http://bashelton.com/2009/04/setuptools-tutorial/
, python, :

import stem_pytools
import stem_pytools.source1

, __init__.py , setup.py. setuptools distutils, .

+2

Source: https://habr.com/ru/post/1535443/


All Articles