__author__ = '神秘的·'
__date__ = '2020/7/17'
import codecs,os
def read(fname):
'''
定义read(),用来读取目录下的长描述
我们一般将README文件中的内容读取出来叫做长描述,这个会在pypi中你的包的页面展现出来
你也可以不用此办法,直接手动写内容
pypi上支持.rst格式的文件,暂时不支持md格式;rst格式的文件在pypi上会自动转化为html形式显示在你的包的信息页面上
'''
return codecs.open(os.path.join(os.path.dirname(__file__),fname)).read()
'''with open("LICENCE.txt", "r") as L:
R=L.read()'''
setup(
name='ycc', # 名称
#py_modules=['__main__'],
version='1.0',
description='三圆计算器,cmd或命令行python -m __main__.py 命令开始运行(just wait a few days,I need find the ways for
run',
long_description=read('README.rst'),
platforms=['Linux', 'Windows', 'MacOS'],
classifiers=[
'Operating System :: MacOS',
'Operating System :: Windows',
'Operating System :: Linux',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Intended Audience :: Developers',
],
keywords=('3y', 'a_3y','Circle','Cylinder','Circular ring','a','py','windows'),# 关键字
author='神秘的·', # 作者
author_email='3046479366@qq.com', # 邮箱
url='http://github.com', # 包含包的项目地址
license='MIT', # 授权方式
packages=["p"],
#package_data = {'p': ['*.py']},
# package_dir={'p':'y','p':'yh','p':'yz','p':'__main__'},
#data_files='p/*.py',
install_requires=['pdsystem'],
entry_points = {
'console_scripts': [
'ycc = p.__main__:main',
]
},
include_package_data=True,
zip_safe=True,)
```python
以上是setup
/storage/emulated/0 $ cd ycc
/storage/emulated/0/ycc $ python setup.py sdist upload /data/data/ru.iiec.pydroid5/files/arm-linux-androideabi/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'package_d' warnings.warn(msg) running sdist running egg_info writing ycc.egg-info/PKG-INFO writing dependency_links to ycc.egg-info/dependency_links.txt writing requirements to ycc.egg-info/requires.txtwriting top-level names to ycc.egg-info/top_level.txt reading manifest file 'ycc.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: manifest_maker: MANIFEST.in, line 5: 'recursive-include' expects
warning: no previously-included files matching '*.pyc' found anywhere in distribution
adding license file 'LICENCE.txt'
writing manifest file 'ycc.egg-info/SOURCES.txt'
running check
creating ycc-1.0
creating ycc-1.0/p
creating ycc-1.0/ycc.egg-info
copying files to ycc-1.0...
copying LICENCE.txt -> ycc-1.0
copying MANIFEST.in -> ycc-1.0
copying README -> ycc-1.0
copying README.html -> ycc-1.0
copying README.md -> ycc-1.0
copying README.rst -> ycc-1.0
copying README.txt -> ycc-1.0
copying init.py -> ycc-1.0
copying main.py -> ycc-1.0
copying pyproject.toml -> ycc-1.0
copying requirements.txt -> ycc-1.0
copying setup.py -> ycc-1.0
copying p/init.py -> ycc-1.0/p
copying p/beginnings.py -> ycc-1.0/p
copying p/log.py -> ycc-1.0/p
copying p/y.py -> ycc-1.0/p
copying p/yh.py -> ycc-1.0/p
copying p/yz.py -> ycc-1.0/p
copying ycc.egg-info/PKG-INFO -> ycc-1.0/ycc.egg-info
copying ycc.egg-info/SOURCES.txt -> ycc-1.0/ycc.egg-info
copying ycc.egg-info/dependency_links.txt -> ycc-1.0/ycc.egg-info
copying ycc.egg-info/requires.txt -> ycc-1.0/ycc.egg-info
copying ycc.egg-info/top_level.txt -> ycc-1.0/ycc.egg-info
copying ycc.egg-info/zip-safe -> ycc-1.0/ycc.egg-info
Writing ycc-1.0/setup.cfg
Creating tar archive
removing 'ycc-1.0' (and everything under it)
running upload
Traceback (most recent call last):
File "setup.py", line 51, in
zip_safe=True,)
File "/data/data/ru.iiec.pydroid5/files/arm-linux-androideabi/lib/python3.6/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/data/data/ru.iiec.pydroid5/files/arm-linux-androideabi/lib/python3.6/distutils/core.py", line 196, in setup
dist.run_commands()
File "/data/data/ru.iiec.pydroid5/files/arm-linux-androideabi/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/data/data/ru.iiec.pydroid5/files/arm-linux-androideabi/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/data/data/ru.iiec.pydroid5/files/arm-linux-androideabi/lib/python3.6/distutils/command/upload.py", line 63, in run
self.upload_file(command, pyversion, filename)
File "/data/data/ru.iiec.pydroid5/files/arm-linux-androideabi/lib/python3.6/distutils/command/upload.py", line 161, in upload_file
body.write(value)
TypeError: a bytes-like object is required, not 'str'
/storage/emulated/0/ycc $
```shell
报错结果
求解决