首先打开命令行,输入"pip install mxnet== 1.9.0",然后报错“ERROR: Could not find a version that satisfies the requirement mxnet== 1.9.0 (from versions: 1.6.0, 1.7.0.post1, 1.7.0.post2, 1.8.0.post0, 1.9.1, 2.0.0b1) ERROR: No matching distribution found for mxnet== 1.9.0 (base) houzhixian@houzhixiandeMacBook-Air ~ % pip install mxnet==1.9.1 --upgrade -i ”

如下面代码块所示,根据错误提示发现是版本号错误,重点是错误中给出了目前能够下载的所有版本号,然后我将版本号修改为1.9.1,后面就立马成功下载并安装了mxnet神经网络训练包。
总结:用pip命令在终端中安装mxnet包应该是目前最方便的安装方法,只需输入一行命令就可自动完成所有安装,不需要设置环境变量等,但重点是选择适用于当前pyhon版本的mxnet版本号才能成功安装,如果不清楚版本号,可以网上搜索一下,然后根据错误提示中给出的几个版本号手动修改尝试。

(base) houzhixian@houzhixiandeMacBook-Air ~ % pip install mxnet==1.9.0
ERROR: Could not find a version that satisfies the requirement mxnet==1.9.0 (from versions: 1.6.0, 1.7.0.post1, 1.7.0.post2, 1.8.0.post0, 1.9.1, 2.0.0b1)
ERROR: No matching distribution found for mxnet==1.9.0
(base) houzhixian@houzhixiandeMacBook-Air ~ % pip install mxnet==1.9.1 --upgrade -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Collecting mxnet==1.9.1
  Downloading http://mirrors.aliyun.com/pypi/packages/b7/e8/abb7b59e18e2e856ac71858b49be1b8ca84fe7099146bf98c5f8e867b46a/mxnet-1.9.1-py3-none-macosx_10_13_x86_64.whl (39.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 39.5/39.5 MB 464.1 kB/s eta 0:00:00
Requirement already satisfied: numpy<2.0.0,>1.16.0 in ./opt/anaconda3/lib/python3.9/site-packages (from mxnet==1.9.1) (1.21.5)
Requirement already satisfied: requests<3,>=2.20.0 in ./opt/anaconda3/lib/python3.9/site-packages (from mxnet==1.9.1) (2.25.1)
Collecting graphviz<0.9.0,>=0.8.1
  Downloading http://mirrors.aliyun.com/pypi/packages/53/39/4ab213673844e0c004bed8a0781a0721a3f6bb23eb8854ee75c236428892/graphviz-0.8.4-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./opt/anaconda3/lib/python3.9/site-packages (from requests<3,>=2.20.0->mxnet==1.9.1) (1.26.11)
Requirement already satisfied: idna<3,>=2.5 in ./opt/anaconda3/lib/python3.9/site-packages (from requests<3,>=2.20.0->mxnet==1.9.1) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in ./opt/anaconda3/lib/python3.9/site-packages (from requests<3,>=2.20.0->mxnet==1.9.1) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in ./opt/anaconda3/lib/python3.9/site-packages (from requests<3,>=2.20.0->mxnet==1.9.1) (2022.9.24)
Installing collected packages: graphviz, mxnet
  Attempting uninstall: graphviz
    Found existing installation: graphviz 0.20.1
    Uninstalling graphviz-0.20.1:
      Successfully uninstalled graphviz-0.20.1
**Successfully installed graphviz-0.8.4 mxnet-1.9.1**
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