importerror

Importing files from different folder using __init__.py doesn't work in runtime

Importing files from different folder using __init__.py doesn't work in runtime Question: This is my first time trying to import from different folder. the structure is as follow: application │ ├── __init__.py │ ├── folder │ ├── file.py │ └── __init__.py │ └── folder2 ├── some_file.py │ └── __init__.py I want to import some_file to …

Total answers: 2

Python 3.6.8 – Jedi – ImportError: cannot import name 'traverse_parents'

Python 3.6.8 – Jedi – ImportError: cannot import name 'traverse_parents' Question: <TL;DR> When running import jedi in python 3.6.8 I get the following import error (see end of post for full traceback): … from jedi.common import traverse_parents ImportError: cannot import name ‘traverse_parents’ </TL;DR> I checked in ~/.local/lib/python3.6/site-packages/jedi/common.py : There’s a function called traverse_parents alright so …

Total answers: 1

library importing issues in vs code

library importing issues in vs code Question: import errors in python in vs code "i tried some imports for a chat bot project in vs code but its always shows some errors that shown in the picture below. looking for solutions ,thank you." this picture shows the error that i seen after importing some libraries …

Total answers: 1

Why can't I import candlestick_ohlc from mplfinance

Why can't I import candlestick_ohlc from mplfinance Question: So I have been able to successfully install mplfinance with pip and when I import it alone I receive no error. Though when I do: from mplfinance import candlestick_ohlc I get the error ImportError: cannot import name ‘candlestick_ohlc’ from ‘mplfinance’ I have checked command prompt again, and …

Total answers: 3

ModuleNotFoundError – Module found in PyCharm intellisense but not when executing program

ModuleNotFoundError – Module found in PyCharm intellisense but not when executing program Question: Using PyCharm, I have a project for an SMTP parser with the following structure: – SMTP – Classes – Models – Transformers – Tests In Tests I reference classes from SMTP.Classes.Transformers like this: from SMTP.Classes.Transformers.myclass import MyClass This works and my unit …

Total answers: 1

Pybind11: "ImportError: DLL not found" when trying to import *.pyd in Python Interpreter

Pybind11: "ImportError: DLL not found" when trying to import *.pyd in Python Interpreter Question: I built a .pyd in Visual Studio 2019 (Community) that provides a wrapper for some functionality that’s only present in the LibRaw. The solution compiles successfully without any warnings or errors. The project uses LibRaw, OpenCV and pybind11 as well as …

Total answers: 2

cannot import name 'mydb' from partially initialized module 'connection' in Python

cannot import name 'mydb' from partially initialized module 'connection' in Python Question: Python 3.8 error ImportError: cannot import name ‘mydb’ from partially initialized module ‘connection’ (most likely due to a circular import) (C:U sersMark04DocumentsPython tutorialdatabasingconnection.py) When I tried to execute child module select.py import bcrypt; from connection import mydb That has an imported module connection.py …

Total answers: 7

Attempted relative import with no known parent package

Attempted relative import with no known parent package Question: from ..box_utils import decode, nms This line is giving error ImportError: attempted relative import with no known parent package What is this error and how to resolve this error? Asked By: Puneet Shekhawat || Source Answers: Apparently, box_utils.py isn’t part of a package. You still can …

Total answers: 4

ImportError: No module named 'flask.ext'

ImportError: No module named 'flask.ext' Question: When I import a Flask extension like this, it works fine: from flask_module import Module So the extension is installed correctly. But whenever I try to import a Flask extension like this: from flask.ext.module import Module I get the following error: ImportError: No module named ‘flask.ext’ What is going …

Total answers: 1