我最近在PyPi上制作了自己的软件包py3PDB。 与使用pip安装时一样,下载成功
py -m pip install package_name
或
pip install package_name
它回复:
pip install testPyPack
Collecting testPyPack
Downloading testPyPack-0.0.1.tar.gz (2.2 kB)
Using legacy setup.py install for testPyPack, since package 'wheel' is not installed.
Installing collected packages: testPyPack
Running setup.py install for testPyPack ... done
Successfully installed testPyPack-0.0.1
但是,当运行导入包的python脚本时,它会回复
import py3PDB
Traceback (most recent call last):
File "C:\PythonProjects\test.py", line 1, in <module>
import py3PDB
ModuleNotFoundError: No module named 'py3PDB'
我的程序包称为py3PDB,我将以下视频用作教程: https://www.youtube.com/watch?v=zhpI6Yhz9_4
这是项目的目录
PDB
dist
py3PDB.egg-info
pyDialogueBoxes
__init__.py
CHANGELOG.txt
LICENCE.txt
MANIFEST.in
README.txt
setup.py
这是setup.py
from setuptools import setup, find_packages
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Education',
'Operating System :: Microsoft :: Windows :: Windows 10',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3'
]
setup(
name='py3PDB',
version='0.0.1',
description='Dialog Boxes',
long_description=open('README.txt').read() + '\n\n' + open('CHANGELOG.txt').read(),
url='',
author='My Name',
author_email='My Email',
license='MIT',
classifiers=classifiers,
keywords='Dialog, Box',
packages=find_packages(),
install_requires=['pygame']
)