SDIST在将软件包上传到PYPI时显示错误

发布于 2025-01-30 06:04:11 字数 1654 浏览 2 评论 0原文

我正在构建一个python模块,并且正在关注此教程。 但是,当我运行python setup.py sdist时,我得到:

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

error: package directory 'packagename' does not exist

这是我的目录结构:

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

setup.py文件(我替换了诸如包装名称,作者,带有占位符的URL之类的内容。):

from distutils.core import setup
setup(
  name = 'packagename',
  packages = ['packagename'],
  version = '0.1.1',
  license='MIT',
  description = 'description',
  author = 'authorname',
  author_email = '[email protected]',
  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',
  ],
)

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 = '[email protected]',
  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',
  ],
)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄人书 2025-02-06 06:04:11

我必须按照@PHD在评论部分的第三评论中建议将设置文件移至主包上方。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文