Python setup.py和MANIFEST.in文件

Setup.py文件

from setuptools import setup
from codecs import open

# 第三方依赖包及版本号
requires = ['beautifulsoup4>=4.3.2',
           'gearman>=2.0.2',
           'pymongo>=2.7.2',
           'threadpool>=1.2.7',
           'geoip2>=2.1.0',
           'pywin32>=219']

# 包列表
packages = ['MSE',
           'MSE.Device',
           'MSE.Proxy',
           'MSE.Scanner',
           'MSE.Utility',
           'MSE.Worker',
           'MSE.Config']

with open('HISTORY.rst', 'r', 'utf-8') asf:
   history = f.read()

setup(
   name = 'MSE',
   version = '1.2.1',
   author = 'Edwin',
   author_email = '[email protected]',
   description = 'Industry device/system search engine',
   long_description = history,
   url = '-',
   packages = packages,
   include_package_data = True,
   entry_points = {'console_scripts': [
       'MSE-Manager = MSE.Worker.Manager:main',
   ]},
   package_dir = {'MSE': 'MSE'},
   install_requires = requires,
   license = 'Apache',
   #zip_safe = False,
   classifiers = [
       'Development Status :: 1 - Production/Stable',
       'Intended Audience :: Developers',
       'License :: OSI Approved :: Apache Software License',
       'Natural Language :: English',
       'Operating System :: OS Independent',
       'Programming Language :: Python',
       'Programming Language :: Python :: 2.7',
       'Topic :: Software Development :: Libraries :: Python Modules',
   ],
)

MANIFEST.in文件

详细格式和參数參考https://docs.python.org/2/distutils/sourcedist.html

include HISTORY.rst
include MANIFEST.in
recursive-include MES/Utility *.mmdb

说明

1.      zip_safe = False 不压缩为一个egg文件,而是以文件夹的形式安装egg

2.      include_package_data = True。包括包数据

3.      MANIFEST.in文件,用于包括其它文件

4.      公布Manayer.py工具脚本:

entry_points ={‘console_scripts‘: [

‘MSE-Manager = MSE.Worker.Manager:main‘,

]},

安装后会在Python系统文件夹的Scripts文件夹下生成两个文件:MSE-Manager.exe和MSE-Manager.py

5.      打包命令:python setup.py sdist

本文地址:http://blog.csdn.net/fragmentalice/article/details/44833013

时间: 2024-10-03 02:02:38

Python setup.py和MANIFEST.in文件的相关文章

Command "python setup.py egg_info" failed with error code 1一种问题的解决方法

问题描述:无论是你在pycharm中直接使用import and install命令,还是pip的时候出现了Command "python setup.py egg_info" failed with error code 1这样的问题描述,需要考虑可能pip的这个源里面没有对应的python3.5的模块 解决方法:通常可以直接google "XXX for python3.5",或者在github中找到对应的python3.5的项目,将对应的.py文件添加到pyt

python setup.py 安装和卸载 的正确姿势

1.install python setup.py install --record files.txt 2. uninstall 删除这些文件 cat files.txt | xargs rm -rf 原文地址:https://www.cnblogs.com/SunshineKimi/p/12291674.html

Error:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-not69mld/pysam/

使用pip命令之后报错,错误信息如下图: 提示egg_info文件错误 解决原理: 我在装载python3.6的机器上同时也安装了python2.7(软件需要),使用python 3的pip来安装python 2的git包,当然会报错. 解决代码: wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg --no-check-certificate #下载python2.7的setupt

python安装Fabrix出现Command "python setup.py egg_info"错误

python安装Fabrix出现Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ynJnAl/pynacl/ 解决: 向上查看发现No package 'libffi' found,原因是这个libffi库未安装 所以使用:yum install libffi-devel -y 最后安装成功

解决安装ipython时Command "python setup.py egg_info" failed with error code 1 in /tmp

最近使用ubuntu16.04 server版安装ipython的时候一直在报错: IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.      When using Python 2.7, please install IPython 5.x LTS Long Term Support version. python2.7 ipython Command "python setup.py egg_info"

解决Command "python setup.py egg_info" failed with error code 1坎坷路

机器:os x 本地想跑一下一个开源django博客应用,下了源码到里头pip install -r requirements.txt 结果屡次出错,Command "python setup.py egg_info" failed with error code 1 试了多次一直于最后一行这个错误. 我开始以为权限问题,setuptools问题 后来有转机了,我把 requirements.txt里头一个个安装,最后原是psycopg2这个安装有问题 pip我错怪你了,不过把官方源换

解决 Command "python setup.py egg_info" failed with error code 1 问题

参考: "pip install unroll": "python setup.py egg_info" failed with error code 1 解决 Command "python setup.py egg_info" failed with error code 1 问题 在执行 pip install -r requirements.txt 时遇到错误: Command "python setup.py egg_info

Command "python setup.py egg_info" failed with error code 1 in C:\Users\w5659\AppData\Local\Temp\pip-install-t7uomu4r\xa dmin\

Error msg: C:\Users\w5659>pip install xadmin Collecting xadmin Using cached https://files.pythonhosted.org/packages/1d/e9/2ac160c532d0d462142fa90aa86a0e317295e8d86fa4caf84d04f6e24c4 9/xadmin-0.6.1.tar.gz Complete output from command python setup.py e

出现问题:Command "python setup.py egg_info" failed with error code 1,当进行pip3 install beautifulsoup

C:\Users\wang>pip3 install beautifulsoup Collecting beautifulsoup Using cached BeautifulSoup-3.2.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module&g