python打包成pyc文件部署_python 打包与部署

环境:win10、eclipse-jee-mars、python2.7

打包在linux上进行安装测试

1.1 打包

项目目录结构如下:

打包对象:utils.reg

在P1项目的顶级目录,也就是utils包的父目录下创建setup.py文件,内容如下:

#coding=utf-8

from distutils.core import setup

setup(

name='reg',

version='v1.0',

py_modules=['utils.reg']

)

直接运行该文件会报以下错误:

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

or: setup.py --help [cmd1 cmd2 ...]

or: setup.py --help-commands

or: setup.py cmd --help

error: no commands supplied

编译

python setup.py build

编译后在setup.py同目录下多出一个build目录

打包

G:\SVN\workspaces\P1\src>python setup.py sdist

running sdist

running check

warning: check: missing required meta-data: url

warning: check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied

warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)

warning: sdist: standard file not found: should have one of README, README.txt

writing manifest file 'MANIFEST'

creating reg-v1.0

creating reg-v1.0\utils

copying files to reg-v1.0...

copying setup.py -> reg-v1.0

copying

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值