MindSpore Nightly is a preview version which includes latest features and bugfixes, not fully supported and tested. Install MindSpore Nightly version if you wish to try out the latest features or bug fixes can use this version.
This document describes how to quickly install MindSpore Nightly by pip in a Linux system with a CPU environment.
In the process of confirming the system environment information, if you need to know how to install third-party dependent software, you can refer to the practice provided by the community - Source code compilation and installation on Ubuntu (CPU) MindSpore in the third-party dependent software installation related section, hereby thank the community members damon0626 sharing.
The following table lists the system environment and third-party dependencies required to install MindSpore.
software | version | description |
---|---|---|
Ubuntu | 18.04 | OS for running MindSpore |
Python | 3.7-3.9 | Python environment that MindSpore depends |
GCC | 7.3.0~9.4.0 | C++ compiler for compiling MindSpore |
gmp | 6.1.2 | Multiple precision arithmetic library used by MindSpore |
The following describes how to install the third-party dependencies.
Python can be installed in multiple ways.
Install Python with Conda.
Install Miniconda:
cd /tmp
curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh
bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b
cd -
. ~/miniconda3/etc/profile.d/conda.sh
conda init bash
After the installation is complete, you can set up Tsinghua source acceleration download for Conda, and see here.
Create a virtual environment, taking Python 3.7.5 as an example:
conda create -n mindspore_py37 python=3.7.5 -y
conda activate mindspore_py37
Or install Python via APT with the following command.
sudo apt-get update
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get install python3.7 python3.7-dev python3.7-distutils python3-pip -y
# set new installed Python as default
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 100
# install pip
python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple
sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.7 100
pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple
To install other Python versions, just change 3.7
in the command.
Run the following command to check the Python version.
python --version
Run the following commands to install GCC and gmp.
sudo apt-get install gcc-7 libgmp-dev -y
To install a later version of GCC, run the following command to install GCC 8.
sudo apt-get install gcc-8 -y
Or install GCC 9.
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-9 -y
Execute the following command to install MindSpore:
pip install mindspore-dev -i https://pypi.tuna.tsinghua.edu.cn/simple
Of which,
python -c "import mindspore;mindspore.run_check()"
The outputs should be the same as:
MindSpore version: __version__
The result of multiplication calculation is correct, MindSpore has been installed successfully!
It means MindSpore has been installed successfully.
Using the following command if you need to update the MindSpore version:
pip install --upgrade mindspore-dev=={version}
Of which,
{version}
should be specified as the rc version number, e.g. 1.6.0rc1.dev20211125; When updating to the latest version automatically, =={version}
could be removed.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。