Questions tagged [python-module]
A module is a file containing Python definitions and statements.
1,864
questions
0
votes
0
answers
10
views
Show error when installing cmd runing kivy desginer No module named "kivy.adapters"
enter image description here
had installed kivy from this YouTube video How to install Kivy designer and when I run the designer with
0
votes
1
answer
26
views
suppress print() function in python modules
I'm building a multi module python program
in each module i have some function where i used to print some output during debugging of each individual module
while calling modules's functions in the ...
0
votes
1
answer
25
views
why isn't this external Python script reading inside its local directory?
I was doing some API stuff the other day and ran across this (maybe) weird behavior in python. Basically I have a script in a secret folder ./secret_stuff/token_request.py that constructs and returns ...
-1
votes
0
answers
8
views
Define module in python to highlight columns in yellow if column is greater than 0.01
i want to define a module in python and want to call it in my code but not able to call, i have two dataframe and merged the both dataframe, and created the new dataframe,i.e
Final_files = ...
-1
votes
0
answers
8
views
Self learning python for data analysis. Dataframes and designing programs with functions, classes, and modules
I wanted see if folks here could help expedite my efforts to self learn python with the intent of doing data analysis using dataframes and designing programs with functions, classes, and modules. I've ...
0
votes
1
answer
19
views
Python: import failing in installed python custom package
I have a python package created using setup.py and then installed in a virtual environment. The directory structure is:
root
|
+-- setup.py
|
+-- package
|
+-- __init__.py
|
...
1
vote
1
answer
48
views
Cannot install modules inside Docker container with Jupiter notebook image
I have got the following Docker file
FROM jupyter/scipy-notebook
COPY . ./work
RUN pip install -r ./work/requirements.txt
COPY setup.py /work
RUN pip install --upgrade pip && pip install -...
0
votes
0
answers
26
views
Importing modules and running script within the module
I have a project and it's directory structure looks something like below:
The script app.py imports a function from the module some_utilty.py as follows:
from src.utility.some_utility import ...
0
votes
0
answers
20
views
What is the python equivalent of R's package::function?
In R I can use a function in two different ways. First is to load the library and then use the function.
library(dplyr)
df2 <- select(df, column)
Or I name the package when I call the function ...
0
votes
0
answers
23
views
How to detect exponential growth in time series table?
Let's assume I have a table with columns datetime and volume for the search query "instagram".
Google Trends
Is there any ready python modules that would spot time interval of exponential ...
0
votes
0
answers
19
views
how to properly create python entrypoints in setup.py
This is what I have in my setup.py
entry_points={
'console_scripts': [
"app1=cmd.app1:main",
"app2=cmd.app2:main"
]
}
And this is ...
0
votes
0
answers
17
views
The problem with importing custom modules in Python
There is a strange problem. I have two Jupyter Notebooks. One of them is located in the same directory as the module I'm going to import. Another notebook - in another dir. As for the notebook in the ...
0
votes
0
answers
29
views
Python: Extend existing module with separate code
I'm new to python development and the mindset for Python in general, so I'm still learning the generally accepted practices of the language and infrastructure. Background on the problem:
I have ...
-1
votes
1
answer
42
views
Python program that tells you whether or not you need an umbrella when you leave the house [closed]
The program should:
Ask you if it is raining using input()
If the input is 'y', it should output 'Take an umbrella'
If the input is 'n', it should output 'You don't need an umbrella'
-1
votes
1
answer
61
views
How to disable tqdm progress bars from outside the module it is used
I am working with neural prophet module for timeseries forecasting. While using it I got tones of progress bars which I don't want due to some reasons. Some of them I was able to disable but the ...
0
votes
0
answers
14
views
Error loading psycopg2 module after running heroku local command
I am attempting to run my Django project locally, in a virtual environment, using the heroku local command. After executing:
heroku local
my terminal throws the following error:
django.core....
1
vote
0
answers
35
views
Python: Using modules as classes
As I try to use more and more functional programming (i.e. use classes less), I have noticed I start to use modules as classes:
#File foomod.py
foo = None
def get_foo():
global foo
if foo is ...
0
votes
0
answers
33
views
Need help installing geopandas
Unable to install geopandas: I have tried YouTube videos, used the conda forge command, still no success. Pip install geopandas gives this error👇:
[1 lines of output]
A GAL API version must be ...
0
votes
0
answers
46
views
python: ImportError: No module named src.results
I have a working code given by my prof. I am asked just to learn to use it.
I am runing it on a remote Ubuntu machine, at uni, with python 2.7, the same server my prof uses and says it works for him.
...
0
votes
1
answer
31
views
How to import a local module from within pip package?
I created a pip package; from within this package, I'm trying to import a module from my local filesystem.
Example:
In my pip package X I have a function load_module:
def load_module(module_name: str):...
0
votes
0
answers
8
views
How do you access the module class directly?
I see that there is a 'module' class from which modules inherit:
>>> import sympy as sp
>>> m = type(sp)
>>> m("myModule")
<module 'myModule'>
How can I ...
0
votes
0
answers
16
views
python modules resolution with -m flag
Currently, I am using python -m XYZ.abc script.py Where XYZ.abc is my module. Currently, the module location is from path C:\Users\Admin\codebaseA\XYZ\abc.
I want to switch to module C:\Users\Admin\...
0
votes
1
answer
28
views
How to limit a Python module to expose specific parts
I just made a module in python but I don't want people to do this:
import mymodule
mymodule.
and this then shows all methods and variables I added to the module. I just want them to see specified ...
1
vote
1
answer
22
views
Import File in Python Package
How would I go about importing another file in a python package. I install the package with
pip install .
so I can then run it using
python3 -m pkg
Here's the file structure:
.
├── pkg
│⠀⠀├── cli.py
...
0
votes
0
answers
84
views
How to solve legacy-install-failure error?
While I go to install face_recognition module I'm facing the bellow error. What will be the relevant solution? I trying to install dlib-19.22.99-cp310-cp310-win_amd64 for python version 10. But not ...
0
votes
0
answers
14
views
is it possible to run through spark-submit without python modules in executors?
I have a cluster of 7 nodes.
1: master
2: nn1
3: nn2
4: dn1
5: dn2
6: dn3
7: gn
I only installed python modules in gateway node.
And I ran a python code through spark-submit.
below is my code
from ...
1
vote
2
answers
36
views
How to change the value of a variable before importing a module in python?
Suppose I have a config.py file that has some variables,
# config.py
LIFE = 1
MONEY = 200
And I will have to import a function which uses those variables within itself,
# game.py
from config import ...
0
votes
0
answers
13
views
Add module name to a list and iterate over it
I have numerous modules that I need to iterate over. When I create a list of the module names and try to iterate over them, Python treats the module names as strings, and complains that the string ...
-2
votes
0
answers
32
views
Stop execution from module in python?
Is there any way to completely end execution from within an imported module?
What I would like to do is something like this:
from mytools import something
s = something()
s....
0
votes
1
answer
36
views
ModuleNotFoundError: No module named 'OpenEXR' on blender
I'm trying to use OpenEXR module on blender's 3.1.2 script but I can't import it. I can import it using my python 3.8.10 installed.
I first install it using :
pip install openexr
pip3 install openexr
...
0
votes
1
answer
33
views
Python, getting name of a file at the creation of a object
i dont know if this wont be a duplicate but i havent found anything, but in that case sorry.
Now to my question.
I want to make simple idk how to call it basicly script that would help me write to ...
0
votes
0
answers
49
views
module 'git' has no attribute 'Repo' - when running as non-root user.. works as root user
As above, I wrote a gitlab pre-receive hook that runs as a 'git' user on our gitlab server. When testing it, I get the above error. However when I SSH into the server and manually run the script as ...
0
votes
1
answer
61
views
ModuleNotFoundError: No module named 'face_recognition'->pip install dlib error
Summary:
I am trying to run the python file which contains face_recognition. But, it is giving me ModuleNotFoundError: No module named 'face_recognition'.
I have tried the way to solve:
I looked to ...
0
votes
1
answer
37
views
Why am I getting an error when using the requests module to return the server code?
(I used a translator when writing this article. Please understand that some words may be incorrect.)
I tested it using the requests module. If the site cannot be found, a 404 code should be returned, ...
0
votes
0
answers
92
views
AttributeError: module 'os' has no attribute 'PathLike'
I want to run os.PathLike in python 3.5. Unfortunately this is not available in python 3.5. Is there a turnaround in which I can run this command in python 3.5 without upgrading the python version.
1
vote
0
answers
26
views
How can I make a PYTHON submodule directory with similar filenames as those in root import their OWN files with same names first
The title of this question may seem very confusing and I didn't know how to word it properly, but here's the gist of the situation.
Say I have this kind of file structure:
- main.py
- util.py
- ...
0
votes
0
answers
34
views
AWS Lambda | How use layer imported dependencies?
So I am very new to AWS in general and I am trying to execute some code using Lambda.
Since my code has dependencies that need to be imported like the request module I have tried many ways to add the ...
0
votes
0
answers
22
views
Tkinter how update main window combobox values from Toplevel list python3.8
I have 3 modules (small, dont worry).
main_module = it has a combobox and a button. Comobobox list must be update each time a list (in module2) increases in number of names (combo values). Button ...
0
votes
0
answers
40
views
python version not picked up by the environment as expected
I am not fluent in python setup, thus asking for help after many hours of trying various solutions.
I am attempting to run 'jupyter notebook' command from Mac terminal under /Users/ and got this ...
0
votes
0
answers
29
views
instance attributes not available when inheriting [duplicate]
i have a Square that inherits from Rectangle which inherits from Base.
I'm trying to overwrite the str method in Square class so it can return [Square] () / - , but it says that Square doesn't have ...
1
vote
0
answers
208
views
How to solve pywhatkit KeyError in pyrhon?
import pywhatkit as pwt
number=input("Enter the number: ")
msg=input("Msg: ")
pwt.sendwhatmsg_instantly(number,msg)
And then I got this error:
Traceback (most recent call last):
...
1
vote
0
answers
18
views
Python with unit-tests in teamcity
I like to run unit-tests during Teamcity build. I configure this step in the build like pytest with arguments test/unit/*.py. During this run I have "ModuleNotFoundError" for a module that I ...
0
votes
0
answers
25
views
Why I am getting error in the pyzbar module while using this library it in the QRCode scanning project?
ERROR IS :
Traceback (most recent call last):
File "P:\Prashant\Python\Attendance\lib\site-packages\pyzbar\zbar_library.py", line 58, in load
dependencies, libzbar = load_objects(Path('...
0
votes
1
answer
34
views
Pip not recognized after update
Hello, I installed Pandas with pip and then, as my computer said to do, I upgraded Pip. But now, it does not recognize Pip anymore
I've tried so many different ways but it still doesn't work.The last ...
0
votes
0
answers
24
views
how to avoid problems with modules when transforming code into executable - Python
I have a project that is working perfectly in .py format, but when I make it executable using pyinstaller, I have problems if the module I created and is being used in the code is not in the same ...
2
votes
3
answers
6k
views
ImportError: cannot import name 'Iterable' from 'collections' in Python
Working in Python with Atom on a Mac.
Code:
from rubik.cube import Cube
from rubik_solver import utils
Full error:
Traceback (most recent call last):
File "/Users/Audey/Desktop/solver.py",...
0
votes
1
answer
24
views
Can't import subfolders from python module on GitHub
I have a simple python package that I've published on GitHub. I installed the package locally on my machine using pip. I am trying to import a subfolder of the module but I keep getting a ...
-1
votes
1
answer
158
views
import Python files in Azure function
I did import a file in azure function in a structure like this
from folder1.folder.script import function
but it showed me error
Exception: ModuleNotFoundError: No module named 'folder1'
whene I ...
1
vote
0
answers
41
views
TYPE_CHECKING imports helper module
I'm looking for a module similar to https://github.com/snok/flake8-type-checking,
That can automatically identify any imports which are used for typing only - So I could easily moved them under 'if ...
0
votes
3
answers
57
views
How to replace imports in imported library?
Suppose, we have 3 files:
library1.py:
SomeVariable = '1'
library2.py:
import library1
print(library1.SomeVariable)
library3.py:
SomeVariable = '2'
my goal is to "change" library1 import(...