苹果系统可以装python_如何使Mac操作系统使用Homeb安装的python

如果要使用自制程序安装Python 3:$ brew install python3

==> Downloading http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2

Already downloaded: /Library/Caches/Homebrew/python3-3.3.0.tar.bz2

==> ./configure --prefix=/usr/local/Cellar/python3/3.3.0 --enable-ipv6 --datarootdir=/usr/local/Cell

==> make

==> make install PYTHONAPPSDIR=/usr/local/Cellar/python3/3.3.0

==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python3/3.3.0/share/python3

==> Downloading https://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz

Already downloaded: /Library/Caches/Homebrew/distribute-0.6.35.tar.gz

==> /usr/local/Cellar/python3/3.3.0/bin/python3.3 -s setup.py install --force --verbose --install-li

==> Downloading https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz

Already downloaded: /Library/Caches/Homebrew/pip-1.3.1.tar.gz

==> /usr/local/Cellar/python3/3.3.0/bin/python3.3 -s setup.py install --force --verbose --install-li

==> Caveats

Homebrew's Python3 framework

/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework

Distribute and Pip have been installed. To update them

pip3 install --upgrade distribute

pip3 install --upgrade pip

To symlink "Idle 3" and the "Python Launcher 3" to ~/Applications

`brew linkapps`

You can install Python packages with

`pip3 install `

They will install into the site-package directory

/usr/local/lib/python3.3/site-packages

Executable python scripts will be put in:

/usr/local/share/python3

so you may want to put "/usr/local/share/python3" in your PATH, too.

See: https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python

安装后更新系统变量PATH,将下一行添加到~/.bash_profileexport PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH

然后:$ source ~/.bash_profile

现在启动Python:$ python3

Python 3.3.0 (default, Mar 26 2013, 10:01:40)

[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>>

您可以检查python3路径:$ which python3

/usr/local/bin/python3

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值