import

importlib.import_module with python

importlib.import_module with python Question: Hello there I would like some to address me properlly on how to use importlib.import_module I am attempting to import a module using the lib: but what I am getting is: this is the example of my class: class Main: def __init__: self.appFileName=None self.appFileToPass=None def decrypt(self, string): return cryptocode.decrypt(string, localKey) def …

Total answers: 1

pandas extensions usage without importing it

pandas extensions usage without importing it Question: I have created pandas extensions as mentioned here. The extending classes are defined in a module named pd_extensions, and I would like to use them in a different module my_module for example. The two modules are in the same package called source. currently to be able to use …

Total answers: 2

Why does error occurs when importing from same *sub*directory?

Why does error occurs when importing from same *sub*directory? Question: Consider this folder structure: main.py module_a/ aa.py bb.py __init__.py In main.py, I import aa as: from module_a import aa aa.yyy() Then in aa.py, I import bb and include its functions as: import bb bb.xxx() However, when I run main.py, python says "No module named ‘bb’". …

Total answers: 2

Problem importing nested package in Python

Problem importing nested package in Python Question: Based from a project with the following structure: . └── src/ ├── main.py ├── PackageA/ │ ├── __init__.py │ ├── logic.py │ ├── SubPackageA1/ │ │ ├── __init__.py │ │ └── util.py │ └── SubPackageA2/ │ ├── __init__.py │ └── otherUtil.py └── PackageB/ ├── __init__.py └── helpers.py Project …

Total answers: 1

Import error when trying to import python module from other folder

Import error when trying to import python module from other folder Question: This is my project structure: /my_project /first_folder first.py /second_folder second.py second.py def hello(): print(‘hello’) first.py from ..second_folder import second second.hello() when i run first.py i get the following error: ImportError: attempted relative import with no known parent package How can I avoid this …

Total answers: 2

declaring classes from imported modules in python

declaring classes from imported modules in python Question: In python you have to use import <module> to import a file with classes. Imagine the module contains multiple classes And now I want to declare an object x = module.object1Name(parameter1,parmeter2) How can I declare that object without having to access it through module? (So like this …

Total answers: 2

Issue during import, MLRunNotFoundError

Issue during import, MLRunNotFoundError Question: I installed python package MLRun correctly, but I got in jupyter this error ————————————————————————— HTTPError Traceback (most recent call last) /opt/conda/lib/python3.8/site-packages/mlrun/errors.py in raise_for_status(response, message) 75 try: —> 76 response.raise_for_status() 77 except requests.HTTPError as exc: /opt/conda/lib/python3.8/site-packages/requests/models.py in raise_for_status(self) 942 if http_error_msg: –> 943 raise HTTPError(http_error_msg, response=self) 944 HTTPError: 404 Client Error: …

Total answers: 1