module

ModuleNotFoundError even though the Module is present

ModuleNotFoundError even though the Module is present Question: I am getting a ModuleNotFoundError for a module that exists. I have a __init__.py and imported sys but I am still getting a ModuleNotFoundError error on my django error. My file structure: |-my_app |-folder1 |-__init__.py |-calc.py |-folder2 |-__init__.py |-test.py I want to import a function from test.py …

Total answers: 2

how to install python modules where pipy.org is is not accessible from iran?

how to install python modules where pipy.org is is not accessible from iran? Question: so the problem is that pypi.org hase been filtered by iranian government(yes , i know it’s ridiculous!). i tried to install some python modules from Github downloaded files: pip install moduleName but every module has it’s own dependencies and try to …

Total answers: 4

ModuleNotFoundError: No module named 'A given module in package' when running the code

ModuleNotFoundError: No module named 'A given module in package' when running the code Question: Here is the entire code: MyApp/ * mypkg/ * __init__.py * mod1.py * mod2.py * Demo.py I am trying to run this app from Demo.py mod1.py : class Person: def __init__(self,name,age,address): self.name = name self.age = age self.address = address def …

Total answers: 1

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

some problems of using Python's Cryptography on Windows

some problems of using Python's Cryptography on Windows Question: I would like to use the cryptography’s module on Windows, I am using version 1.12 and Python 3.10.6, and I have some problems. Actually, when I run my script, I receive the error : ` Traceback (most recent call last): File "C:/Users/edoua/Documents/cryptographie.py", line 1, in <module> …

Total answers: 1

How can I permanently store user inputs automatically into the dictionary

How can I permanently store user inputs automatically into the dictionary Question: users = { "Hi":"HM123", "alan": "12122", "12": "11" } def adder(): new_user = input("Please enter user’s name: ").strip() new_pwd = "" confirmer = "0" while new_pwd != confirmer: new_pwd = input("please enter a new Password: ").strip() confirmer = input("please confirm your password: ").strip() …

Total answers: 2

How can i import a function into class of an external file? NameError: name 'clicked' is not defined

How can i import a function into class of an external file? NameError: name 'clicked' is not defined Question: If i click on the checkbox, i get this error: command=lambda: clicked(Checkbutton1.get(), Button1_func)) NameError: name ‘clicked’ is not defined because the checkbox is in the external file and requires command=lambda: clicked(Checkbutton1.get(), Button1_func)). I need the code …

Total answers: 1

My python module does not see other modules

My python module does not see other modules Question: I have a folder with 2 files. import_test.py main.py. Here is content of import_test.py: def some_function(): df = pd.DataFrame({‘col_1’: [1,2,3], ‘col_2’: [1,2,3]}) return df Here is content of main.py: import import_test import pandas as pd import importlib importlib.reload(import_test) import_test.some_function() When I execute import_test.some_function(), I get back …

Total answers: 2