data-gradients icon indicating copy to clipboard operation
data-gradients copied to clipboard

[import problems] Can't import detection manager

Open alexuvarovskyi opened this issue 2 years ago • 4 comments

💡 Your Question

Hey, I have a problem with importing DetectionAnalysisManager after installing data-gradients .So it's present in my site-packages. I tried using different PYTHONPATHes but it doesn't help. And I get ModuleNotFoundError again.

from data_gradients.managers.detection_manager import DetectionAnalysisManager

And have an error

Traceback (most recent call last):
  File "/home/user/data-gradients/data_gradients.py", line 1, in <module>
    from data_gradients.managers.detection_manager import DetectionAnalysisManager
  File "/home/user/data-gradients/data_gradients.py", line 1, in <module>
    from data_gradients.managers.detection_manager import DetectionAnalysisManager
ModuleNotFoundError: No module named 'data_gradients.managers'; 'data_gradients' is not a package

python - 3.9.17. data-gradients - 0.1.4

How can this be resolved? Thanks

Versions

No response

alexuvarovskyi avatar Jul 19 '23 11:07 alexuvarovskyi

Hi! The most simple way to go would be to check which python env is being used in your IDE (or the one you are using in the cmd line), and make sure you install DataGradients on that specific version.

If you installed from PyPi, just run again pip install but by specifying the whole path: /<path-to>/python -m pip install data-gradients

If you cloned the repo: /<path-to>/python -m pip install .

Hoping this helps

Louis-Dupont avatar Jul 19 '23 12:07 Louis-Dupont

@Louis-Dupont thanks, but this doesn't help. I use conda env for it, and I don't have such a problem with other libraries. I've tried your suggestion, and have the same result as earlier.
Screenshot from 2023-07-19 17-55-39

alexuvarovskyi avatar Jul 19 '23 14:07 alexuvarovskyi

@alexuvarovskyi Are you using this in a Google Colab notebook? Try to restart your runtime after installation and see if that helps

harpreetsahota204 avatar Jul 25 '23 16:07 harpreetsahota204

@alexuvarovskyi did restarting your runtime solve the issue?

Louis-Dupont avatar Aug 09 '23 13:08 Louis-Dupont