这里主要解析安装anaconda3-5.01,清华镜像,wordcloud时的报错记录
本作者电脑情况:操作系统Ubuntu14.04
开始的时候尝试用pyenv下载anaconda
pxh@pxh:~$ pyenv install anaconda3-5.0.1
Downloading Anaconda3-5.0.1-Linux-x86_64.sh...
-> https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
error: failed to download Anaconda3-5.0.1-Linux-x86_64.sh
BUILD FAILED (Ubuntu 14.04 using python-build 20160602)
Inspect or clean up the working tree at /tmp/python-build.20180430153443.3493
Results logged to /tmp/python-build.20180430153443.3493.log
Last 10 log lines:
/tmp/python-build.20180430153443.3493 ~
curl: (18) transfer closed with 545325503 bytes remaining to read
上网翻了个遍,没有办法解决,后来就改用如下方法安装anaconda
输入命令
wget https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
bash Anaconda3-5.1.0-Linux-x86_64.sh
这里要注意不要以管理员的身份去下载,后果很严重
执行完上面两条命令后会进入安装界面
注意下面2处不要回车用缺省的选项:
Do you accept the license terms? [yes|no]
[no] >>> yes
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/ai/.bashrc ? [yes|no]
[no] >>> yes
Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no
最后验证anaconda安装是否成功
$ cd
$ . ./.bash_profile
$ python
[ai@AIDevEnv ~]$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
用exit()命令退出python
>>> exit()
上面是安装anaconda,以下是安装清华镜像
插一句:或许会有人问为什么要安装清华镜像,原因很简单,你直接用conda来下载wordcloud包是用外网来下载的,很慢,网有时会断,清华镜像可以帮助减少下载时间 ---这只是个人想法,不知道对不对,反正这个坑我掉过
pxh@pxh:~$ conda install wordcloud
运行报错
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.continuum.io/pkgs/main/linux-64/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectionError(ReadTimeoutError("HTTPSConnectionPool(host='repo.continuum.io', port=443): Read timed out.",),)
解决方法
pxh@pxh:~$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
pxh@pxh:~$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
pxh@pxh:~$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
pxh@pxh:~$ conda config --set show_channel_urls yes
安装wordcloud
conda install wordcloud
最后成功