Anaconda更新失败 HTTP None None for url

https://blog.csdn.net/qq_27576655/article/details/70667046

Anaconda更新失败

输入命令:conda create -n tensorflow python=3.5.2 
Fetching package metadata …..

显示错误信息: 
CondaHTTPError: HTTP None None for url https://conda.anaconda.org/anaconda-fusion/win-64/repodata.json 
Elapsed: None

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=\’conda.anaconda.org\’, port=443): Max retries exceeded with url: /anaconda-fusion/win-64/repodata.json (Caused by ReadTimeoutError(“HTTPSConnectionPool(host=\’conda.anaconda.org\’, port=443): Read timed out. (read timeout=9.15)”,))’,),)

解决办法:

查看配置信息 输入命令:conda config –show 
显示如下信息: 
add_anaconda_token: True 
add_pip_as_python_dependency: True 
allow_softlinks: True 
always_copy: False 
always_softlink: False 
always_yes: False 
auto_update_conda: True 
binstar_upload: None 
changeps1: True 
channel_alias: https://conda.anaconda.org 
channel_priority: True 
channels: 
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
defaults 
client_ssl_cert: 
client_ssl_cert_key: 
create_default_packages: [] 
debug: False 
default_channels: 
https://repo.continuum.io/pkgs/free 
https://repo.continuum.io/pkgs/r 
https://repo.continuum.io/pkgs/pro 
https://repo.continuum.io/pkgs/msys2 
disallow: [] 
envs_dirs: 
- C:\Anaconda3\envs 
- C:\Users\surpass\AppData\Local\conda\conda\envs 
- C:\Users\surpass.conda\envs 
json: False 
offline: False 
proxy_servers: {} 
quiet: False 
shortcuts: True 
show_channel_urls: True 
ssl_verify: True 
track_features: [] 
update_dependencies: True 
use_pip: True 
verbosity: 0

将上述显示的配置信息-defaults所在行删除即可,因此要找到配置文件.condarc的路径 
输入命令: conda - -help

显示信息如下: 
Options:

positional arguments: 
command 
info Display information about current conda install. 
help Displays a list of available conda commands and their help 
strings. 
list List linked packages in a conda environment. 
search Search for packages and display their information. The input 
is a Python regular expression. To perform a search with a 
search string that starts with a -, separate the search from 
the options with –, like ‘conda search – -h’. A * in the 
results means that package is installed in the current 
environment. A . means that package is not installed but is 
cached in the pkgs directory. 
create Create a new conda environment from a list of specified 
packages. 
install Installs a list of packages into a specified conda 
environment. 
update Updates conda packages to the latest compatible version. This 
command accepts a list of package names and updates them to 
the latest versions that are compatible with all other 
packages in the environment. Conda attempts to install the 
newest versions of the requested packages. To accomplish 
this, it may update some packages that are already installed, 
or install additional packages. To prevent existing packages 
from updating, use the –no-update-deps option. This may 
force conda to install older versions of the requested 
packages, and it does not prevent additional dependency 
packages from being installed. If you wish to skip dependency 
checking altogether, use the ‘–force’ option. This may 
result in an environment with incompatible packages, so this 
option must be used with great caution. 
upgrade Alias for conda update. See conda update –help. 
remove Remove a list of packages from a specified conda environment. 
uninstall Alias for conda remove. See conda remove –help. 
config Modify configuration values in .condarcThis is modeled 
after the git config command. Writes to the user .condarc 
file (C:\Users\surpass.condarc) by default
clean Remove unused packages and caches. 
package Low-level conda package utility. (EXPERIMENTAL)

在上面显示信息中找到config那一行(加黑的) 后面的描述信息告诉了你的.condarc文件的路径,用记事本打开并删除-defaults那一行即可。

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
在使用conda安装或更新软件包时,可能会遇到"fetching package metadata ... condahttperror: http none none for url <none>"的错误消息。这个错误通常意味着conda无法连接到网络或者无法从指定的URL获取软件包的元数据。 解决此问题的方法有以下几种: 1. 检查网络连接:确保您的计算机连接到互联网,可以通过尝试访问其他网页或使用ping命令测试连接。如果网络连接正常,可能是由于conda配置或网络设置问题。 2. 检查代理设置:如果您使用了代理服务器来访问互联网,可能需要在conda的配置文件中设置代理。您可以在~/.condarc或者%USERPROFILE%\.condarc文件中添加proxy_servers配置节,并按照代理服务器的要求进行相应设置。 3. 清除缓存文件:有时候,本地缓存的元数据可能会损坏或过期,可以尝试清除conda的缓存文件。可以使用"conda clean -t"命令清理临时文件,或者使用"conda clean -a"命令清理所有缓存文件。 4. 更新conda:确保您使用的是最新版本的conda。可以使用"conda update conda"命令来更新conda本身,然后再尝试安装或更新软件包。 5. 更换镜像源:由于conda默认使用的镜像源可能会有问题,您可以尝试更改镜像源。可以通过在conda配置文件中添加channels配置节,并指定其他可用的镜像源来更换。 6. 使用conda的--debug选项:如果以上方法都无法解决问题,可以尝试使用conda的--debug选项来获取更详细的错误信息。可以使用"conda install --debug packagename"命令来尝试安装软件包,并查看debug日志以获取有关错误原因的更多信息。 综上所述,当遇到"fetching package metadata ... condahttperror: http none none for url <none>"错误时,可以尝试检查网络连接、代理设置、清除缓存文件、更新conda、更换镜像源以及使用--debug选项等方法来解决问题。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值