ModuleNotFoundError: No module named darkflow.cli and 'nms' - python

I am trying out YOLO tutorial at https://github.com/llSourcell/YOLO_Object_Detection
When I do the step:
flow --h
I got this error:
File "/anaconda2/bin/flow", line 4, in <module>
from darkflow.cli import cliHandler
ImportError: No module named darkflow.cli
I have tried to find solution everywhere but no luck. Then I tried skip that line and continue...
flow --model cfg/yolo-new.cfg --load bin/yolo-tiny.weights --train --gpu 1.0
I got this error:
Traceback (most recent call last):
File "flow", line 4, in <module>
from darkflow.cli import cliHandler
File "./YOLO_Object_Detection/darkflow/cli.py", line 3, in <module>
from .net.build import TFNet
File "./YOLO_Object_Detection/darkflow/net/build.py", line 7, in <module>
from .framework import create_framework
File "./YOLO_Object_Detection/darkflow/net/framework.py", line 1, in <module>
from . import yolo
File "./YOLO_Object_Detection/darkflow/net/yolo/__init__.py", line 2, in <module>
from . import predict
File "./YOLO_Object_Detection/darkflow/net/yolo/predict.py", line 7, in <module>
from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
File "darkflow/cython_utils/cy_yolo_findboxes.pyx", line 1, in init darkflow.cython_utils.cy_yolo_findboxes
import numpy as np
ModuleNotFoundError: No module named 'nms'
Any help appreciated. Thank you

Both problems are discussed at the issue tracker.
*ImportError: No module named darkflow.cli
https://github.com/llSourcell/YOLO_Object_Detection/issues/3
You have to build the cython modules:
cd ./cython_utils
python3 setup.py build_ext --inplace
cd ..
ModuleNotFoundError: No module named 'nms'
https://github.com/llSourcell/YOLO_Object_Detection/issues/7
See https://keponk.wordpress.com/2017/12/07/siraj-darkflow/ for installation using conda.

Related

ModuleNotFoundError: No module named 'tensorflow.contrib.framework'

When i import tflearn in Python, it says ModuleNotFoundError: No module named 'tensorflow.contrib.framework', does someone know how to deal with this issue? Thanks.
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\User\Anaconda3\lib\site-packages\tflearn_init_.py", line 4, in
from . import config
File "C:\Users\User\Anaconda3\lib\site-packages\tflearn\config.py", line 5, in
from .variables import variable
File "C:\Users\User\Anaconda3\lib\site-packages\tflearn\variables.py", line 7, in
from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope
ModuleNotFoundError: No module named 'tensorflow.contrib.framework'
The error message suggests the module is not installed/found.
For example, I do not have tflearn installed, but I have tensorflow installed.
>>> from tensorflow.contrib.framework.python.ops import add_arg_scope
>>> import tflearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tflearn'
Try importing the whole tensorflow module and see if you are getting the same error. If so, try reinstalling the tensorflow module.

Can't import module ANTLR MyGrammarLexer and MyGrammarParser

I'm trying to start with ANTLR . When I import module antlr it's working just fine , but if I try to import MyGrammarLexer and MyGrammarParser , it's shows that MyGrammarLexer and Parser aren't in lib. I Using PyCharm , I installed ANTLR with : pip3 install antlr4-python3-runtime my code is :
import sys
from antlr4 import *
import MyGrammarLexer
import MyGrammarParser
def main(argv):
input = FileStream(argv[1])
lexer = MyGrammarLexer(input)
stream = CommonTokenStream(lexer)
parser = MyGrammarParser(stream)
tree = parser.startRule()
if __name__ == '__main__':
main(sys.argv)
Maybe whom know why i can't import MyGrammarLexer and MyGrammarParser?
Please suggest!
Tackback:
/usr/bin/python3.6 /home/andrejka/PycharmProjects/Parser/parser.py
Traceback (most recent call last):
File "/home/andrejka/PycharmProjects/Parser/parser.py", line 2, in <module>
from antlr4 import *
File "/usr/lib/python3/dist-packages/antlr4/__init__.py", line 5, in <module>
from antlr4.BufferedTokenStream import TokenStream
File "/usr/lib/python3/dist-packages/antlr4/BufferedTokenStream.py", line 19, in <module>
from antlr4.error.Errors import IllegalStateException
File "/usr/lib/python3/dist-packages/antlr4/error/Errors.py", line 5, in <module>
from antlr4.atn.Transition import PredicateTransition
File "/usr/lib/python3/dist-packages/antlr4/atn/Transition.py", line 19, in <module>
from __builtin__ import unicode
ModuleNotFoundError: No module named '__builtin__'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "/home/andrejka/PycharmProjects/Parser/parser.py", line 2, in <module>
from antlr4 import *
File "/usr/lib/python3/dist-packages/antlr4/__init__.py", line 5, in <module>
from antlr4.BufferedTokenStream import TokenStream
File "/usr/lib/python3/dist-packages/antlr4/BufferedTokenStream.py", line 19, in <module>
from antlr4.error.Errors import IllegalStateException
File "/usr/lib/python3/dist-packages/antlr4/error/Errors.py", line 5, in <module>
from antlr4.atn.Transition import PredicateTransition
File "/usr/lib/python3/dist-packages/antlr4/atn/Transition.py", line 19, in <module>
from __builtin__ import unicode
ModuleNotFoundError: No module named '__builtin__'
I ran into this problem recently when getting the same error using the pddlpy python library. I was able to fix it by doing the following:
pip3 install antlr4-python3-runtime==4.9
The version 4.9 at the end is very important.
I found out that content of the package:
https://pypi.python.org/packages/0b/6b/30c5b84d203b62e1412d14622e3bae6273399d79d20f3a24c8145213f610/antlr4-python3-runtime-4.7.tar.gz#md5=190245a0fb4abf43568489a4b6e33aba
is different from the package installed by pip3.
I have replaced content of:
~/anaconda3/envs/py3/lib/python3.6/site-packages/antlr4
with content from the package I have downloaded and extracted manually:
~/Downloads/antlr4-python3-runtime-4.7/src/antlr4
It seems to be working now - in particular the following error:
ModuleNotFoundError: No module named '__builtin__'
does not occur.
After posting your traceback I can see the error is:
ModuleNotFoundError: No module named '__builtin__'
That means the package you try to import is using python2 syntax, but you're using python3.
You should use python2 if you need to run this package, but keep in mind that you probably want to search for a different one if this is a new project.
More about why it's not working here
EDIT
They released a package with python3 support, but it seems you installed/used something different. You should verify it.

