Category "python-import"

Unique import * only allowed at module level

I am making a utility program which has multiple programs built into it but I made some changes to my program for it re-run when the user has prompted which the

can't import function from different module/file

I'm super new to this and this is my first time posting on forum.. trying to import a function from books.py to be used in logic.py File structure: application

how to import boto3 athena client exceptions

I am working with athena from within my python code, using boto3, as follows: def query_athena(query, output_path): client = boto3.client('athena') clie

`UnencryptedCookieSessionFactoryConfig` error when importing Apex

I'm trying to use Apex and whenever I try to import it (or anything involving it) I get the following traceback: Traceback (most recent call last): File "<

How to solve (NaN error) when given column specific name

I have many text files include data as follow: 350.0 2.1021 0.0000 1.4769 0.0000 357.0 2.0970 0.0000 1.4758 0.0000 364.0 2.0920 0.0000

How to solve (NaN error) when given column specific name

I have many text files include data as follow: 350.0 2.1021 0.0000 1.4769 0.0000 357.0 2.0970 0.0000 1.4758 0.0000 364.0 2.0920 0.0000

'Import "Path.to.own.script" could not be resolved Pylance (reportMissingImports)' in VS Code using Python 3.x on Ubuntu 20.04 LTS

It is a similar situation I'd encountered several months ago using pylint prior to pylance: My python 3.9x - script (using VS Code on Ubuntu 20.04 LTS) starts w

Python opencv Aruco "No module named 'cv2.aruco'"

I am running an Ubuntu virtual machine with, Python 3.6.1, Anaconda 4.4.0 (64-bit). I am trying to run the code on this website. When I try to use import cv2

Module not recognising root directory for Python imports

I have a Python project that uses the MicroKernel pattern where I want each of the modules to be completely independent. I import each of the modules into the k

Builtin python's __import__ vs imp.load_module: ValueError: Attempted relative import beyond toplevel package

I have a piece of code that dynamically imports a bunch of subpackages - package structure: main_package/ code_below_is_here.py game/ __init__.p

3 level chained python import is failing

I have the following folder structure across 3 levels: folder1 contains folder1_1 which again contains folder1_1_1. Now we have a .py file in each folder (besid

ModuleNotFoundError when importing Pygame after pip install Pygame

I was trying to make a simple snake game in Python so I installed Pygame using pip install Pygame. After I installed it successfully, I tried importing Pygame b

How to import a module from a different folder?

I have a project which I want to structure like this: myproject ├── api │ ├── __init__.py │ └─&#

How to programmatically add root folder to the path for every script?

The file structure I currently have is something like: __init__.py script_folder __init__.py s1.py s2.py b_folder __init__.py b1.py b2.p

Python circular imports with inheritance

I have a parent and child class, where a parent's method returns an instance of the child. Both classes are in separate files classA.py and classB.py. In order

Python - Notion API - Can't import module

I'm trying to use Notion API for some automation processes but I am having some trouble importing the packages and I already try a lot of imports. I've this cod

How to set the log level for an imported module?

Write your code with a nice logger import logging def init_logging(): logFormatter = logging.Formatter("[%(asctime)s] %(levelname)s::%(module)s::%(funcNa

Can't import .so file due to permissions missing: failed to map segment from shared object

I'm trying to run a custom project that uses large parts of the SiamMask project. When the code is ran, one of the many imports is this one: from . import regi

How to fix Pylint's false positive Unable to import error?

For last couple of hours I was trying to figure out what's the Pythonic way of importing modules from parent directory and from sub-directories. I made a projec

Dynamic import: How to import * from module name from variable?

As discussed here, we can dynamically import a module using string variable. import importlib importlib.import_module('os.path') My question is how to import