给服务器安装Anaconda遇到的问题和解决办法

首先如果直接敲

bash Anaconda3-5.2.0-Linux-x86_64.sh

告诉我已存在

ERROR: File or directory already exists: '/root/anaconda3'
If you want to update an existing installation, use the -u option.

需要使用

bash Anaconda3-5.2.0-Linux-x86_64.sh -u

之后提示没有安装bunzip2,使用以下指令安装,然后还是报错,这次是软件源有问题

[/root/anaconda3] >>> 
PREFIX=/root/anaconda3
Anaconda3-5.2.0-Linux-x86_64.sh: line 350: bunzip2: command not found
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
[root@ml-cent-3 result]# yum install -y bzip2
Loaded plugins: fastestmirror
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; Unknown error"
Trying other mirror.

好吧,换个软件源,按照网上的方法来,我发现我没有wget……

只能参考给centos重新安装yum的base-repo源手动下载对应处理器的版本,然后上传到linux上安装wget

[root@ml-cent-3 result]# rpm -ivh wget-1.19.5-3.fc29.x86_64.rpm
warning: wget-1.19.5-3.fc29.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 429476b4: NOKEY
error: Failed dependencies:
	libgnutls.so.30()(64bit) is needed by wget-1.19.5-3.fc29.x86_64
	libgnutls.so.30(GNUTLS_3_4)(64bit) is needed by wget-1.19.5-3.fc29.x86_64
	libidn2.so.0()(64bit) is needed by wget-1.19.5-3.fc29.x86_64
	libidn2.so.0(IDN2_0.0.0)(64bit) is needed by wget-1.19.5-3.fc29.x86_64
	libmetalink.so.3()(64bit) is needed by wget-1.19.5-3.fc29.x86_64
	libnettle.so.6()(64bit) is needed by wget-1.19.5-3.fc29.x86_64
	libnettle.so.6(NETTLE_6)(64bit) is needed by wget-1.19.5-3.fc29.x86_64
	libpsl.so.5()(64bit) is needed by wget-1.19.5-3.fc29.x86_64

报错,百度得知使用下面方式可以安装成功,但是无法使用

rpm -ivh wget-1.19.5-3.fc29.x86_64.rpm --force --nodeps
# 安装后
# wget
wget: error while loading shared libraries: libidn2.so.0: cannot open shared object file: No such file or directory

原来下的版本不对,还是去这里下载tar.gz的吧,解压后进入文件夹查看INSTALL文档中有提示安装方法,于是尝试,,结果没有安装gcc,尝试用yum去安装gcc是失败的,以为软件源的问题没解决啊!

[root@ml-cent-3 wget-1.19]# file  INSTALL
INSTALL: ASCII text
[root@ml-cent-3 wget-1.19]# vi INSTALL
[root@ml-cent-3 wget-1.19]# ./configure && make && make install
configure: configuring for GNU Wget 1.19
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether make supports nested variables... (cached) yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/etc/result/wget-1.19':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

最后解决办法很简单,很粗暴,但是我竟然没有想到,,直接在网易源官网就可以下载repo文件,晕,赶紧下载下来,重命名成CentOS-Base.repo放到/etc/yum.repos.d/,还是不行

最后解决办法

最后对比了下可以正常通过yum安装软件的服务器的export出来的信息,发现其他正常服务器都有设置proxy,就这个服务器没有,果断把proxy设置搬过去,可以正常通过yum安装程序了,说明之前的repo根本没有问题!

之后就可以正常安装Anaconda了,需要注意的是刚装好是用不了conda,pip等命令的,需要添加路径

export PATH=$PATH:/root/anaconda3/bin

 

  • 12
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值