Linux & Mac package安装命令

本文提供了在不同操作系统上安装Python科学计算常用包的方法,包括Linux(Ubuntu、Debian、Fedora、Gentoo)、Mac等平台的详细步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以numpy的安装为例:(如果有sudo权限)

Linux packages

Users on Linux can quickly install the necessary packages from repositories.

Ubuntu & Debian

sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

The versions in Ubuntu 12.10 and Debian 7.0 meet the current SciPy stack specification. Users might also want to add the NeuroDebian repository for extra SciPy packages.

Fedora

sudo yum install numpy scipy python-matplotlib ipython python-pandas sympy python-nose

Users of Fedora 17 and earlier should then upgrade IPython using pip:

sudo pip install --upgrade ipython

Gentoo

sudo emerge -aN '>=dev-python/numpy-1.6' '>=sci-libs/scipy-0.10' '>=dev-python/matplotlib-1.1' '>=dev-python/ipython-0.13' '>=dev-python/pandas-0.8' '>=dev-python/sympy-0.7' '>=dev-python/nose-1.1'

You may get some messages saying that keyword changes or USE changes are necessary in order to proceed, and that you should use --autounmask-write to write changes to config files. This is especially likely to happen if you are running Gentoo Stable rather than Gentoo Testing, as of this writing (February 2013).

If this happens, just run the above command with --autounmask-write appended, then run sudo dispatch-conf (or an alternative) to save the configuration changes, and finally run the original command again.

Mac packages

Macs (unlike Linux) don’t come with a package manager, but there are a couple of popular package managers you can install.

Macports

To install the scipy stack for Python 2.7 with Macports execute this command in a terminal:

sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值