问题:在这里插入代码片
hangsan@localhost ~]$ conda create -n wen python=3.6
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
<https://repo.continuum.io/pkgs/free/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(MaxRetryError("HTTPSConnectionPool(host='repo.continuum.
io', port=443): Max retries exceeded with url: /pkgs/free/linux-64/repodata.json.bz2
(Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object
at 0x7f4e54a366d8>: Failed to establish a new connection: [Errno -2]
Name or service not known',))",),)
正常情况Linux的配置文件
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
# added by Anaconda3 installer
export PATH="/home/xiaotian(用户名)/anaconda3/bin:$PATH"
alias python="~/anaconda3/bin/python3"
alias python3=python
alias pip="~/anaconda3/bin/pip"
alias pip3=pip
alias conda="~/anaconda3/bin/conda"
更改: sudo gedit ~/.bashrc
保存: source ~/.bashrc
解决;
一、centos7之前的版本可以通过iptables相关命令实现防火墙的打开和关闭
-
1.首先可以在打开的终端使用iptables --help查看帮助使用命令;
-
2.查看防火墙状态:service iptables status(此命令可以查看防火墙是打开还是关闭);
-
3.service iptables常接参数:
-(1)service iptables stop关闭防火墙;
-(2)service iptables start开启防火墙;
-(3)service iptables reload重新加载防火墙;
-(4)service iptables restart重启防火墙;
-
4.永久关闭/打开防火墙
-
chkconfig iptables off 永久关闭防火墙;
-
chkconfig iptables on永久打开防火墙;
————————————————
-
网络ping不通的同学:
1.关闭linux的防火墙(自行上网搜索方法哈)
2.vmware中的虚拟网络编辑器中,设置子网IP(与系统IP号段相同)和网关IP(与系统网关相同)
镜像的示例配置
额外补充:
防火墙
查看已经开放的端口
firewall-cmd --list-ports
开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
命令含义:
–zone #作用域
–add-port=80/tcp #添加端口,格式为:端口/通讯协议
–permanent #永久生效,没有此参数重启后失效
关闭端口
firewall-cmd --zone=public --remove-port=3306/tcp --permanent
开启端口后记得重启
firewall-cmd --reload
或者
systemctl restart firewalld
防火墙其他命令
# 开启防火墙
systemctl start firewalld
#停止firewall
systemctl stop firewalld
#重启防火墙
systemctl restart firewalld
#firewall开机启动
systemctl enable firewalld
#禁止firewall开机启动
systemctl disable firewalld
在 | .condarc | 写入可以更改下载的镜像,加速pip
channels:
- defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
第二种解决方法
怎么解决 conda create -n name python=3.6
问题
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/repodata.json>
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.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'mirrors.tuna.tsinghua.edu.cn\', port=443): Max retries exceeded with url: /anaconda/pkgs/free/linux-64/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')],)",),))',),)
-----------------------------------------------------
上述不通 可执行下面这个
在ubuntu 的home 目录下,ctrl+h,显示所有隐藏文件,打开.condarc文件, 或终端
gedit ~/.condarc
---------------------------------
ssl_verify: true
show_channel_urls: true
channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/