在 Windows 中无人值守安装具有平台特定扩展的 Python 软件包的常用方法是什么?
What is the usual method for unattended installation of Python packages with platform-specific extensions in Windows?
正如this post所说,在Windows中有两个明显的无人值守安装NumPy的选项:
- 编译numpy并自己制作一个msi安装器
- 使用AutoIt
我觉得这两种方法都过于复杂了。正如我在 的评论中提到的,如果 Python 包是特定于平台的,比如 win-32
,我想简单地 "package all the Python files and platform-specific C extensions into a single .zip
file or tar.gz
file, then just unzip these files to finish installation",这可以在无人看管的情况下轻松完成。
我可以从 Chris Gohlke's website (a wheel is a ZIP-format archive with a specially formatted filename and the .whl
extension) 获取 Windows NumPy 二进制发行版的 ZIP 格式存档,然后使用以下命令安装它:
pip install numpy-1.9.2+mkl-cp27-none-win32.whl
我已经在 VirtualBox Win7 环境中测试过,它可以工作。
我只想知道在Windows无人值守的情况下,这是否是通常的安装科学开源扩展包(如scipy、matplotlib等)的方式?
Windows 上的标准方法是下载 Anaconda distribution of Python or download wheels from Chris Gohlke's website 然后 pip install
安装这些轮子。
为了给我毫无根据的陈述增加一点可信度,让我说 Software Carpentry 在教人们 Python 时使用 Anaconda 发行版。就我个人而言,我使用 Chris Gohlke 网站上的轮子,因为 Anaconda 超出了我的需要,一旦我有了轮子,它们就可以很好地处理虚拟环境。
正如this post所说,在Windows中有两个明显的无人值守安装NumPy的选项:
- 编译numpy并自己制作一个msi安装器
- 使用AutoIt
我觉得这两种方法都过于复杂了。正如我在 win-32
,我想简单地 "package all the Python files and platform-specific C extensions into a single .zip
file or tar.gz
file, then just unzip these files to finish installation",这可以在无人看管的情况下轻松完成。
我可以从 Chris Gohlke's website (a wheel is a ZIP-format archive with a specially formatted filename and the .whl
extension) 获取 Windows NumPy 二进制发行版的 ZIP 格式存档,然后使用以下命令安装它:
pip install numpy-1.9.2+mkl-cp27-none-win32.whl
我已经在 VirtualBox Win7 环境中测试过,它可以工作。
我只想知道在Windows无人值守的情况下,这是否是通常的安装科学开源扩展包(如scipy、matplotlib等)的方式?
Windows 上的标准方法是下载 Anaconda distribution of Python or download wheels from Chris Gohlke's website 然后 pip install
安装这些轮子。
为了给我毫无根据的陈述增加一点可信度,让我说 Software Carpentry 在教人们 Python 时使用 Anaconda 发行版。就我个人而言,我使用 Chris Gohlke 网站上的轮子,因为 Anaconda 超出了我的需要,一旦我有了轮子,它们就可以很好地处理虚拟环境。