pip install of statsmodels is not working. DLL load failed: The specified module could not be found

I am really new to python and I am trying to install the statsmodels module. It seems that since I am on a 64 bits I need to use the following unofficial website http://www.lfd.uci.edu/ I did all I know about how to download a whl and I did download it and used the pip afterwards and all work fine. now when I do pip install statsmodels it work fine. However, in my shell after I try import the stats models I am getting
import statsmodels
Traceback (most recent call last): File "<pyshell#7>", line 1, in <module>
import statsmodels File "D:\Python34\lib\site-packages\statsmodels\__init__.py", line 8, in <module>
from .tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning, File "D:\Python34\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>
from .tools import add_constant, categorical File "D:\Python34\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>
from scipy.linalg import svdvals File "D:\Python34\lib\site-packages\scipy\linalg\__init__.py", line 174, in <module>
from .misc import * File "D:\Python34\lib\site-packages\scipy\linalg\misc.py", line 5, in <module>
from .blas import get_blas_funcs File "D:\Python34\lib\site-packages\scipy\linalg\blas.py", line 155, in <module>
from scipy.linalg import _fblas ImportError: DLL load failed: The specified module could not be found.
Any help would be much appreciated.
Thank you in advance

ImportError: No module named rc.manager when installing dataplicity on Raspberry Pi

I'm trying to install dataplicity in my Raspberry Pi, in order to perform a little home made project of domotics.
Can you help me?
There are two kinds of errors while installation process:
First:
ImportError: cannot import name develop
Second:
ImportError: No module named rc.manager
In order to help you to understand what's going on, I'm posting the coding that cointains the errors:
[....] Starting dataplicity...: dataplicityTraceback (most recent call last):
File "/usr/local/bin/dataplicity", line 2, in <module>
from dataplicity.app import App
File "/usr/local/lib/python2.7/dist-packages/dataplicity/app/__init__.py", line 1, in <module>
from dataplicity.app.app import App
File "/usr/local/lib/python2.7/dist-packages/dataplicity/app/app.py", line 9, in <module>
from dataplicity.client import Client
File "/usr/local/lib/python2.7/dist-packages/dataplicity/client/__init__.py", line 1, in <module>
from .client import Client
File "/usr/local/lib/python2.7/dist-packages/dataplicity/client/client.py", line 7, in <module>
from dataplicity.rc.manager import RCManager
ImportError: No module named rc.manager
This bug has now been fixed in dataplicity v 0.3.9.1. You can update by using:
pip install -U dataplicity
Or running the auto installer again.

Installing llvmpy on OSX

I've been following this guide. Unfortunately I don't think llvmpy is being installed properly (here is the output from python).
>>> import numba
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/numba/__init__.py", line 5, in <module>
from . import testing, decorators
File "/Library/Python/2.7/site-packages/numba/decorators.py", line 7, in <module>
from numba.targets import registry
File "/Library/Python/2.7/site-packages/numba/targets/registry.py", line 3, in <module>
from numba.targets import cpu
File "/Library/Python/2.7/site-packages/numba/targets/cpu.py", line 4, in <module>
import llvm.core as lc
File "llvm/__init__.py", line 6, in <module>
from llvmpy import extra
File "llvmpy/extra.py", line 5, in <module>
from llvmpy import capsule
File "llvmpy/capsule.py", line 4, in <module>
from llvmpy._capsule import (unwrap, has_ownership, downcast, wrap,
ImportError: No module named _capsule
Doing python -c "import llvm" gives me the same error as above ("No module named _capsule"). Any ideas? I am not getting errors while installing llvm,llvmpy or numba, but it is pretty clear that llvmpy isn't getting installed properly
I forgot to answer this. I solved the problem as the underlying issue was an Apple-release (see this answer to a similar'ish question).
TLDR:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
And then follow the guide given here

Categories

Resources