AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.57k stars 7.95k forks source link

Cannot Import darknet from darknet.py #1125

Open nathansomavarapu opened 6 years ago

nathansomavarapu commented 6 years ago

I am having issues importing darknet, specifically if I attempt, import darknet as dn then I get the error:

ImportError: dynamic module does not define module export function (PyInit_darknet).

Any idea how to fix this? Thanks in advance!

AlexeyAB commented 6 years ago
nathansomavarapu commented 6 years ago

I am currently working on Linux and I have compiled with LIBSO=1.

Running darknet.py works by itself and when I add code to the main function it runs as expected, importing is the aspect that fails.

Thanks!

ghost commented 6 years ago

I'm also having this issue. Any ideas?

UsaidPro commented 5 years ago

I found that renaming darknet.py to some other name (like "dknet.py") and doing "import dknet as dn" worked.

PeterQuinn925 commented 5 years ago

When you run your script, try running it from the directory where the library is. That worked for me.