Questions tagged [module]
A logical subdivision of a larger, more complex system.
21,096
questions
0
votes
0
answers
11
views
How can I hide a "utils" inside a submodule in python (vscode)?
I have the following package structure:
package/:
mymodule.py
submodule/
__init__.py
utils.py
Contents of utils.py:
def double(arr):
return arr * 2
Contents of __init__....
0
votes
0
answers
5
views
Installing `nginx-dav-ext-module` to Nginx but keeps getting not compatible error
I was trying to install this module to a server to make utilities of full WebDAV functionalities.
I had built and installed Nginx-1.20.0 from source previously using arguments
--prefix=/var/www/html --...
0
votes
0
answers
10
views
python send blockchain module with socket programming
Hi I am beginner in python I create a blockchain code and make three transactions and generate hashes i want to transfer any hash through socket programming. but i am getting an error On client side . ...
0
votes
0
answers
10
views
Module or singleton that uses logging and config
I've been trying to figure out how best to set this up. Cutting it down as much as I can. I have 4 python files: core.py (main), logger_controler.py, config_controller.py, and a 4th as a module or ...
0
votes
0
answers
16
views
Why - after checking the python path - it still can't find my module?
I’m having difficulty getting Python to find my pip installation of the module romodel. Here’s what I’ve done so far:
Checked what my python path is using which python:
/Users/<username>/opt/...
0
votes
2
answers
24
views
Python module functions to use variables from global env
I'm relatively new to Python and am trying to both do something and learn more about how Python works.
I am coming up empty with google, in part I think because I don't know how to correctly describe ...
0
votes
0
answers
15
views
How to get set of modules from ansible roles folder?
I have a folder called roles and what I need is to get a set of all ansible modules used.
When ansible parses playbooks and roles it gets modules to run. Maybe someone know how to parse role and get ...
-3
votes
0
answers
22
views
Python module fails to import another when run via Bash
One python module fails to import a second python module when I run the first using Bash.
Yet when I run the first python module its own, it does successfully import the second python module. Why is ...
-1
votes
1
answer
9
views
module 'keras.api._v2.keras' has no attribute 'model'
I tried to create a nueral network by:
import tensorflow as tf
from tensorflow import keras
model = keras.model.Sequential([
keras.layers.Flatten(), # the input layer... why it has no size???
keras....
0
votes
2
answers
35
views
Importing python function from outside of the current folder
I have this directory structure. The code inside utils.py is:
def hello():
print("hello")
The code inside run.py is:
from ..helper.utils import hello
hello()
Using this setting, I'm ...
1
vote
1
answer
30
views
go mod vendor returns "all matched no packages"
I'm trying to setup a new repo that will contain some backend services, named backend. I created the repo, cloned it into /home/me/go/src/github.com/myrepo/backend. I then did the following:
$ go mod ...
0
votes
0
answers
11
views
why doesn’t `from . import *` import all submodules?
I have a module mymodule with several submodules, let’s say
mymodule/
__init__.py
module1.py
module2.py
...
For side-effects reasons, I need all those submodules to be run when mymodule ...
0
votes
0
answers
16
views
Refactor an Angular 13 module into a library
ISSUE
I can't get to refactor a part of my app into an angular library as some app skeleton. I have been trying multiple things with lots of different errors each time.
CONTEXT
I work in a big company ...
0
votes
0
answers
17
views
Compare sets of objects efficiently
I have a program which describes pieces of roots in a soil. The soil is made up of a grid of cube-shaped cells and what happens with a root is affected by the cell and vice versa.
The pieces of root ...
0
votes
1
answer
8
views
Magento 2.4.2: The following modules are outdated: Perfectmakeupmirrors_PmmHead schema: current version - none, required version - 0.0.1
I just created a custom module to add a metatag in the head of a category page of our Magento site by making use of event and observer. When reloading the category page, below is the error I see. I re-...
0
votes
0
answers
9
views
load a new module inside of nginx kubernetes?
i am using Kubernetes and install Kubernetes/nginx-ingress
I have a new module inside of my folder Nginx module called ngx_http_compression.so. basically its inside of Kubernetes directory of /etc/...
0
votes
1
answer
13
views
Trying to create import module for Python (for RPi GPIO)
I am new to Python. I am trying to create a fake GPIO module for my Raspberry Pi that uses PWM motors so that my interpreter (using Visual Studio Code) can understand it and pass it without error.
...
-1
votes
0
answers
12
views
Anaconda installed, but modules are not found when working in PyCharm [duplicate]
I'm trying to import various modules (such as rasterio, numpy, pandas) in PyCharm, but all of them yield a ModuleNotFoundError. I have Anaconda installed, and the modules work in a Jupyter notebook, ...
0
votes
0
answers
12
views
Running a module as a script Python3
I have a python package with the following structure:
/moduleName/
|----
|---- __init__.py
|---- __main__.py
|---- foo.py
|---- bar.py
|---- baz.py
foo imports assets from both ...
0
votes
1
answer
14
views
I know eval() is bad practice; is there an alternative for my code which involves getting the __doc__ of all funcs in all files in a folder?
I'm making a project which involves importing a directory as a module (it has an __init__.py) then iterating through all files in that directory and printing the docstring of all the functions in each ...
0
votes
1
answer
14
views
How do i make it so i have to press multiple buttons in python keyboard?
I want to make it so I have to press multiple buttons in python keyboard module, but the method I tried doesn't work.
import keyboard
keyboard.on_press_key(["shift + b"], lambda _:spam())
...
1
vote
1
answer
31
views
Dependency not found in Nuxt when defining alias in nuxt.config.js
I'm getting this error when trying to import a file using a custom alias:
import api from 'api'
api in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./...
0
votes
0
answers
5
views
I have this error which says that there is no "wrapper" in the module curses
import curses
import os
from curses import wrapper
# import Wrapper as Wp
def design(stdscr):
try:
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)
green_black = curses....
-3
votes
0
answers
18
views
I a trying to fund a module with python [closed]
Is there a module from which i can search for a song like 'Beliver' and then it plays the song
like if
song = 'Beliver'
module.search(song)
and it plays the song
AND - the song wont be in my computer ...
1
vote
0
answers
29
views
AttributeError: module "__" has no attribute "___"
I have been wanting to play around with mouse and keyboard automation and I have just downloaded a package called "mouse"(https://github.com/boppreh/mouse). unfortunately, whenever I try to ...
3
votes
1
answer
15
views
Import geoviews in Anaconda
I am trying to install the geoviews module. I installed it successfully but when I am trying to import it in my code I have this message:
No module named 'channels
I don't know how to proceed.
0
votes
1
answer
23
views
Cannot access object from GraphQL query (JavaScript)
Subgraph query returns results to console, but my javascript module can't access any values from it, returning an error:
TypeError: Cannot read properties of undefined (reading 'symbol')
According to ...
1
vote
1
answer
14
views
"type": "module" import issue
Using js librairies, I struggle with the fact that require and import are not suitable together. When I write "type": "module" in the package.json, then import works but require ...
0
votes
0
answers
8
views
running exec inside a function when calling a module
I'm trying to assign a module's attribute to a variable using exec inside a function. color is a str like: 'jet', 'seismic', 'nipy_spectral', or something else. But didn't work.
#%% 0
#================...
0
votes
0
answers
13
views
Dynamic Bundle loading OSGI
I am new to OSGi so please help me out here.
**I have 2 independent modules A and B for addition and multiplication respectively.
Now in clientmodule i.e., i want to take user input for which bundle ...
0
votes
0
answers
20
views
No module named 'enthought' issue
I am having problems with plotting a 3D array called 's'. This issue is due to an error telling me that no module named enthought exists although I have already installed mayavi to python, anaconda ...
0
votes
1
answer
24
views
How to prevent a function from being imported into another module in python
How can we restrict other modules from importing certain functions while allowing others.
Desired behavior
# module A: a.py
def foo():
print('foo')
def bar():
print('bar')
# module B: b.py
from ...
0
votes
1
answer
27
views
Javascript Modules not working on some clients
I recently started using Javascript modules in my websites, and everything was fine when developing on my desktop. I went to do work on my laptop, but for some reason JS is throwing the following ...
0
votes
1
answer
27
views
How to install "util" (not utils) module
I am trying to run the example found in the README of the PyLSCI package. It references a module util, so I am trying to install that through Conda, but it is not working. I have tried typing conda ...
1
vote
2
answers
46
views
Assert that Ruby module extends another module
I have two modules A & B, I am extending A into B in order to use the methods of A in B as class methods:
module A
def foo
end
end
module B
extend A
end
B.Foo
I'd like to write a ...
1
vote
2
answers
27
views
How can I import the file in Django from a folder without Errors
Can someone help me with my problem?
I have the following project structure:
check_project
--- check_app
--- check_project
--- modules
--- __init__.py
--- tools.py
--- robots.py
I need to ...
1
vote
1
answer
42
views
SWI-Prolog: Use operators from modules?
I have a prolog-file (name definitions.pl) of this kind of type:
:- module(definitions,[]).
:-op(699, xfx, :=).
:-op(599, xfy, ∪).
C := (A ∪ B) :- union(A, B, C).
My aim is to use this file as ...
2
votes
2
answers
54
views
How can a module defined in a .ml file reference itself
I am trying to define a Point module that defines a type to represent 2d points.
I would also like to include a submodule Point.Set so that Point.Set.t is
a type meaning 'a set of Points'. That seems ...
0
votes
0
answers
40
views
dpdk igb_uio driver not loading
I am trying to load the igb_uio driver into my kernel, and I am getting the error:
insmod: ERROR: could not insert module igb_uio.ko: Invalid module format
I have been sleuthing around and am finding ...
0
votes
2
answers
26
views
Import a function from a module in another folder in parent directory
I have been trying unsuccessfully to solve this for hours now.
This is my folder structure.
/parent_folder
main.py
module1/
script1.py
module2/
script2.py
script2.py ...
0
votes
0
answers
31
views
Trying to build c++20 aplication with modules
I am trying use in app precompiled modules from other lib. I am specifies path to lib pcm-files with -fprebuilt-module-path= and link *.so file, but recieved the next error:
fatal error: module '...
0
votes
1
answer
17
views
Why are my tests failing after importing a function from a module?
This is my first programming question to ask on here. I am also a beginner python programmer.
I'm making a test program in order to test a function from another program (plates). Basically the main ...
-4
votes
0
answers
25
views
I am having error message of not having the module,pls anyone explain [closed]
from CH6Module import MyFunctions
print("Celsius\t\tFahrenheit | Fahrenheit\t\tCelsius")
celsuis = 40
fahr = 120
for i in range(1, 11):
print(format(celsuis, ".2f"), format(&...
-1
votes
1
answer
18
views
os module start file is not working in my linux operating system [duplicate]
def open_img(self):
try:
os.startfile("Data")
except Exception as es:
messagebox.showerror("Error",f" due to : {str(es)}...
0
votes
2
answers
34
views
How to make a choosing platform using a class object, modules and file handling (use of if else and switch case is not allowed)?
I am writing a code in python which gives basic information about the elements in periodic table when user inputs the symbol of that element.
We have to make it using class object. We can't use ...
-1
votes
0
answers
39
views
How to solve Issue : Import face_recognition, ModuleNotFoundError: No module named 'face_recognition'
I am trying to make a face recognition program using my webcam, and I've encountered the following error when trying to run it, also i'm new to python and programming :
(venv) PS C:\Users\CSA\Desktop\...
2
votes
1
answer
48
views
How to import a module into another module
This is the structure of my project:
project (folder)
main.py
assets (folder)
a.py
b.py
When I import module a into module b and run main.py, I get No module named 'a'.
Yet if I run ...
0
votes
0
answers
10
views
Sitecore SXA docker Image, how to fix failed to copy files
I have a problem with the CM & CD build containers, once I do docker-compose up i receive the below error, any idea?
Dockerfile here:
Docker file for the CM container
Shell output/error:
Output of ...
0
votes
0
answers
14
views
Imported function acts differently than one written in the same file
I have this structure:
Folder_1
- Scripts
- functions
- data_import.py
- main_notebook.ipynb
- Data
sales_data_1.csv
- SQL
- sales_data_1.sql
...
1
vote
4
answers
72
views
Is there a concise/inline way to create Set values without explicitly naming their type?
In most language that have parametric / generic types, there is a (type) expression you can write to mean 'Set of something'. E.g. Set<Integer> in Java.
Similarly in OCaml we have something like ...