apache / singa

a distributed deep learning platform
Apache License 2.0
3.34k stars 1.23k forks source link

Python 3.11, Model, ImportError #1164

Open fengints opened 4 months ago

fengints commented 4 months ago

Python 3.11.6, Clean install pip install singa -f http://singa.apache.org/docs/next/wheel-cpu.html --trusted-host singa.apache.org

from singa import model

Error: python3.11/site-packages/singa/model.py", line 30, in from collections import Iterable ImportError: cannot import name 'Iterable' from 'collections' https://github.com/apache/singa/blob/6d9cd7f9ab6e1ce3caac381db586814464fe5511/python/singa/model.py#L30

I also tried importing Model

from singa import Model

File "", line 1, in ImportError: cannot import name 'Model' from 'singa'

lzjpaul commented 4 months ago

May I know did you use conda or other installation tools?

You can send an email to zhaojing@apache.org, we can discuss via email.

Thanks, Zhaojing.

fengints commented 4 months ago

Iam using python and pip, no conda

fengints commented 4 months ago

The Iterable abstract class was removed from collections in Python 3.10

https://docs.python.org/3.8/library/collections.html Deprecated since version 3.3, will be removed in version 3.10: Moved Collections Abstract Base Classes to the collections.abc module. For backwards compatibility, they continue to be visible in this module through Python 3.9.

lzjpaul commented 4 months ago

Iam using python and pip, no conda

Can you try the conda (miniconda or anaconda) and install the python 3.9. and then in the conda environment, you can try install singa 3.9 version. We provide python versions 3.9, 3.10 and 3.11

Thanks.

fengints commented 4 months ago

i think python 3.9 would pass this error

lzjpaul commented 4 months ago

An easier way is to download the wheel file from https://singa.apache.org/docs/next/wheel-cpu.html, and then install it locally.

For further enquiries, you can send an email to zhaojing@apache.org, and we can discuss them via email.

Thanks.

fengints commented 4 months ago

Docs says singa supports python 3.9 , 3.10, 3.11

fengints commented 4 months ago

Python 3.10 and 3.11 doesn't have Iterable class in collections https://docs.python.org/3.11/library/collections.html

lzjpaul commented 4 months ago

i think python 3.9 would pass this error

Thanks for your suggestion!