SOMPY icon indicating copy to clipboard operation
SOMPY copied to clipboard

can not import SOM

Open azize opened this issue 7 years ago • 18 comments

I am using Python 3.5.1 with PyCharm IDE on Windows. I am getting below error:

can you please help me?

C:\Python35\python.exe C:/Users/azzet/PycharmProjects/PythonSom.py Traceback (most recent call last): File "C:/Users/azzet/PycharmProjects/PythonSom.py", line 4, in import sompy File "C:\Python35\lib\site-packages\sompy_init_.py", line 2, in from sompy import SOM ImportError: cannot import name 'SOM'

Process finished with exit code 1

azize avatar Feb 25 '17 18:02 azize

I have exactly the same issue

Nicowhaz avatar Mar 13 '17 15:03 Nicowhaz

Me too

honorinli151 avatar Mar 28 '17 03:03 honorinli151

Sorry, not tested with Py3. with Py2.7 it should work.

sevamoo avatar May 25 '17 21:05 sevamoo

Is there any solution for this issue right now?

njali2001 avatar Jul 06 '17 01:07 njali2001

@compmonks did you have a solution for this? If I remember correctly you used it in py3? Thanks

sevamoo avatar Jul 06 '17 07:07 sevamoo

Sompy would not work when loaded as a package for py 3+ for dependencies and syntax reasons. @azize @sevamoo , I should have pushed a version for this. Let me know if it works.

compmonks avatar Jul 06 '17 11:07 compmonks

I had the same problem and the SOMPY version forked by @compmonks worked for me:

pip3 install git+https://github.com/compmonks/SOMPY.git

I only had to remove ipdb import from sompy.py and mapview.py because due to other dependencies I had installed the ipdb import was opening a prompt in my setup. Thank you @compmonks for the fork!

altermarkive avatar Jul 21 '17 13:07 altermarkive

Have the same issue, but problem appers in my case also in python 2.7. Is there already a solution?

cranzlerdave avatar Aug 10 '17 10:08 cranzlerdave

I have exactly the same issue

riverzhou avatar Aug 17 '17 03:08 riverzhou

Same issue. It’s because of ipdb module.Afrer I commented them out in sompy.py and mapview.py, it worked. It’s just debugger

dryjins avatar Nov 19 '17 22:11 dryjins

Hi, I have the same issue. @nomad-jin What exactly did you comment out? what is 'ipdb'?

piaebe avatar Mar 28 '18 17:03 piaebe

@pricklpitty - ipdb is a module which gives access the IPython debugger (https://pypi.python.org/pypi/ipdb). Besides import ipdb in sompy.py and mapview.py there are no other references to that module in the code so it was probably left accidentally after a debugging session...

altermarkive avatar Mar 29 '18 18:03 altermarkive

how could i save the model , and predict the cluster of new data , like kmeans in sklearn "model.predict(new_data)"?????????

yangzhili1992 avatar Aug 08 '19 09:08 yangzhili1992

Did anyone found the solution for this open issue?

rebelgiri avatar May 01 '20 08:05 rebelgiri

for me I installed SOMPY using the setup source, this fixed my bug last year. That longtime I've used it.

abdoulsn avatar Jun 07 '21 14:06 abdoulsn

git clone https://github.com/sevamoo/SOMPY.git cd SOMPY python setup.py install

This fixed my issue

mashirali avatar Aug 15 '22 08:08 mashirali

I get

Traceback (most recent call last): File "D:\Projects\AI\SOM\data\sompy_clustering.py", line 3, in import sompy as sompy File "C:\Python\lib\site-packages\sompy_init_.py", line 2, in from sompy import SOM ImportError: cannot import name 'SOM' from partially initialized module 'sompy' (most likely due to a circular import) (C:\Python\lib\site-packages\sompy_init_.py)

Getting the package from GIT does NOT fix the issue. I have Python 3.10.5

dejudicibus avatar Nov 14 '23 16:11 dejudicibus