按照以下步骤,百分百成功
sudo apt-get update
,更新apt源。vim
,如果没有安装vim,先 sudo apt-get install vim
,安装vimsudo cp /etc/apt/source.list /ect/apt/source.list.bak //对原文件备份
sudo vim /etc/apt/source.list //编辑apt源
进入后,先不要着急,依次按ggVg
,这个可以全选并删除所有内容,然后按i
进入inset模式,添加下面内容:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
然后按esc
,再输入:wq
,保存并退出,再输入以下命令更新apt源设置
sudo apt-get update
现在我们的下载速度大大提高!
sudo apt-get install python3-pip
~/.pip/pip.conf
文件,并输入源设置,命令如下cd ~
mkdir .pip
cd .pip
sudo vim pip.conf
进入vim后按i
进入insert模式,输入以下内容:
[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple
trusted-host = mirros.aliyun.com
按esc
,输入:wq
保存并退出
sudo pip3 install update
pip3 install jupyter
sudo jupyter notebook --allow-root
ubuntu直接输入
jupyter notebook
会自动打开默认浏览器并进入jupyter notebook
ctrl
+z
,退出jupyter notebook,下面我们安装turicreate!//安装virtual env虚拟环境
sudo apt-get install -y libgconf -2-4 libstdc++6 python-setuptools
sudo pip3 install virtualenv
//创建env环境并在环境下安装turicreate和ipykernel内核,并且配置jupyter notebook的显示
cd ~
virtualenv turienv
cd turienv
source ~/turienv/bin/activate
pip3 install update
pip3 install ipykernel
pip3 install turicreate
python -m ipykernel install --user --name turienv --display-name turienv
deactivate
输入
//wsl输入
sudo jupyter notebook --allow-root
//ubuntu输入
jupyter notebook
在安装turicreate,或者import turicreate的时候,经常出现许多错误,是所以这里给大家提供一些经验
在wsl,linux安装turicreate的时候,会出现
Turicreate Error
If you see this message pip install did not find an available binary package for your system…
这是因为你的python版本不对,目前(2020,7,1)turicreate不支持python3.8以上的版本,如果你是ubuntu20.04或者wsl ubuntu20.04你可以下载python3.6.tgz在virtual env环境安装turicreate
jupyter notebook在wsl下需要sudo才能启动
sudo jupyter notebook --allow-root
虚拟环境安装的turicreate需要在虚拟环境下安装jupyter内核,并且在jupyter notebook上选择虚拟的内核
turicreate安装需要tensorflow的支持,但是由于turicreate更新较慢,可能会出现冲突
Could not find a version that satisfies the requirement tensorflow<=2.0.1,>=2.0.0 (from turicreate) (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
No matching distribution found for tensorflow<=2.0.1,>=2.0.0 (from turicreate)
解决办法是在虚拟环境安装turicreate,怎么在虚拟环境安装turicreate,请看文章上方。