怎么在mac os 10.10.4 isoX 10.4上装pip

之前下载了很多个没有成功。据说自带 Python 2.7,但是看不懂终端,也不知道在哪里能找到Python。&br&&br&我加一个最近安装的&br&&img src=&/c8f10ea99d13d378eb703eb_b.jpg& data-rawwidth=&2560& data-rawheight=&1600& class=&origin_image zh-lightbox-thumb& width=&2560& data-original=&/c8f10ea99d13d378eb703eb_r.jpg&&&img src=&/4eeaac0eac850ebeee6ef7f5_b.jpg& data-rawwidth=&2560& data-rawheight=&1600& class=&origin_image zh-lightbox-thumb& width=&2560& data-original=&/4eeaac0eac850ebeee6ef7f5_r.jpg&&&img src=&/5a6aac1f3ddb1f818d3ca9c_b.jpg& data-rawwidth=&2560& data-rawheight=&1600& class=&origin_image zh-lightbox-thumb& width=&2560& data-original=&/5a6aac1f3ddb1f818d3ca9c_r.jpg&&下载是下载了到目前这一步束手无策。&br&&br&补充一下,感谢大家的帮助,目前已经能够使用Python sheet 和终端了,像这样的&img src=&/2bb1557a41_b.jpg& data-rawwidth=&2560& data-rawheight=&1600& class=&origin_image zh-lightbox-thumb& width=&2560& data-original=&/2bb1557a41_r.jpg&&&br&&br&问题是每次编辑只能有一行,也没有可以引用的函数(是这么说的吧)&br&&br&而我想要跟可汗老师一样的,方便学,而且以前用到过的都是这样的,编辑和输出分开功能比较多的&br&&img src=&/153dfe95fc35c0ac7d34799_b.jpg& data-rawwidth=&2560& data-rawheight=&1600& class=&origin_image zh-lightbox-thumb& width=&2560& data-original=&/153dfe95fc35c0ac7d34799_r.jpg&&谢谢帮我精简语言,但还是要有礼貌要谢谢大家的&br&&br&&br&&img src=&/921eb3b5be_b.jpg& data-rawwidth=&2560& data-rawheight=&1600& class=&origin_image zh-lightbox-thumb& width=&2560& data-original=&/921eb3b5be_r.jpg&&谢谢大家,我来更新了,想到又能得到大神们的无私帮助真是有些不好意思呢&br&&br&-------------------------------------&br&我一直以为%计算是取余(c语言里貌似是‘\’这个符号)但是8.75%0.5得出0.25的答案真心很纠结啊。我上网查了一下,看到一篇介绍取余和取模的文章(重点在正负号的区别),找不到关于取模的数学知识,有人能给破一下吗
之前下载了很多个没有成功。据说自带 Python 2.7,但是看不懂终端,也不知道在哪里能找到Python。我加一个最近安装的…
樓主今後用10.10也不會再遇到這種問題了。樓主今後用10.10也不會再遇到這種問題了。=========下文是我按照
所提示的步驟執行之後的終端機訊息,似乎最後一步出錯了…Last login: Mon Sep
8 23:33:12 on ttys000Shiki-Suens-rMBP:~ ShikiSuen$ ruby -e "$(curl -fsSL )"==& This script will install:/usr/local/bin/brew/usr/local/Library/.../usr/local/share/man/man1/brew.1==& The following directories will be made group writable:/usr/local/./usr/local/bin/usr/local/lib/usr/local/share/usr/local/share/man==& The following directories will have their group set to admin:/usr/local/./usr/local/bin/usr/local/lib/usr/local/share/usr/local/share/manPress RETURN to continue or any other key to abort==& /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/lib /usr/local/share /usr/local/share/manPassword:==& /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin /usr/local/lib /usr/local/share /usr/local/share/man==& /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew==& /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew==& Installing the Command Line Tools (expect a GUI popup):==& /usr/bin/sudo /usr/bin/xcode-select --installxcode-select: note: install requested for command line developer toolsPress any key when the installation has completed.==& Downloading and installing Homebrew...remote: Counting objects: 196262, done.remote: Compressing objects: 100% (), done.remote: Total 196262 (delta 141940), reused 195806 (delta 141595)Receiving objects: 100% (262), 40.22 MiB | 2.25 MiB/s, done.Resolving deltas: 100% (940), done.From
* [new branch]
-& origin/masterHEAD is now at 82170d1 Fix file descriptor leak==& Installation successful!==& Next stepsRun `brew doctor` before you install anythingRun `brew help` to get startedShiki-Suens-rMBP:~ ShikiSuen$ brew install python==& Installing dependencies for python: pkg-config, readline, sqlite, gdb==& Installing python dependency: pkg-config==& Downloading ######################################################################## 100.0%==& ./configure --prefix=/usr/local/Cellar/pkg-config/0.28 --disable-host-tool -==& make==& make check==& make install
/usr/local/Cellar/pkg-config/0.28: 10 files, 612K, built in 57 seconds==& Installing python dependency: readline==& Downloading ######################################################################## 100.0%==& Downloading ######################################################################## 100.0%==& Patchingpatching file display.cpatching file input.cpatching file misc.cpatching file patchlevelpatching file readline.cpatching file rltypedefs.hpatching file util.c==& ./configure --prefix=/usr/local/Cellar/readline/6.3.8 --enable-multibyte==& make install==& CaveatsThis formula is keg-only, which means it was not symlinked into /usr/local.Mac OS X provides similar software, and installing this software inparallel can cause all kinds of trouble.OS X provides the BSD libedit library, which shadows libreadline.er to prevent conflicts when programs look for libreadline we areting this GNU Readline installation to keg-only.Generally there are no consequences of this for you. If you build yourown software and it requires this formula, you'll need to add to yourbuild variables:
-L/usr/local/opt/readline/lib
CPPFLAGS: -I/usr/local/opt/readline/include==& Summary
/usr/local/Cellar/readline/6.3.8: 40 files, 2.1M, built in 35 seconds==& Installing python dependency: sqlite==& Downloading ######################################################################## 100.0%==& ./configure --prefix=/usr/local/Cellar/sqlite/3.8.6 --enable-dynamic-extensi==& make install==& CaveatsThis formula is keg-only, which means it was not symlinked into /usr/local.Mac OS X already provides this software and installing another version inparallel can cause all kinds of trouble.OS X provides an older sqlite3.Generally there are no consequences of this for you. If you build yourown software and it requires this formula, you'll need to add to yourbuild variables:
-L/usr/local/opt/sqlite/lib
CPPFLAGS: -I/usr/local/opt/sqlite/include==& Summary
/usr/local/Cellar/sqlite/3.8.6: 9 files, 2.1M, built in 28 seconds==& Installing python dependency: gdbm==& Downloading ######################################################################## 100.0%==& ./configure --prefix=/usr/local/Cellar/gdbm/1.11 --mandir=/usr/local/Cellar/==& make install
/usr/local/Cellar/gdbm/1.11: 17 files, 532K, built in 12 seconds==& Installing python dependency: makedepend==& Downloading -######################################################################## 100.0%==& Downloading ######################################################################## 100.0%==& ./configure --disable-silent-rules --prefix=/private/tmp/makedepend-Z76mf6/m==& make install==& Downloading ######################################################################## 100.0%==& ./configure --prefix=/private/tmp/makedepend-Z76mf6/makedepend-1.0.5/xorg-ma==& make install==& ./configure --disable-silent-rules --prefix=/usr/local/Cellar/makedepend/1.0==& make install
/usr/local/Cellar/makedepend/1.0.5: 7 files, 92K, built in 19 seconds==& Installing python dependency: openssl==& Downloading ######################################################################## 100.0%==& perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1i --openssldir=/usr==& make depend==& make==& make test==& make install MANDIR=/usr/local/Cellar/openssl/1.0.1i/share/man MANSUFFIX=ssl==& CaveatsA CA file has been bootstrapped using certificates from the systemkeychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certsand run
/usr/local/opt/openssl/bin/c_rehashThis formula is keg-only, which means it was not symlinked into /usr/local.Mac OS X already provides this software and installing another version inparallel can cause all kinds of trouble.The OpenSSL provided by OS X is too old for some software.Generally there are no consequences of this for you. If you build yourown software and it requires this formula, you'll need to add to yourbuild variables:
-L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include==& Summary
/usr/local/Cellar/openssl/1.0.1i: 430 files, 15M, built in 3.0 minutes==& Installing python==& Downloading ######################################################################## 100.0%==& Downloading curl: (7) Failed to connect to
port 80: Operation timed outError: Failed to download resource "python--patch"Download failed: Shiki-Suens-rMBP:~ ShikiSuen$
真闹心。照着我说的做,不要问为什么。&br&&br&打开 Terminal(终端),把这个粘贴进去:&br&&div class=&highlight&&&pre&&code class=&language-text&&ruby -e &$(curl -fsSL /Homebrew/homebrew/go/install)&
&/code&&/pre&&/div&&br&然后输入&br&&div class=&highlight&&&pre&&code class=&language-text&&brew install python
&/code&&/pre&&/div&&br&&b&更新:之前少说了一步,不加这一步的话系统不会调用你刚才安装的Python。&/b&&br&&div class=&highlight&&&pre&&code class=&language-text&&echo export PATH='/usr/local/bin:$PATH' && ~/.bash_profile
&/code&&/pre&&/div&&br&如果你希望“Applications”里面有 Python 自带的 IDLE 的话,输入:&br&&div class=&highlight&&&pre&&code class=&language-text&&brew linkapps
&/code&&/pre&&/div&&br&然后下载安装一个 &b&PyCharm &/b&完事,你想要的就都有了。&br&&b&&a href=&/pycharm/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Python IDE & Django IDE for Web developers : JetBrains PyCharm&i class=&icon-external&&&/i&&/a&&/b&&br&&br&&b&===== 以下内容可以不看 =====&/b&&br&&b&===== 以下内容可以不看 =====&/b&&br&===== UPDATE 2 =====&br&&a data-hash=&669bd058f817cba36a1a6af80ae6423f& href=&///people/669bd058f817cba36a1a6af80ae6423f& class=&member_mention& data-editable=&true& data-title=&@孫志貴& data-tip=&p$b$669bd058f817cba36a1a6af80ae6423f&&@孫志貴&/a& 说他那里有 Timeout 的问题,我就用虚拟机里干净的 OS X 10.9.4 完整操作了一遍。&br&可以试试重新输入 brew install python 尝试重新安装。&br&&br&我在虚拟机里装完了 Python 2.7.8,完全按照我给出的命令,也安装好了,不过确实发现我忽略了一步。&br&Homebrew 用的 &a href=&http://sf.net& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&sf.net&/span&&span class=&invisible&&&/span&&i class=&icon-external&&&/i&&/a& 不是很稳定,所以有时候需要Ctrl-C然后重新输入 brew install python 来重启下载。&br&日志如下,供参考。加粗是我输入的部分。&br&&br&1. 安装 homebrew&br&&div class=&highlight&&&pre&&code class=&language-text&&PythonicdeMacBook-Pro:~ pythonic$ ruby -e &$(curl -fsSL /Homebrew/homebrew/go/install)&
==& This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==& /usr/bin/sudo /bin/mkdir /usr/local
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type &man sudo& for more information.
To proceed, enter your password, or type Ctrl-C to abort.
==& /usr/bin/sudo /bin/chmod g+rwx /usr/local
==& /usr/bin/sudo /usr/bin/chgrp admin /usr/local
==& /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==& /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==& Installing the Command Line Tools (expect a GUI popup):
==& /usr/bin/sudo /usr/bin/xcode-select --install
xcode-select: note: install requested for command line developer tools
Press any key when the installation has completed.
==& Downloading and installing Homebrew...
remote: Counting objects: 196389, done.
remote: Compressing objects: 100% (), done.
remote: Total 196389 (delta 142044), reused 195794 (delta 141599)
Receiving objects: 100% (389), 40.24 MiB | 52.00 KiB/s, done.
Resolving deltas: 100% (044), done.
From /Homebrew/homebrew
* [new branch]
-& origin/master
HEAD is now at 4525585 elixir 1.0.0-rc2 (devel)
==& Installation successful!
==& Next steps
Run `brew doctor` before you install anything
Run `brew help` to get started
&/code&&/pre&&/div&&br&2. 安装 Python&br&&div class=&highlight&&&pre&&code class=&language-text&&PythonicdeMacBook-Pro:~ pythonic$ brew install python
==& Installing dependencies for python: readline, sqlite, gdbm, openssl
==& Installing python dependency: readline
==& Downloading https://downloads.sf.net/project/machomebrew/Bottles/readline-6.3.8.mavericks.bottle.tar.gz
######################################################################## 100.0%
==& Pouring readline-6.3.8.mavericks.bottle.tar.gz
==& Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
Mac OS X provides similar software, and installing this software in
parallel can cause all kinds of trouble.
OS X provides the BSD libedit library, which shadows libreadline.
er to prevent conflicts when programs look for libreadline we are
ting this GNU Readline installation to keg-only.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
-L/usr/local/opt/readline/lib
CPPFLAGS: -I/usr/local/opt/readline/include
==& Summary
/usr/local/Cellar/readline/6.3.8: 40 files, 2.1M
==& Installing python dependency: sqlite
==& Downloading https://downloads.sf.net/project/machomebrew/Bottles/sqlite-3.8.6.mavericks.bottle.tar.gz
######################################################################## 100.0%
==& Pouring sqlite-3.8.6.mavericks.bottle.tar.gz
==& Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
OS X provides an older sqlite3.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
-L/usr/local/opt/sqlite/lib
CPPFLAGS: -I/usr/local/opt/sqlite/include
==& Summary
/usr/local/Cellar/sqlite/3.8.6: 9 files, 2.1M
==& Installing python dependency: gdbm
==& Downloading https://downloads.sf.net/project/machomebrew/Bottles/gdbm-1.11.mavericks.bottle.tar.gz
curl: (35) Server aborted the SSL handshake
Error: Failed to download resource &gdbm&
Download failed: https://downloads.sf.net/project/machomebrew/Bottles/gdbm-1.11.mavericks.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==& Downloading http://ftpmirror.gnu.org/gdbm/gdbm-1.11.tar.gz
######################################################################## 100.0%
==& ./configure --prefix=/usr/local/Cellar/gdbm/1.11 --mandir=/usr/local/Cellar/gdbm/1.11/share/man --infodir=/usr/lo
==& make install
/usr/local/Cellar/gdbm/1.11: 17 files, 532K, built in 39 seconds
==& Installing python dependency: openssl
==& Downloading https://downloads.sf.net/project/machomebrew/Bottles/openssl-1.0.1i.mavericks.bottle.3.tar.gz
######################################################################## 100.0%
==& Pouring openssl-1.0.1i.mavericks.bottle.3.tar.gz
==& Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
The OpenSSL provided by OS X is too old for some software.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
-L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
==& Summary
/usr/local/Cellar/openssl/1.0.1i: 430 files, 15M
==& Installing python
==& Downloading https://downloads.sf.net/project/machomebrew/Bottles/python-2.7.8_1.mavericks.bottle.2.tar.gz
######################################################################## 100.0%
==& Pouring python-2.7.8_1.mavericks.bottle.2.tar.gz
==& Caveats
Setuptools and Pip have been installed. To update them
pip install --upgrade setuptools
pip install --upgrade pip
You can install Python packages with
pip install &package&
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: /Homebrew/homebrew/wiki/Homebrew-and-Python
.app bundles were installed.
Run `brew linkapps` to symlink these to /Applications.
&/code&&/pre&&/div&&br& 3. 修改优先级&br&&div class=&highlight&&&pre&&code class=&language-text&&PythonicdeMacBook-Pro:~ pythonic$ echo export PATH='/usr/local/bin:$PATH' && ~/.bash_profile
&/code&&/pre&&/div&
真闹心。照着我说的做,不要问为什么。打开 Terminal(终端),把这个粘贴进去:ruby -e "$(curl -fsSL /Homebrew/homebrew/go/install)"
然后输入brew install python
更新:之前少说了一步,不加这一步的话系统不会调用你刚才安装…
OS X 自带 Python 2.7.&br&&br&直接在终端用解释器执行的话,如图&br&&img src=&/69daee4cf48961a82ead8c546bf68925_b.jpg& data-rawwidth=&700& data-rawheight=&353& class=&origin_image zh-lightbox-thumb& width=&700& data-original=&/69daee4cf48961a82ead8c546bf68925_r.jpg&&&br&执行 .py 脚本的话,&br&&br&&img src=&/170e654e9cac355f363d6ffc92b12647_b.jpg& data-rawwidth=&717& data-rawheight=&127& class=&origin_image zh-lightbox-thumb& width=&717& data-original=&/170e654e9cac355f363d6ffc92b12647_r.jpg&&&br&至此,起码是能够运行 Python 代码了。往后,开发环境的搭建,用搜索引擎能够找到的资料太多了。
OS X 自带 Python 2.7.直接在终端用解释器执行的话,如图执行 .py 脚本的话,至此,起码是能够运行 Python 代码了。往后,开发环境的搭建,用搜索引擎能够找到的资料太多了。
让哲♂学成为果♂粉肚子裡的深♂奥武器收藏,4.7k 浏览
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
犹豫了一段时间是否更新Mac OS X内置的Python2.7.5 最后在还是更新到了2.7.7版本然后一系列的问题来了。easy_install、pip、Scrapy、Django这些包都无法正常在终端下执行。
例如一哥们的的File "/usr/local/bin/pip", line 5, in &module&错误,我也检查了一遍。发现重装后也不可以,在PyCharm下将更新后的Python路径修复一下就可以正常使用了,但是非常奇怪的一点,无论我怎么卸载重装第三方包也好。就是不见Python的包在/Library/Python/2.7/site-packages/路径内,看到的只有之前内置2.7.5的包,就纳闷了半天还没想到问题。
想了一下执行比如easy_install的时候按照Windows的尿性还要加环境变量,那么我检查了一遍/usr/bin/目录是正常存在easy_install的。那么我在终端执行的结果是这样:
python version 2.7.7 can't run /usr/bin/easy_install.
Try the alternative(s):
(Error: no alternatives found)
Run "man python" for more information about multiple version support in
这样的问题我也检查了一遍,这个是原本未升级时2.7.5遗留下来的,并没有做过任何处理。
我在这里思考了一下,发现更新Python2.7.7之后所有的包都安装在了:/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/里面,我是不是认为我在更新完后执行easy_install的时候执行的并不是Python2.7.7里面的包?而是Python2.5.5里面的easy_install?
如果是这样,那么理论上我的解决方法是不是可以这样:将所有以前遗留的包软链接重新链接一次?
sudo rm -rf /usr/bin/easy_install
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/easy_install.py /usr/bin/easy_install
然后将以前的/Library/Python/2.7/site-packages/包删除掉?或者无视它的存在~
重点是,我将Python更新了,然后将包得软链接比如easy_install、pip、Django、Scrapy这样的包替换掉?是否就完美解决掉Mac OS X下的Python更新?
Ps.提问水平真的很拙计,希望大家能看得懂!
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
Mac OS X下不建议升级内置的Python、Ruby跟Perl,血和泪的教训。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
呃。好悲催。
用 homebrew 吧。
先用 homebrew 卸载 Python ,再安装。
brew uninstall python
brew install python
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
正好从现在起开始用virtualenv。从此你不用考虑系统的python版本了。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
mac下推薦安裝
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
You should always use virtualenv as your python runtime.
pip install virtualenv
virtualenv env
source env/bin/active
If not, at least you should use pyenv:
同步到新浪微博
分享到微博?
与我们一起探索更多的未知
专业的开发者技术社区,为用户提供多样化的线上知识交流,丰富的线下活动及给力的工作机会
加入只需一步
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
举报理由:
推广(招聘、广告、SEO 等)方面的内容
带有人身攻击、辱骂、仇恨等违反条款的内容
与已有问题重复(请编辑该提问指向已有相同问题)
不友善内容
答非所问,不符合答题要求
其他原因(请补充说明)
补充说明:
扫扫下载 App
SegmentFault
一起探索更多未知}

我要回帖

更多关于 mac os x 10.10.4 dmg 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信