OS platform and distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04
GCC/Compiler version (if compiled from source): NA
Describe the current behavior
root@mindspore:~/mindspore# python3.7 --version
Python 3.7.5
root@mindspore:~/mindspore# python3.7 -c 'import mindspore'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/root/mindspore/mindspore/__init__.py", line 17, in <module>
from . import common, train
File "/root/mindspore/mindspore/common/__init__.py", line 16, in <module>
from . import dtype
File "/root/mindspore/mindspore/common/dtype.py", line 20, in <module>
from .._c_expression import typing, EnvInstance_
ModuleNotFoundError: No module named 'mindspore._c_expression'
root@mindspore:~/mindspore#
Describe the expected behavior
Being able to import mindspore correctly.
Steps to reproduce the issue
Build Python 3.7.5 manually
Run command pip3.7 install https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl to install mindspore
python3.7 -c 'import mindspore'
Related log / screenshot
Special notes for this issue
The procedure of building Python 3.7.5:
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
tar zxvf Python-3.7.5.tar.gz
cd Python-3.7.5
./configure --enable-optimizations --prefix=/usr/local/python3.7 --enable-shared
make -j4
make install
cp /usr/local/python3.7/lib/libpython3.7m.so.1.0 /usr/lib/x86_64-linux-gnu/
cd /usr/bin
ln -s /usr/local/python3.7/bin/python3.7 python3.7
ln -s /usr/local/python3.7/bin/pip3.7 pip3.7
hi @ligc , the error occurred because python take your current mindspore source dir as mindspore module path, please cd out off mindspore dir and try again.
Environment
Hardware Environment(
Ascend
/GPU
/CPU
):/device cpu
Software Environment:
Describe the current behavior
Describe the expected behavior
Being able to import mindspore correctly.
Steps to reproduce the issue
pip3.7 install https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
to install mindsporeRelated log / screenshot
Special notes for this issue
The procedure of building Python 3.7.5: