V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
justincnn
V2EX  ›  Python

Python 程序在没有 Python 环境的 pc 上除了打包成 exe,还有其他办法可以执行么?

  •  
  •   justincnn · 2020-03-05 22:43:31 +08:00 · 4442 次点击
    这是一个创建于 1502 天前的主题,其中的信息可能已经有所发展或是发生改变。
    该死的诺顿把这种 exe 全部隔离了,实在没办法了,

    本来想做 django,但是又无法上外网,有其他解决方案么?
    20 条回复    2020-04-19 18:49:41 +08:00
    jinliming2
        1
    jinliming2  
       2020-03-05 22:47:47 +08:00
    配个 python 解压版本,然后写个 cmd 启动
    est
        2
    est  
       2020-03-05 22:54:43 +08:00
    winrar 自解压+自运行 试试。。
    justincnn
        3
    justincnn  
    OP
       2020-03-05 23:11:38 +08:00 via Android
    @jinliming2 这方法感觉不错,试试看,谢谢
    ClericPy
        4
    ClericPy  
       2020-03-05 23:27:12 +08:00
    shiv 打包成一个 zip app, 然后用官网那个嵌入式绿色版的解释器做个 bat 调用就好了, 以前用过, 还挺好使
    justincnn
        5
    justincnn  
    OP
       2020-03-05 23:55:03 +08:00 via Android
    @ClericPy 好的,谢谢指导
    Vegetable
        6
    Vegetable  
       2020-03-06 00:22:13 +08:00
    @jinliming2 解压出来的 python 不也是 exe 吗?有什么区别
    mayx
        7
    mayx  
       2020-03-06 00:23:49 +08:00 via Android
    套壳
    Vegetable
        8
    Vegetable  
       2020-03-06 00:24:18 +08:00
    理解错了,是不能用 pyinstaller 打包的程序啊,那就是其他人说的打包一份 python 了。
    wangyzj
        9
    wangyzj  
       2020-03-06 00:28:10 +08:00
    应该干的不是干掉诺顿吗
    lc7029
        10
    lc7029  
       2020-03-06 03:14:49 +08:00
    @wangyzj 估计是商用或生产之类环境,应该有严格的内控策略,比如没诺顿不能接入网络,虽说有也不能访问公网。。。
    deepreader
        11
    deepreader  
       2020-03-06 04:47:35 +08:00
    sunwei0325
        12
    sunwei0325  
       2020-03-06 08:21:49 +08:00
    我之前用的是 pex
    https://github.com/pantsbuild/pex
    LokiSharp
        13
    LokiSharp  
       2020-03-06 08:48:26 +08:00 via iPhone
    整个签名就能跑了
    justincnn
        14
    justincnn  
    OP
       2020-03-06 09:00:19 +08:00 via Android
    @LokiSharp 这个怎么弄啊?可以给个方向么?
    justincnn
        15
    justincnn  
    OP
       2020-03-06 10:04:15 +08:00
    @sunwei0325 pex 不能在 win 下运行么?
    zysidea
        16
    zysidea  
       2020-03-06 10:09:14 +08:00
    简单,用 go 重写
    scriptB0y
        17
    scriptB0y  
       2020-03-06 11:41:36 +08:00
    不知道这样行不行: https://www.v2ex.com/t/648946

    你可以试试
    jinliming2
        18
    jinliming2  
       2020-03-06 13:59:49 +08:00 via iPhone
    @Vegetable 解压出来的 python 虽说是 exe,但是算是已知程序,并且有可信的数字签名啊
    Vegetable
        19
    Vegetable  
       2020-03-06 14:06:04 +08:00
    @jinliming2 我理解错了,还以为有一个白名单,白名单之外的 exe 都不行。
    xcstream
        20
    xcstream  
       2020-04-19 18:49:41 +08:00
    直接用 python.exe 跑
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3299 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 14:04 · PVG 22:04 · LAX 07:04 · JFK 10:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.