27,546 questions
-1
votes
0
answers
59
views
SQL Developer not selecting correct date format on import
I have to import quite a bit of documents into SQL Developer, but for some reason it is unable to read the date on multiple columns and I have to go in and manually select the correct date format. ...
3
votes
4
answers
190
views
Import large CSV files with many unknown column names and types (auto-detection)
Using PostgreSQL 18, I want to import a large .csv file with unknown column names and types. I have 2 related .csv files:
The 1st file contains around 100 columns and 2,000,000 rows of data, like ...
-2
votes
1
answer
90
views
python imported variables working for some functions only
i need some help to a problem that makes no sense to me.
my code goes like this:
from file1 import*
def func1():
var_from_file1 = anything
def func2():
var_from_file1 = anything #exact same ...
Advice
0
votes
3
replies
66
views
How to include imports across multiple subfiles in python?
I am currently working on a project using pygame and am putting some of my code in seperate files to keep it organised (which I understand is best practice) and importing it. In the past I have just ...
Best practices
0
votes
0
replies
31
views
Imprt trouble with Cargo workspace(s): use top-modules within a sub-module
I have a small Rust project that I'm using as a learning exercise/sandpit to understand how the workspace and project schema works.
I have had trouble resloving what to me seems like a ver "...
0
votes
0
answers
41
views
ypeError: Cannot read property 'xx' of undefined after upgrading from RN 0.68.1 to 0.82.1 (possible circular import with export * barrels)
After upgrading our app from React Native 0.68.1 to 0.82.1, we consistently hit a startup runtime error:
TypeError: Cannot read property 'setRootNavigation' of undefined
We suspect this is related to ...
Advice
0
votes
1
replies
75
views
sklearn_boilerplate anything else should be included for everyday use?
this are sklearn imports I use in every notebook, is anything else to be included for everyday use?
import numpy as np
import pandas as pd
from sklearn.impute import SimpleImputer
from sklearn....
1
vote
2
answers
129
views
In Raku, how to import a module during runtime?
I would like to import Test::Color only when %*ENV<TEST_COLOR> is set.
I can't put use inside an if block, because use happens at compile time. I put require inside the if block, to no effect.
...
Best practices
2
votes
4
replies
81
views
How to solve import problem in Microservice Architecture?
As part of learning I'm trying to switch monolithic project to microservice architecture and encountered import problems.
GitHub Project
Project's tree looks like:
users/
pyproject.toml
src/
...
0
votes
1
answer
116
views
Why do I get an Unresolved error when I make an import in Kotlin wear?
I've forged a sample from github but some imports give me an error:
Unresolved reference 'common'.
It's these two import:
import com.google.common.util.concurrent.Futures
import com.google.common....
Advice
0
votes
1
replies
84
views
Is there a way to export my block-based code on Scratch?
I want a way to export my code on scratch (The online version: Scratch.mit.edu) into a readable txt format where i can edit the variables and lists more easily and import it back into Scratch. I hope ...
3
votes
1
answer
153
views
How to make tables with relationships in SQLAlchemy in different files
I have many-to-many connection in my database and trying to make tables with ORM. Now I have 3 tables (one is secondary)
class TableA(Base):
__tablename__ = "tablea"
id: Mapped[int] =...
2
votes
1
answer
73
views
Rewrite external imports to use esm.sh
I am using Rollup to bundle code that's going into a <script type="module"> tag on a page. In the source, inputs look like import { createRoot } from 'react-dom/client'; In the output, ...
Best practices
1
vote
6
replies
68
views
Is there any standard way to handle the aliases or abbreviation in python when importing the module to the python file?
Here is how I import the python modules in to the another file. Anyone knows is there any standard way of importing?
import lib.utils.datetime_util as dt
import lib.utils.type_check_util as tc
1
vote
2
answers
176
views
How do I randomize what rows I import from an SAS file?
The files are over 100gb and I want 1000 observations but not the first 1000, how can I make sure it's randomized before/while importing so that not all of it has to be loaded in?
data <- lapply(...
1
vote
1
answer
88
views
Javascript Import Variables
so I have an HTML page, a linked Javascript(jQuery actually) file that has functions linked to clicks, etc. Then I want to add Regular Expressions to check user input.
I want to maintain all JS ...
Advice
0
votes
0
replies
15
views
Is there a way to import a database into LiveCode?
I want to develop a stack that imports from a csv file. I created this in Hypercard, but I need to redo it in a modern system. I need to manipulate it in a custom way that FileMaker and others do not ...
0
votes
0
answers
140
views
Visual Studio Code : jar import error - package does not exist
When referencing an external library (.jar) with an import, i get the error "package ... does not exist".
I precised that compilation is OK (when i print in the console, changes are ...
0
votes
2
answers
105
views
Importing variable from python file, which is assigned by a function
I am trying to create a global variable across multiple python files. This variable needs to be assigned a value only once. When I use from file import variable the assignment function always runs and ...
2
votes
1
answer
72
views
How can I dynamically load and execute `/foo.py` if it contains relative imports?
If I have /www/code/foo.py and /www/code/bar.py, where foo.py contains from . import bar, I can do the following to dynamically load and execute foo.py
path = '/www/code/foo.py'
spec = importlib.util....
3
votes
1
answer
71
views
Package import in UML
I found a similar question in one of the online platform and depicting here, as the answer is not convincing:
Question: Which element(s) from P3 are visible inside P2 without using a qualified name ?
...
Best practices
0
votes
6
replies
111
views
Prototype mismatch importing symbols
I get a "Prototype mismatch" warning in code that either imports 'blessed' from Scalar::Util or defines it depending on the version of Scalar::Util. Is there a way to suppress the warning, ...
-1
votes
1
answer
312
views
Error: Cannot find module '@/generated/prisma' [closed]
I am creating an gateway project in NodeJS, but for some reason my "auth-service/src/controllers/userController" is throwing an error showing module cannot be imported my prisma folder ...
Advice
0
votes
5
replies
94
views
How to access variables from another import?
I have a main file in my Python program, in which I import many files. Is there any way to access in one import some variables defined in another import? Here's an example:
# file1.py
var1 = "foo&...
1
vote
0
answers
90
views
Local package randomly becomes unimportable when using `uv run` in a project created with `uv init --package`
I'm seeing non-deterministic import failures when using uv to manage a Python project created with uv init --package. After a fresh uv sync, my local package is importable, but after running a few uv ...
1
vote
1
answer
132
views
How can I programmatically determine the imports for an R function?
Suppose I have a function like the below in a large R script, and I am trying to refactor it into a package to make it re-usable in other scripts:
mymean <- function(x) {
assert_that(is.numeric(...
0
votes
1
answer
124
views
Why is my exported Google sheets adding trailing zero to character when read by read_excel in R?
I have a data sheet that I am entering in Google Sheets and importing into R as an .xslx file. One of the columns in the datasheet is a character variable representing the specimen numbers of each ...
2
votes
2
answers
140
views
VSCode/Pylance highlights "Import could not be resolved" after moving files from a subfolder to the root
I’m working on a Python project on Windows 11 using VSCode.
I recently reorganized my project by moving all files from a subfolder to the root folder so that the code can be executed directly from the ...
0
votes
2
answers
192
views
python: vscode doesnt highlight direct import from module
When I attempt to import a module from a local package (from core import config), VSCode's syntax highlighting isn't working. When hovering over config, it shows "config: Any" (the editor ...
0
votes
0
answers
64
views
Error when wrapping import function in nodejs
I have the following code:
src/main.js
const importModule = async (moduleName) => {
const mod = await import(moduleName);
return mod;
};
const fs1 = await import("fs");
const fs2 = ...
Best practices
3
votes
7
replies
335
views
Is it a good practice to import libraries inside function bodies?
In Python, it is common to import all libraries required by a certain file, in the beginning of the file. But this has a disadvantage: if my file contains several different functions, and only one of ...
0
votes
1
answer
74
views
Import paths before vs after dockerization
How would you explain the difference between the import paths of other files in any .py file in a different folder/dir when the app is dockerize vs when it's not?
Ex:
in a app/src main.py
from .src....
1
vote
2
answers
130
views
Tkinter loading user Data from a file not in directory
I want to make a Tkinter program where separate users can load their data, (a dictionary) from a sub-folder within the main project directory.
My_project
|_main.py
|
|_User_data
|
|_ Data.py
...
0
votes
0
answers
98
views
How to import from files in the same TurboRepo package, PNPM
I’m working on a monorepo using pnpm with multiple apps and a shared package (packages/common).
My ws-server app imports types and utilities from packages/common/src/types and messageUtils.ts. The ...
3
votes
1
answer
109
views
Tkinter Load data from another directory
In Tkinter want to import variables stored on a file in a sub directory of the main project but am having trouble. I can read the file, but cannot import variables. Please Help.
def change_dir():
...
0
votes
1
answer
64
views
Auto import for TS is not working in Intelij IDEA
I have 2 files in my project, and I want to use 1 class, the IDE doesn't propose to import that, how can I fix it? The class I want to import has "export" keyword, and the auto import is ...
1
vote
2
answers
223
views
'AttributeError: partially initialized module 'jax' has no attribute 'version' (most likely due to a circular import)' following import mellon
Installed the mellon package but when I try to import it, I get:
>>> import mellon
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/...
1
vote
0
answers
59
views
Mongodb not available for my AWS Lambda function
I have tried to import mongodb into my lambda function and I keep getting an error message when I attempt to test it. All the recommended resolutions I have seen assume I am working in an environment ...
-3
votes
1
answer
125
views
Avoiding importing the same function twice
I've been programming in Python and ran into a problem that I think makes my code a lot more messy, and I'm trying to find a workaround.
It's a large program, so instead of just dropping it here and ...
2
votes
1
answer
146
views
pycharm seems to load some modules BEFORE my own code
In a blank new PyCharm Project I create a file "runner.py" with following code:
import random
print(random.random())
Next to this file I create a file "random.py" which stays ...
0
votes
0
answers
67
views
java25 importing module to itself
MOTIVATION
I am trying to use new feature, Module Import Declarations, on my projects to decrease code complexity.
I have detected that a module can be importted to itself, is it correct to use it ...
0
votes
1
answer
195
views
Why does Streamlit throw "ImportError: cannot import name 'get_all_transactions_by_user' from 'db'" even though the function exists?
I’m building a personal finance management app in Streamlit with multiple pages (dashboard.py, transactions.py, budget.py, export.py). I have a db.py file that contains all database functions, ...
1
vote
0
answers
51
views
Did Chrome change their content security policies for importing scripts?
We are dynamically importing modules from esm.sh.
This works well with esm.sh being added to the list of domains for the script-src CSP.
Since Chrome has updated to version 140++ the imports throw an ...
0
votes
2
answers
133
views
How do I import package when running
I have a directory structure that can be simplified like this:
test/
scripts/
a.py
src/
b.py
In a.py, I have the line:
import src.b
If I'm in the test directory, I want this ...
0
votes
1
answer
143
views
Omnet++ Inet4.5 cannot resolve import
I'm new to OMNeT++ 6.1 with INET 4.5. I wanted to create a .msg file where I import the TagBase from inet.common.TagBase. I referenced inet4.5 in Properties -> Project References but it can't ...
4
votes
3
answers
2k
views
How to use uuid with Node.js (v20) when require() throws ERR_REQUIRE_ESM?
I'm building a URL shortener app in Node.js (v20.16.0) using Express.
In my controller/user.js, I try to import uuid like this:
const { v4: uuidv4 } = require('uuid');
But when I run npm start, I get ...
1
vote
0
answers
202
views
Include code in dev mode, but not in production in Vite.js site
I'm making a website using Vite.js and React.js. I do checks on the data in development mode. I use the zod library for this code. I can do this using the statement let zod = await import('zod'). This ...
0
votes
2
answers
94
views
How to make android studio use class imports for inline classes
I have this interface:
@Immutable
sealed interface TestUiAction{
data object OnClick
}
When I try to call it in android studio by clicking on auto suggestion:
It imports the class like this:
...
1
vote
0
answers
27
views
Using SASS partials in a multi-client setup
Since @import will be deprecated in Dart SASS, I've tried to find a solution for the following problem. I want to use the same partials for different clients which have different, colors, fonts, font ...
0
votes
2
answers
310
views
I have set up a virtual environment in VS Code but can't import modules
All,
I have:
Installed VS Code
Created a virtual environment (imaginatively named venv)
Activated the environment
Installed simple-salesforce
Tried to import simple-salesforce with the following line ...