栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何使Mac OS使用Homebrew安装的python

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何使Mac OS使用Homebrew安装的python

如果要使用Homebrew安装Python 3:

$ brew install python3==> Downloading http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2Already 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.gzAlready 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.gzAlready 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==> CaveatsHomebrew's Python3 framework  /usr/local/Cellar/python3/3.3.0/frameworks/Python.frameworkDistribute and Pip have been installed. To update them  pip3 install --upgrade distribute  pip3 install --upgrade pipTo symlink "Idle 3" and the "Python Launcher 3" to ~/Applications  `brew linkapps`You can install Python packages with  `pip3 install <your_favorite_package>`They will install into the site-package directory /usr/local/lib/python3.3/site-packagesExecutable python scripts will be put in: /usr/local/share/python3so 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_profile

export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH

接着:

$ source ~/.bash_profile

现在启动Python:

$ python3Python 3.3.0 (default, Mar 26 2013, 10:01:40) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)] on darwinType "help", "copyright", "credits" or "license" for more information.>>>

您可以检查python3路径:

$ which python3/usr/local/bin/python3


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/625305.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号