mindspore-ai / mindspore

MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
https://gitee.com/mindspore/mindspore
Apache License 2.0
4.23k stars 700 forks source link

cannot install on WSL #7

Open zhaoxvdong opened 4 years ago

zhaoxvdong commented 4 years ago

while I try to intall MindSpore on the WSL with the command “pip 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

it report the error: ERROR: mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl is not a supported wheel on this platform.

my python version is 3.7.7

leonwanghui commented 4 years ago

@zhaoxvdong Thanks for pulling this issue. And the answer is that currently MindSpore can NOT be supported on WSL system. Please take a look at MindSpore support matrix for details.

leonwanghui commented 4 years ago

BTW, if you don't have the Ubuntu-x86 operating system and still wants to build MindSpore with CPU backend, we sincerely suggest you deploy in container by fetching the docker image from MindSpore Dockerhub:

docker pull mindspore/mindspore:0.1.0-alpha
zhaoxvdong commented 4 years ago

WSL is Windows Subsystem for Linux. My WSL is Ubuntu 16.04.5 LTS. Best regarded.

Xudong Zhao On 3/28/2020 13:59,Leon Wangnotifications@github.com wrote:

BTW, if you don't have the Ubuntu-x86 operating system and still wants to build MindSpore with CPU backend, we sincerely suggest you deploy in container by fetching the docker image from MindSpore Dockerhub:

docker pull mindspore/mindspore:0.1.0-alpha

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

leonwanghui commented 4 years ago

@zhaoxvdong Could you provide more software envrionments of your machine? Besides python, MindSpore also have some constraints on gcc, cmake and other software environments.

Maybe you can find more answers on MindSpore FAQ?

Or the Chinese version is here

leonwanghui commented 4 years ago

Could you just provide the version of pip? The error could result from the inconsistency between you Python and Pip version.

zhaoxvdong commented 4 years ago

thank you, it is solved.

it is the pip version problem.

Best regarded.

Xudong Zhao On 3/28/2020 14:23,Leon Wangnotifications@github.com wrote:

@zhaoxvdong Could you provide more software envrionments of your machine? Besides python, MindSpore also have some constraints on gcc, cmake and other software environments.

Maybe you can find more answers on MindSpore FAQ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

leonwanghui commented 4 years ago

@zhaoxvdong If resolved, could you close this issue?

pjgao commented 4 years ago

same errors occured in WSL when pip install offline wheel file.


(base) linux@A190329687-PC:/mnt/d/mindspore$ pip install mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
Looking in indexes: http://***.com/pypi/simple/
Processing ./mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
ERROR: Exception:
Traceback (most recent call last):
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 382, in run
    resolver.resolve(requirement_set)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for
    req, self.session, self.finder, self.require_hashes
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 194, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 452, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 416, in unpack_file_url
    unpack_file(from_path, location, content_type)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/utils/unpacking.py", line 252, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/utils/unpacking.py", line 139, in unzip_file
    shutil.copyfileobj(fp, destfp)
  File "/home/linux/miniconda3/lib/python3.7/shutil.py", line 79, in copyfileobj
    buf = fsrc.read(length)
  File "/home/linux/miniconda3/lib/python3.7/zipfile.py", line 899, in read
    data = self._read1(n)
  File "/home/linux/miniconda3/lib/python3.7/zipfile.py", line 989, in _read1
    self._update_crc(data)
  File "/home/linux/miniconda3/lib/python3.7/zipfile.py", line 917, in _update_crc
    raise BadZipFile("Bad CRC-32 for file %r" % self.name)
zipfile.BadZipFile: Bad CRC-32 for file 'mindspore/_c_dataengine.cpython-37m-x86_64-linux-gnu.so'

Pip version:

(base) linux@A190329687-PC:/mnt/d/mindspore$ pip --version
pip 19.3.1 from /home/linux/miniconda3/lib/python3.7/site-packages/pip (python 3.7)

Ubuntu version:

(base) linux@A190329687-PC:/mnt/d/mindspore$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
leonwanghui commented 4 years ago

Hi @pjgao, firstly plz confirm if you have already downloaded the *.whl package from MindSpore download website before running your command. If not, please use the complete download link of MindSpore whl package. In your case, please try this command:

pip 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
pjgao commented 4 years ago

I cannot install from this url maybe because of the proxy in company while other packages(like tqdm from https://files.pythonhosted.org/packages/47/55/fd9170ba08a1a64a18a7f8a18f088037316f2a41be04d2fe6ece5a653e8f/tqdm-4.43.0-py2.py3-none-any.whl) are OK.

(base) linux@A190329687-PC:/mnt/d/mindspore$ pip 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
Looking in indexes: http://***/pypi/simple/
Collecting mindspore==0.1.0
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))': /0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='ms-release.obs.cn-north-4.myhuaweicloud.com', port=443): Max retries exceeded with url: /0.1.0-alpha/MindSpore/cpu/ubuntu-x86/mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

So I download mindspore wheel file from 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.

(base) linux@A190329687-PC:/mnt/d/mindspore$ pip install ./mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
Looking in indexes: http://***/pypi/simple/
Processing ./mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
ERROR: Exception:
Traceback (most recent call last):
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 382, in run
    resolver.resolve(requirement_set)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for
    req, self.session, self.finder, self.require_hashes
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 194, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 452, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/download.py", line 416, in unpack_file_url
    unpack_file(from_path, location, content_type)
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/utils/unpacking.py", line 252, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/home/linux/miniconda3/lib/python3.7/site-packages/pip/_internal/utils/unpacking.py", line 139, in unzip_file
    shutil.copyfileobj(fp, destfp)
  File "/home/linux/miniconda3/lib/python3.7/shutil.py", line 79, in copyfileobj
    buf = fsrc.read(length)
  File "/home/linux/miniconda3/lib/python3.7/zipfile.py", line 899, in read
    data = self._read1(n)
  File "/home/linux/miniconda3/lib/python3.7/zipfile.py", line 989, in _read1
    self._update_crc(data)
  File "/home/linux/miniconda3/lib/python3.7/zipfile.py", line 917, in _update_crc
    raise BadZipFile("Bad CRC-32 for file %r" % self.name)
zipfile.BadZipFile: Bad CRC-32 for file 'mindspore/_c_dataengine.cpython-37m-x86_64-linux-gnu.so'
kisnwangg commented 4 years ago

Hi @pjgao, make sure your download is complete, and please try this command:

python3.7 -m pip install ./mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl
leonwanghui commented 4 years ago

@pjgao Could you confirm if the whl package is downloaded completely? Please use sha256sum ././mindspore-0.1.0-cp37-cp37m-linux_x86_64.whl command to check if the SHA-256 is 45c473a97a6cb227e4221117bfb1b3ebe3f2eab938e0b76d5117e6c3127b8e5c.

BTW, you can find SHA-256 for all build options at MindSpore download page.

pjgao commented 4 years ago

Thanks a lot, the fact is that the whl file I downloaded is corrupted and its sha256 is wrong. After I re-downloaded, it can be installed and used normally.

leonwanghui commented 4 years ago

@pjgao Cool, plz feel free to ask if you have any question when testing MindSpore.

hannibalhuang commented 4 years ago

@pjgao @zhaoxvdong some additional docker-fu on WSL: https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly, hope it will help :)