是否有不包含任何库的可移植 Python 2.7 Windows 发行版?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29472289/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there portable Python 2.7 Windows distribution without any libraries included?
提问by George Sovetov
Each Python distribution I found contains a lot of libs I don't need (numpy, scipy, PyQt etc.) I am looking for portable CPython analogue that doesn't require installation, doesn't touch anything but its directory, and is small to download over a slow or metered Internet connection.
我发现的每个 Python 发行版都包含许多我不需要的库(numpy、scipy、PyQt 等)通过慢速或按流量计费的 Internet 连接下载。
- I don't mean specifically http://portablepython.com/. I can choose packages to unpack manually. There is no way to make installer silent.
- There is https://winpython.github.io/. I have to unpack 1.5GB first and uninstall unused packages.
- PyPy -- http://pypy.org/. As far as I understand, is portable too but it seems it don't support all packages I need. (I will investigate that later.)
- 我不是特别指http://portablepython.com/。我可以选择要手动解包的包。没有办法让安装程序静音。
- 有https://winpython.github.io/。我必须先解压 1.5GB 并卸载未使用的软件包。
- PyPy—— http://pypy.org/。据我了解,它也是可移植的,但它似乎不支持我需要的所有软件包。(我稍后会调查。)
Why I need that. Project is required to be copy-deployed on Windows machines with no prerequisites. Second, building project directory with Python interpreter and packages (including mine) must be completely automated and should use project's repository and files that can be easily downloaded from Internet.
为什么我需要那个。项目需要在没有先决条件的 Windows 机器上进行复制部署。其次,使用 Python 解释器和包(包括我的)构建项目目录必须完全自动化,并且应该使用可以从 Internet 轻松下载的项目存储库和文件。
回答by Mauro Baraldi
There is Portable Python. But as you said, it comes with some extra (and very useful) libs. What's wrong with this extra libs? I mean, if you will not use, just leave there.
有便携式 Python。但正如你所说,它带有一些额外的(非常有用的)库。这个额外的库有什么问题?我的意思是,如果你不会使用,就离开那里。
回答by stonebig
suggestion:
建议:
install a winpython,
remove all packages you don't want,
add all packages you want,
zip the result, and unzip it on any PCs.
安装一个winpython,
删除所有你不想要的包,
添加你想要的所有包,
压缩结果,然后在任何 PC 上解压缩。