python egg包的制作与安装
2013-07-18 08:35
295 查看
本文地址:/content/684628.html
plaincopyprint?
setup(
name = "spch2008",
version="0.1.1",
packages = find_packages(),
zip_safe = False,
description = "first egg",
author = "sunpch",
author_email = "sunpch@foxmail.com",
license = "GPL",
platforms = "Independant"
)
上述配置写在setup中过于庞大,如果继续添加参数,导致setup函数参数过于臃肿,此时,可以将配置参数写在配置文件中。
setup.cfg
[plain] view
plaincopyprint?
[metadata]
name = spch2008
version = 0.1.1
zip_safe = False
description = first egg
author = sunpch
author-email = sunpch@foxmail.com
license = GPL
platforms = Independant
[files]
packages = spch2008
setup.py
[python] view
plaincopyprint?
from setuptools import setup
setup(
setup_requires=['d2to1>=0.2.10,<0.3'],
d2to1=True
)
创建目录文件spch2008/__init__.py
[plain] view
plaincopyprint?
def hello():
print "info : Hello World!"
if __name__ == "__main__":
hello()
目录格式:
[plain] view
plaincopyprint?
root@nova-controller:/home/sun/egg# ls
setup.cfg setup.py spch2008
制作egg并安装
[plain] view
plaincopyprint?
root@nova-controller:/home/sun/egg# python setup.py bdist_egg
root@nova-controller:/home/sun/egg# ls
build d2to1-0.2.10-py2.7.egg dist setup.cfg setup.py spch2008 spch2008.egg-info
root@nova-controller:/home/sun/egg# python setup.py install
运行
[plain] view
plaincopyprint?
root@nova-controller:~# python -c "from spch2008 import hello; hello()"
info : Hello World!
plaincopyprint?
setup(
setup_requires=['d2to1>=0.2.10,<0.3'],
d2to1=True
)
为了安装本文制作的egg,需要安装d2to1(版本要大于等于0.2.10,但要小于0.3)。
d2to1=True表明需要使用d2to1库,d2to1用来解释setup.cfg文件中的内容。
制作与安装
这篇文章讲的很详细,没有必要啰嗦啦。/article/4665466.htmlsetup.cfg
[plain] viewplaincopyprint?
setup(
name = "spch2008",
version="0.1.1",
packages = find_packages(),
zip_safe = False,
description = "first egg",
author = "sunpch",
author_email = "sunpch@foxmail.com",
license = "GPL",
platforms = "Independant"
)
上述配置写在setup中过于庞大,如果继续添加参数,导致setup函数参数过于臃肿,此时,可以将配置参数写在配置文件中。
setup.cfg
[plain] view
plaincopyprint?
[metadata]
name = spch2008
version = 0.1.1
zip_safe = False
description = first egg
author = sunpch
author-email = sunpch@foxmail.com
license = GPL
platforms = Independant
[files]
packages = spch2008
setup.py
[python] view
plaincopyprint?
from setuptools import setup
setup(
setup_requires=['d2to1>=0.2.10,<0.3'],
d2to1=True
)
创建目录文件spch2008/__init__.py
[plain] view
plaincopyprint?
def hello():
print "info : Hello World!"
if __name__ == "__main__":
hello()
目录格式:
[plain] view
plaincopyprint?
root@nova-controller:/home/sun/egg# ls
setup.cfg setup.py spch2008
制作egg并安装
[plain] view
plaincopyprint?
root@nova-controller:/home/sun/egg# python setup.py bdist_egg
root@nova-controller:/home/sun/egg# ls
build d2to1-0.2.10-py2.7.egg dist setup.cfg setup.py spch2008 spch2008.egg-info
root@nova-controller:/home/sun/egg# python setup.py install
运行
[plain] view
plaincopyprint?
root@nova-controller:~# python -c "from spch2008 import hello; hello()"
info : Hello World!
注释
[python] viewplaincopyprint?
setup(
setup_requires=['d2to1>=0.2.10,<0.3'],
d2to1=True
)
为了安装本文制作的egg,需要安装d2to1(版本要大于等于0.2.10,但要小于0.3)。
d2to1=True表明需要使用d2to1库,d2to1用来解释setup.cfg文件中的内容。
相关文章推荐
- python的egg包的安装和制作]
- python技巧26[python的egg包的安装和制作]
- python技巧26[python的egg包的安装和制作]
- python技巧26[python的egg包的安装和制作]
- python egg包的制作与安装
- python技巧26[python的egg包的安装和制作]
- python egg 文件安装与制作
- python egg包制作安装
- python技巧26[python的egg包的安装和制作]
- python整理二十七——egg文件制作与安装【仅提供链接地址】
- python整理二十七——egg文件制作与安装
- python在windows下使用setuptools安装egg文件
- 将自己制作的python包安装到Linux系统中
- python egg打包安装
- python制作安装包
- python用easy_install 安装egg文件
- 制作Python的安装模块
- vs2010中C++调用python脚本并制作安装包
- 《python从入门到实践》pygame安装,制作小游戏
- Linux安装Python-MySQL 遇到(set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).