在Mac上同时安装Python3.6和Python3.7 [英] Installing Python3.6 alongside Python3.7 on Mac
问题描述
我正在尝试使用Python3.7在Mac上安装tensorflow.但是,我得到了错误:
I'm trying to install tensorflow onto a Mac with Python3.7. However, I'm getting the error:
$ pip3 -v install tensorflow
...
Skipping link https://files.pythonhosted.org/packages/56/7a/c6bca0fe52a94ca508731d8b139e7dbd5a36cddc64c19f422f97e5a853e8/tensorflow-1.10.0rc1-cp36-cp36m-win_amd64.whl#sha256=3ab24374888d6a13d55ce2e3cf4ba0c9cd6f824723313db5322512087525cb78 (from https://pypi.org/simple/tensorflow/); it is not compatible with this Python
Could not find a version that satisfies the requirement tensorflow (from versions: )
Cleaning up...
Removed build tracker '/private/var/folders/4n/9342s4wd3jv0qzwjz8rxrygr0000gp/T/pip-req-tracker-3p60r2lo'
No matching distribution found for tensorflow
据我所知,这是因为tensorflow尚不支持Python3.7.作为一种解决方法,我想将Python3.6与3.7一起安装,然后将tensorflow安装到该版本.但是,我是Mac的新手,因此不确定在不混淆现有Python版本的情况下执行此操作的正确方法.
From what I can gather this is happening because tensorflow doesn't yet support Python3.7. As a workaround I want to install Python3.6 alongside 3.7 and then install tensorflow to that version. However, I'm new to Mac and not sure of the correct way to do this without potentially messing with the preexisting Python version.
我尝试使用brew,但是Python3看起来非常具体.做我追求的正确方法是什么?
I've tried using brew, but it looks like Python3 is as specific as it gets. What is the correct way to do what I'm after?
推荐答案
例如,如果已经使用Python 3,请尝试使用brew
.
Try using brew
for example if already using Python 3:
$ brew unlink python
然后安装python 3.6.5 :
$ brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
要返回python 3.7.4_1
,请使用:
To get back to python 3.7.4_1
use:
$ brew switch python 3.7.4_1
如果需要3.6,请再次切换:
And if need 3.6 again switch with:
$ brew switch python 3.6.5_1
这篇关于在Mac上同时安装Python3.6和Python3.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!