0

I am building a Python Module, and am following this tutorial. However when I run python setup.py sdist, I get:

running sdist
running check
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)

error: package directory 'packagename' does not exist

Here is my directory structure:

packagename  
-setup.py  
-setup.cfg  
-LICENSE  
-README  
-__init__.py   
-(All other files)

Setup.py file (I have replaced things like package names, authors, urls with placeholders.):

from distutils.core import setup
setup(
  name = 'packagename',
  packages = ['packagename'],
  version = '0.1.1',
  license='MIT',
  description = 'description',
  author = 'authorname',
  author_email = 'someone@somewhere.tld',
  url = 'url',
  download_url = 'url',
  keywords = ['GUI', 'Python', 'Tkinter', 'Simple'],
  classifiers=[
    'Development Status :: 4 - Beta',      # Choose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
    'Intended Audience :: Developers',
    'Topic :: Software Development :: Build Tools',
    'License :: OSI Approved :: MIT License',
    'Programming Language :: Python :: 3.6',
    'Programming Language :: Python :: 3.7',
    'Programming Language :: Python :: 3.8',
    'Programming Language :: Python :: 3.9',
  ],
)
Squiggles
  • 21
  • 4
  • There must be the second `packagename`. See https://docs.python.org/3/distutils/examples.html#pure-python-distribution-by-package – phd May 17 '22 at 13:23
  • @phd I don't understand. Can you elaborate? – Squiggles May 17 '22 at 15:44
  • Please see the link in my previous comment. There is an example with directory structure. `setup.py` must be above `packagename`, not at the same level. In the tutorial you linked it's the same — `setup.py` is above `MyLib`. – phd May 17 '22 at 16:01

1 Answers1

0

I had to move the setup file above the main package as suggested by @phd in the 3rd comment in the comment section.

Squiggles
  • 21
  • 4