[英]What should my project structure be for distributing a personal python package on PyPi?
I'm trying to distribute a personal python package over PyPi.我正在尝试通过 PyPi 分发个人 python 包。 While it successfully pip installs, there's a ModuleNotFound error when I go to import PythonDebuggerTools locally.
虽然它成功安装了 pip,但当我在本地导入 PythonDebuggerTools 时出现 ModuleNotFound 错误。
setup.py设置文件
from setuptools import setup, find_packages
import codecs
import os
import setuptools
VERSION = '0.0.3'
DESCRIPTION = 'Debugging tools'
LONG_DESCRIPTION = 'A package that gives users access to several debugging functionality to make their development process efficient.'
# Setting up
setup(
name='PythonDebuggerTools',
version=VERSION,
author='Aakash Haran',
author_email='email',
description='Testing installation of Package',
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
url='https://github.com/Luna-Cake/Logger',
license='MIT',
# packages=setuptools.find_packages(),
py_modules=['PythonDebuggerTools'],
install_requires=[],
)
My project structure looks like this:我的项目结构如下所示:
>build
>dist
>PythonDebuggerTools-0.0.3.tar.gz
>PythonDebuggerTools
>__init__.py
>logger.py
>PythonDebuggerTools.egg-info
>dependency_links.txt
>PKG-INFO
>SOURCES.txt
>top_level.txt
>README.md
>setup.py
>setup.py~
=======
Any help would be greatly appreciated!任何帮助将不胜感激!
py_modules=['PythonDebuggerTools'],
is for *.py
files.用于
*.py
文件。 There is no PythonDebuggerTools.py
so nothing was added to the wheel package.没有
PythonDebuggerTools.py
所以没有添加到轮包中。
Your PythonDebuggerTools
is an importably directory so declare it as a packge:您的
PythonDebuggerTools
是一个可导入目录,因此将其声明为一个包:
packages=['PythonDebuggerTools'],
See https://packaging.python.org/tutorials/packaging-projects/见https://packaging.python.org/tutorials/packaging-projects/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.