ModuleNotFoundError: No module named lib - python-3.x

I have cloned a GitHub repository: https://github.com/xiaojunxu/SQLNet
I have followed the steps until downloading glove embeddings. On running python extract_vocab.py I get 'no module named lib error'.
The lib file is in the folder
The directory structure is as follows:
SQLNet
==>sqlnet
==>lib
==>__init__
==>dbengine
==>utils.py
==>extract_vocab.py
On executing python extract_vocab.py it gives me the following error:
(sql) C:\Users\khata\SQLNet>python extract_vocab.py
Traceback (most recent call last):
File "extract_vocab.py", line 3, in <module>
from sqlnet.utils import *
File "C:\Users\khata\SQLNet\sqlnet\utils.py", line 2, in <module>
from lib.dbengine import DBEngine
ModuleNotFoundError: No module named 'lib'
lib directory is present with dbengine in it.
I am working in WINDOWS with a python3 environment

I copied and pasted the contents of the dbengine file in utils.py.Which solved the problem

Change it to from .lib.dbengine import DBEngine

Related

How to import files in other Folder in Python

I'm using Python 3.10.
I have the following directory:
folder project
The File parse-subfinder.py , has a code:
parse-subfinder
But I get the error:
Traceback (most recent call last):
File "c:\Users\Windows\Desktop\smart-recon\subdomains\parse-subfinder.py", line 2, in
from ..utils.directory import Directory
ImportError: attempted relative import with no known parent package
How can I make this work?
I tried:
from ..utils.directory import Directory
from ..utils.discover import Discover

ModuleNotFoundError: No module named 'scripts.trio_ircproxy'

I just started getting this error:
ImportError: attempted relative import with no known parent package
My directory structure us:
~/Documents/trio_ircproxy/scripts/trio_ircproxy/system_data.py
and I am running the interpreter from ~/Documents/trio_ircproxy/
(base) ashburry#ashburry-ThinkCentre-M92P:~/Documents/trio_ircproxy$ python3 trio_ircproxy.py
Traceback (most recent call last):
File "trio_ircproxy.py", line 35, in <module>
from scripts.trio_ircproxy.system_data import SystemData as system_data
ModuleNotFoundError: No module named 'scripts.trio_ircproxy'
SystemData is a class I am trying to import.
I was not getting this error before so I do not know what the problem is. Any Help?
I fixed this by putting an __init__.py file in the /scripts/ and /scripts/trio_ircproxy/ directories. The file is blank as I am not sure what to put in the __init__.py file.

external library error while running AWS Glue job

I have placed the external python libraries (*.whl) in S3 and is accessing the same by mentioning the path in AWS Glue Job 'Python library path' argument.
It runs fine for few external modules but fails for others with the below error:
Traceback (most recent call last):
File "/tmp/processing", line 2, in <module> import netCDF4 File "/tmp/netCDF4-1.5.4-cp36-cp36m-manylinux1_x86_64.whl/netCDF4/__init__.py", line 3, in <module>
from ._netCDF4 import *
ModuleNotFoundError: No module named 'netCDF4._netCDF4'
Any suggestions will be appreciated.

Error while configuring pycharm with odoo-13

I am trying to configure a new project to Odoo on Windows however when I run the project after specifying odoo-bin as the Script path this error appears to my:
Traceback (most recent call last):
File "D:/Odoo 13_20200903/server/odoo-bin", line 5, in <module>
import odoo
File "D:\Odoo 13_20200903\server\odoo\__init__.py", line 75, in <module>
import PyPDF2
ModuleNotFoundError: No module named 'PyPDF2'
Any idea how can it be fixed?
Thanks in Advance
The Python interpreter used differs from the interpreter in which the libraries are loaded, make sure that the required interpreter path, may be inside a venv or another name.

ImportError: No module named darkflow.cli

I just want to do live object recognition from web-came using YOLO and while testing it, I am facing some issues. I am using Ubuntu os. Here is the error I get in terminal.
rajan#RGR:~/yolo setup/YOLO_Object_Detection-master$ ./flow --model cfg/yolo-new.cfg --load bin/yolo-new.weights --demo videofile.avi
Traceback (most recent call last):
File "./flow", line 4, in <module>
from darkflow.cli import cliHandler
ImportError: No module named darkflow.cli
Here is the link of the git repository which I am using as refenrece:
https://github.com/llSourcell/YOLO_Object_Detection

Resources