Anaconda创建新的环境一直报错
报错信息如下:
CondaHTTPError: HTTP 404 NOT FOUND for url <https://pypi.tuna.tsinghua.edu.cn/simple/noarch/repodata.json>
Elapsed: 00:01.358961The remote server could not find the noarch directory for the
requested channel with url: https://pypi.tuna.tsinghua.edu.cn/simpleAs of conda 4.3, a valid channel must contain a `noarch/repodata.json` and
associated `noarch/repodata.json.bz2` file, even if `noarch/repodata.json` is
empty. please request that the channel administrator create
`noarch/repodata.json` and associated `noarch/repodata.json.bz2` files.
$ mkdir noarch
$ echo '{}' > noarch/repodata.json
$ bzip2 -k noarch/repodata.json
解决办法:镜像是http开头,不要写https
- 查看所有的镜像信息
conda config --show-sources
- 删除镜像
conda config --remove channels 镜像的网址
- 添加镜像
# 添加新镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes
Jupyter notebook中使用新安装的环境keras
1.打开Jupyter ,点击new,点击Terminal
2.激活你要加到jupyter里面的本地环境(keras)
conda activate keras
3.安装ipykernal
可以使用命令conda,但是速度很慢
conda install ipykernel
建议使用pip
pip install ipykernel -i https://pypi.mirrors.ustc.edu.cn/simple/
4.把本地环境注入到jupyter中
python -m ipykernel install --user --name keras --display-name "keras"
使用conda下载太慢
可以使用pip install 要下载的东西 然后-i 指定镜像源
镜像源
https://pypi.mirrors.ustc.edu.cn/simple/
https://pypi.tuna.tsinghua.edu.cn/simple
https//pypi.doubanio.com/simple/