Questions tagged [module]
A logical subdivision of a larger, more complex system.
22,676
questions
0
votes
0
answers
30
views
VBA - Combining modules
I am trying to build my own library in VBA by creating several modules, which depend on each other.
This means you can only use the main part of this, if you import all modules.
Since there are more ...
0
votes
0
answers
9
views
React-file-viewer confusion
I have used FileViewer from 'react-file-viewer' module.
import { FileViewer } from 'react-file-viewer';
However, I got this error:
Could not find a declaration file for module 'react-file-viewer'. 'c:...
-1
votes
0
answers
33
views
Complex Python Module Imports
I have a directory like this:
my_project/
├── module1_dir/
│ ├── __init__.py
│ └── module1.py
├── module2_dir/
│ ├── __init__.py
│ └── module2.py
├── __init__.py
notebook_dir1/
├── ...
-1
votes
1
answer
26
views
Python Idea: Decorate module imports with “module wrappers” similar to wrapper function/class, to create module templates
the question: is this idea worth it or did i missunderstand something.
@decorator
import module
@decorator
from abc import d
In my understanding, modules (or python.py files) are like static classes ...
0
votes
0
answers
11
views
Odoo - Adding Font Module
I need to add a custom font to the Odoo website editor, so I followed this tutorial
I created the custom module, but when I started my local Odoo server (nginx) the navigator interface showed me this:
...
0
votes
0
answers
16
views
Clear module import cache after executing Python code from zip file
I'm looking for a way to reliably clear the module import cache after loading and executing code from zip files (the zip files with Python code serve as a "plugin").
The current way I'm ...
0
votes
1
answer
20
views
Typescript import from sibling folder - cannot find module
Importing modules from other folder causes typescript errors.
I have a project with similar structure:
- src
- tsconfig.json
- types
- math.types.ts
- utils
- addNumbers.ts
- ...
0
votes
1
answer
27
views
error: no module named 'langdetect' when using argparse
I'm writing a program where a user inputs the name of a text file and the text can be altered in multiple ways. In order to do that, I need to detect the language of the text and I've chosen ...
0
votes
1
answer
31
views
Python import error, "'modules' is not a package"
I keep getting this error even though I downloaded the "modules" library.
No module named 'modules.MainWindow';
'modules' is not a package
here's the code
import sys
from PyQt6.QtWidgets ...
0
votes
1
answer
46
views
Why built-in modules can be imported using 'import' command without being in the same directory?
For built-in modules such as datetime or random why can these modules be imported simply by doing so:
import random
print(random.randint(1,10))
While the random module is not in the same directory as ...
0
votes
0
answers
9
views
ModuleNotFoundError: No module named 'vpython.with_notebook'
I'm trying to install vpython on visual studio code and executing it in a jupyter nootebook, but I get the error:
ModuleNotFoundError: No module named 'vpython.with_notebook'
from vpython import *
#...
-1
votes
0
answers
39
views
How to make this javascript code cleaner? [closed]
how can I make this code look cleaner ?
I have a main javascript file and this dom manipulation js file which I export to main js file.
Should I add dom variables inside of functions ?
Can I use ...
0
votes
1
answer
35
views
Python import a module from another file by mentioing the same directory
The below is my directory structure
directory
and my code in test.py which imports LOC from the conf.py under main/configs folder
import bcrypt
from main.configs.conf import LOC
password = '...
0
votes
0
answers
51
views
Importing a JavaScript module which only contains extending prototypes [duplicate]
How can I export/import a JavaScript module which only contains extending prototypes? Lets take some code of my current project:
hijacks.js:
/// @source: https://stackoverflow.com/a/31810991/11186407
...
0
votes
0
answers
45
views
Stuck in installing a voicecloner via Python (module not found)
I use Python 3.11.5
As a great Python n00b I enter this forum because I'm stuck with installing a Voice Cloner (for personal use to do a funny trick for X-mas with my family) Its this tool that i'm ...
1
vote
1
answer
123
views
`ModuleNotFoundError` in Jupyter Notebook
My notebook and modules are placed like below.
my_directory
modules # This is just a directory, not a module
my_module_1.py
my_module_2.py
my_notebook.ipynb
my_module_1.py is imported in ...
-3
votes
0
answers
21
views
how to import multiple files that is in multiple folder that have same package name in Go [closed]
I have this
root/
handlers/
user/
user.go
...
article/
article.go
...
main.go
The user.go and ...
0
votes
1
answer
37
views
TypeScript gives an error Nest.js is not a module
I'm using the Nest.js to build my project, but there is an error I encounter in the middle of my work. I didn't find any solution to this issue. I'm exporting a function from the file and importing it ...
0
votes
0
answers
31
views
Module not found: Mysql.connector
I am working on connectivity for a project, but importing mysql.connector is showing a 'ModuleNotFoundError: No module named 'mysql'' error. This isn't an issue with the code, either, since I have ...
1
vote
1
answer
47
views
Terraform modules with count indexes
I'm working on modulating our Terraform code and doing some testing to work out the possible options.
I'm trying to create a module to create VMs. I want to have the option of creating more than 1 VM ...
1
vote
1
answer
35
views
import logic in python - for some modules we follow the structure from A.B.C import D, but for some modules we can bypass that and do from A import E
i'm having trouble figuring out the importing logic in python, i'll use an existing example from the langchain library
for module name langchain.chains.retrieval_qa.base.VectorDBQA
a direct import ...
-1
votes
1
answer
114
views
Terraform module keeps modifying redis cache values from 200 to 642 for maxmemory delta ,reserved and fragmentation reserved attributes
tried changing
whenever I rerun the pipeline module for redis cache keeps modifying the values to 642 from 200
the default values set is 200
and attributes are
maxfragmentation reserved
maxmemory ...
0
votes
0
answers
28
views
Requiring '.js' Extension for Proper Import/Export Functionality in NodeJS Module Type
I experience the problem that when I want to use export/import in my NodeJS application I get the error: 'Cannot find module'.
I expected this to work:
import Test from "./modules/test";
But ...
0
votes
0
answers
35
views
What is a good way to use modules that have related entities?
I've been coding for some time and always looking for improvement! That's why I am learning about how to structure my modules in code well.
And now I am facing a dilema based on my experience with ...
0
votes
0
answers
12
views
pywinauto Application module conflicts with mouse library
I am working on an application to export OneNote Tables intro excel format.
Code is pretty basic, just clicking in certain spots. However, if I load pywinauto library, my positions become shifted with ...
0
votes
0
answers
31
views
Deploying a Flask Application Without Internet Access
I created a Flask project that works on my laptop. I want to run it on another laptop without internet access. How can I run the program with all modules working properly without installing anything? ...
0
votes
0
answers
101
views
Error when running the command line "npm run dev" in a vite project of the latest versions
The problem does not occur only when using Vite version 4.4.1.
When running "npm run dev", the following happens...
PS C:\Users\user\desktop\vite-project> npm run dev
> vite-project@0....
0
votes
0
answers
73
views
error: target file "./scripts/target.json" does not exist
I'm compile the kernel linux module but i get the follow error
error: target file "./scripts/target.json" does not exist
make[3]: *** [scripts/Makefile.build:292: /home/guilherme/...
0
votes
0
answers
31
views
'src' module not found
I have this code that I switched from PyCharm to Visual Studio Code.
I get the followin error on imports when I try to execute the mainbox.py file:
Traceback (most recent call last):
File "d:\...
0
votes
1
answer
19
views
ModuleNotFoundError: No module named 'tqdm' after reinstall
So I've been trying to use the module named tqdm to add a progress bar in my program. However it seems to be installed but my terminal won't run it. It shows up in pip3 list command but doesn't work
I'...
-2
votes
0
answers
65
views
The problem of importing local module to project in Golang [closed]
I have created a local module in Golang but i could not import the module to my project.
Folder structure
-project folder
--modules
---http-website-dt.go
--file...
--controller.go
--controller.exe
--...
1
vote
1
answer
43
views
How to convert 'module type' with 'non-generic type' to 'module type' with 'generic type' by destructive substitution?
I have a module type with three non-generic types:
module type LAYER = sig
type cytoplasm_t
type nucleus_t
type t
val cytoplasm : int -> t -> cytoplasm_t
val nucleus : ...
-1
votes
0
answers
31
views
Python error "ImportError: No module named" in project [closed]
I have a python file in here:
Project/data/test.py
With this import in the python file:
from otherfile.py import plot_chart
The other file is in Project/otherfile.py
Why does this not work? i have a ...
0
votes
0
answers
30
views
Module is not imported from the current directory
I have the following directory structure:
project/
├── src/
│ └── main.py
└── modules/
├──__init__.py
└──futures.py
I want to import modules from futures.py into main.py, but I get the ...
-2
votes
1
answer
72
views
why did my time.perf_counter() in python display such a large time despite it being a simple function?
This is the code:
import time
import threading
def hi():
pass
x = threading.Thread(target=hi())
print(time.perf_counter())
For some reason, it returned 114613.1859948 seconds.
I tried again, it ...
0
votes
1
answer
53
views
Python Highest Card Game using imported Modules
So i Have created a Highest Card Game in Python and I am looking to add a feature but I am struggling with the code. So I want to add a feature where a draw is not possible, so if two players draw the ...
-3
votes
0
answers
31
views
I can't install the pip [duplicate]
C:\Windows\system32>python -m ensurepip --upgrade
Looking in links: c:\Users\denis\AppData\Local\Temp\tmplnhgd46f
Processing c:\users\denis\appdata\local\temp\tmplnhgd46f\pip-23.2.1-py3-none-any....
1
vote
0
answers
30
views
SLURM/NFS cluster shared filesystem locked permissions on some users
Background
I used slurm to set up a 3-node cluster, one control node and 3 compute nodes (the control node doubles as a compute node). All of the nodes are on linux mint and they all communicate ...
-1
votes
0
answers
23
views
A fat jar has many troubles: v3 vs v4 jar version, javax vs jakarta, log4 vs sfl4j. Can linkages done with module-info.java theoretically solve them?
I am asking this question about Java module to avoid continuing a long job, in case if at the end I couldn't reach what I searching to do.
Many Java applications are bundled as a fat jar. For example, ...
-1
votes
0
answers
34
views
I want to use open() with redash
Thank you for checking my question.
I want to open a csv file using python with redash.
My python code is like this.
with open (csv_path, mode='r') as file:
csv_list = []
for line in file:
...
0
votes
0
answers
41
views
Unable to include a module in a fortran program
I am trying to compile with a fortran program that uses another module. For some reason when I try to compile it I keep getting the error:
testinc.f95:5:17:
5 | type(linreg) :: lr
| ...
0
votes
1
answer
81
views
Highest Card Game in Python
So I have created this Highest Card game in python, the code runs well and the program opens. The only problem I have is that when the crads are drawn to each player it doesnt display the card number ...
0
votes
1
answer
23
views
A service and a listener defined in a non-default module do not work when the Ballerina program runs
I have a Ballerina package where there is a rest API and a listener defined in another module in the package. The package structure and the Ballerina code are as follows.
restapi % tree
.
├── ...
0
votes
1
answer
18
views
Need help on module import :flask
I use VScode to code with python,and I am really a beginner.
I install flask using pip into the 'scripts' directory and add the path to VScode through python.autoComplete.extraPaths.
Then the ...
1
vote
1
answer
27
views
Often, after a maven refresh, unit testing of a project cannot find the module it declared itself in its module-info.java. Repair IDE, delete .idea
My first module in my project list has ten unit tests and a module-info.java containing:
module fr.ecoemploi.domain.utils {
requires org.slf4j;
requires org.apache.commons.lang3;
exports fr....
1
vote
1
answer
48
views
Error when trying to install grammar-check module
I'm attempting to install this pip module here, however whenever inputting pip3 install grammar-check or pip3 install grammar-check==1.3.1 I get the following error:
ERROR: Could not find a version ...
0
votes
1
answer
26
views
I cannot step into the imported function from the Python module using the PyCharm debugger
I have my main Python script that uses the function 'hello_world' from my imported module 'module1.py
However, if I use the PyCharm Debugger I cannot step into the 'hello_world' function.
I am ...
-1
votes
0
answers
61
views
How to access files in a module
I have a Go server which should use files I put inside a module(library) (xml files).
How can I access it?
I have a folder "xml" inside the module which I want to receive all the files ...
0
votes
1
answer
35
views
Ruby- NoMethodError across modules
I'm having some issues with getting to grips with using modules correctly.
I have:
module Utilities
def file_search()
# some code
return x
end
end
module Remake_Components
require 'csv'
...
2
votes
0
answers
156
views
How to use global variable in C++ module?
When I use module in a C++20 project, if I have
// Camera.hpp
extern const unsigned int SCR_WIDTH;
extern const unsigned int SCR_HEIGHT;
And in main.cpp
const unsigned int SCR_WIDTH = 800;
const ...