tmap icon indicating copy to clipboard operation
tmap copied to clipboard

ModuleNotFoundError: No module named 'tmap.core'; 'tmap' is not a package

Open liudongliangHI opened this issue 1 year ago • 4 comments

When I try to import Faerun, I find a bug.

Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 8.4.0
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] on win32
from faerun import Faerun
Traceback (most recent call last):
  File "C:\Users\liu\anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3398, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-f83fed409234>", line 1, in <cell line: 1>
    from faerun import Faerun
  File "C:\Program Files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\liu\anaconda3\lib\site-packages\faerun\__init__.py", line 4, in <module>
    from .plot import FaerunPlot
  File "C:\Program Files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\liu\anaconda3\lib\site-packages\faerun\plot.py", line 3, in <module>
    from tmap.core import TMAPEmbedding
  File "C:\Program Files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'tmap.core'; 'tmap' is not a package

This seems to be caused by a wrong import of your latest version, from tmap.core import TMAPEmbedding, I don't understand why this was inported, tmap seems to have no core or TMAPEmbedding.

I solved by downgrading to 0.4.0. pip install faerun==0.4.0

However, I think you should fix this bug. Thanks.

liudongliangHI avatar Jul 12 '22 19:07 liudongliangHI

I installed tmap==1.2 and faerun==0.4.0 without any problems. But I got next error

      4     dims = 512
----> 5     lf = tm.LSHForest(dims, 128, store=True)
      6 

AttributeError: module 'tmap' has no attribute 'LSHForest'

What is wrong? How can I fix it?

meddwl avatar Jul 31 '22 20:07 meddwl

Hi @liudongliangHI, thanks for the info. I bumped faerun-python to version 0.4.2. This bug is now fixed. I introduced the bug because I'm testing a pip installable version of tmap (https://pypi.org/project/tmap-viz/).

daenuprobst avatar Aug 01 '22 08:08 daenuprobst

Hey @meddwl, it's a bit tricky to say--it looks like the package didn't install correctly, could you share more details on how you install it? Did you use:

conda -n tmap-env -c tmap tmap

Alternatively, you could try it with the new "beta" pip package:

pip install tmap-viz

daenuprobst avatar Aug 01 '22 08:08 daenuprobst

I installed tmap==1.2 and faerun==0.4.0 without any problems. But I got next error

      4     dims = 512
----> 5     lf = tm.LSHForest(dims, 128, store=True)
      6 

AttributeError: module 'tmap' has no attribute 'LSHForest'

What is wrong? How can I fix it?

I have also found this problem before, and it seems that it can be solved by updating to the latest version.

pip install tmap-viz

liudongliangHI avatar Sep 30 '22 06:09 liudongliangHI