ejohnson643 / EMBEDR

Statistical quality evaluation of dimensionality reduction algorithms
29 stars 2 forks source link

EMBEDR cannot be loaded from main folder. #10

Open ejohnson643 opened 2 years ago

ejohnson643 commented 2 years ago

Attempting to load EMBEDR after a clean install in the main directory of this repo: from EMBEDR import EMBEDR causes the following error:

Traceback (most recent call last): 
  File "<stdin>", line 1, in <module> 
  File "~/TestEMBEDRInstall/EMBEDR-master/EMBEDR/__init__.py", line 1, in <module>
    from EMBEDR.embedr import EMBEDR, EMBEDR_sweep
  File "~/TestEMBEDRInstall/EMBEDR-master/EMBEDR/embedr.py", line 9, in <module>
    from EMBEDR.tsne import tSNE_Embed
  File "~/TestEMBEDRInstall/EMBEDR-master/EMBEDR/tsne.py", line 32, in <module>
    from EMBEDR import _tsne
ImportError: cannot import name '_tsne' from partially initialized module 'EMBEDR' (most likely due to a circular import) (~/TestEMBEDRInstall/EMBEDR-master/EMBEDR/__init__.py)

This is because the folder and the module have the same name, so that when from EMBEDR import _tsne is called, it first looks in the folder named EMBEDR for the _tsne.py module, which doesn't exist. We should rename the source folder to a different name so that EMBEDR applies to the package/module and not to that folder.