Windows
"win+R",“shift+ctrl+enter”,打开cmd 管理员模式

直接输入“python”,查看python版本。
C:\Windows\system32>python
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
若python没有activated
- 管理员身份激活cmd https://blog.csdn.net/m0_58547974/article/details/119978383 “conda activate”
- 查看anaconda位置 “conda info --envs” * C:\ProgramData\Anaconda3
- 激活“conda activate C:\ProgramData\Anaconda3”
- 退出(base) conda deactivate
配置jax
先下载jaxlib
whls.blob.core.windows.net/unstable/index.html
在上述链接里找到适合自己python版本号的jaxlib包,比如cp37,就代表是python3.7,选一个下载在Anaconda的目录下。比如我的是“C:\ProgramData\Anaconda3”

cmd命令打开及切换目录路径的实现_DOS/BAT_脚本之家
cmd(管理员模式)切换路径到anaconda路径下
cd C:\ProgramData\Anaconda3
pip install jaxlib-0.4.11-cp38-cp38-win_amd64.whl
pip install "jax[cpu]===0.4.11" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
如果jax 下载出现ssl报错
【日常踩坑】解决 pip 安装第三方包时因 SSL 报错_pip ssl_ywang_wnlo的博客-CSDN博客Python随笔:设置Windows的pip镜像配置文件 pip.ini-CSDN博客
找到pip.ini配置文件
将里面内容替换成
[global]
index-url = http://mirrors.aliyun.com/pypi/simple
extra-index-url =
http://pypi.douban.com/simple
https://pypi.tuna.tsinghua.edu.cn/simple
http://pypi.mirrors.ustc.edu.cn/simple
http://pypi.hustunique.com
[install]
trusted-host =
mirrors.aliyun.com
pypi.douban.com
pypi.tuna.tsinghua.edu.cn
pypi.mirrors.ustc.edu.cn
mirrors.ustc.edu.cn
mirrors.bfsu.edu.cn
pypi.hustunique.com
如果jax 或jaxlib安装失败,需要重装,需要先卸载干净
pip uninstall jax jaxlib
祝大家好运!

1万+

被折叠的 条评论
为什么被折叠?



