Can't import files in the same directory (and subdirectories) - ModuleNotFoundError - directory

I'm trying to run some GitHub code and I keep getting ModuleNotFoundError: No module named 'deep_knn' when I run from deep_knn import Deep_KNN. Same thing happens when I try import utils.tensorflow_utils as tf_utils. Here is a picture of the folders:
I'm using Python 3.8.10 and I'm in the DeepNNK_polytope_interpolation directory. Does anyone know how I can fix this issue? Thanks for any help!

figured it out- I ran !cd '/content/DeepNNK_polytope_interpolation/' but it should've been !cd DeepNNK_polytope_interpolation.

Related

node-sass - I have my devDependency in my package.json but when I try to import it node-sass cannot find it and do not compile

I'm building a style guide based on a Sass / CSS library I had built earlier. I installed the library in my package.json as a devDependency using npm (on npm I have a private package for my library). My problem is that when I try to compile Sass using node-sass, it returns following error:
"Couldn't find the stylesheet to import"
The file I want to import is called tsw.scss. In any other project in which I have been using node-sass, I never had problems compiling (or at least I always managed to find them and solve them alone). So, I really can not understand, where I'm wrong this time. Could any of you help me understand what my mistake is and fix it?
Thanks in advance to anyone who will help me.
This is the code I used in my "styles.scss" file (of my style guide) in which I want, in fact, to import the library I previously created (the import that gives me the error is the import of the first line).
#import "~#alllearnit/tsw/tsw";
#import "tsw-guide-styles";
If needed, I could share any part of my code that you may need to better understand my project and therefore to help you to solve the problem.
Thanks again for all the help you will give me
Regards
Alessandro
The ~ at the front of the import isn't natively supported by node-sass. There maybe a plug-in you're expecting to be loaded if you copied that snippet from somewhere else.

Can't import library in Python

Running python3 xx.py in my specific folder
shows Import Error
But, I go to my home directory ,and add the new files with same code
and then it can work well. Why?
I checked both sys.path in these two, the path is same
find pycache, init.py
ls -l
remove it
rm -rf "pycache" "init.py" it works!
Finally,it is solved

Package does not exist - error

I am trying to compile a .java file (TransformRTDE.java) that uses several import statements. These statements import .class files present in five external JAR files: dataextract.jar, jna.jar, JRI.jar, JRIEngine.jar and REngine.jar. I have read documentation on how to deal with these import statements while trying to compile your .java file from the command line. However, I do not seem to succeed.
I set up the directory in the command line to be the folder in which my .java file resides. In that same folder, I have put the JAR files. When I try to compile the code using java -cp dataextract.jar jna.jar JRI.jar JRIEngine.jar REngine.jar TransformRTDE.java, I get a package does not exist error. I have set up the class path to include the folder in which all my .java and .jar files reside.
I have searched for hours on this without success. Any ideas what I'm doing wrong?
Thanks in advance!
EDIT: I forgot to mention I also get an error related to annotation processing.
Picture can be found here: https://www.dropbox.com/s/p9ul0olydzmkl6s/error.png

jython ImportError: No module named

I'm new to jython and failing utterly at importing a java class within a jar.
What I am trying to do is write a wrapper shell script which calls a jython script. I can not allowed to edit the jython at all, so adding jars to sys.path within that jython script is not possible.
Error
y", line 17, in
from com.polarland.testModule.cache import CacheInterface
ImportError: No module named polarland
I've added the jar which contains the above package with name of TestModule.jar to PATH, ClASSPATH and JYTHONPATH with no avail. I'm worried this is due to the name of the jar but am not sure.
Any advice would be greatly appreciated!!
In your shell script use:
export CLASSPATH=TestModule.jar:$CLASSPATH
jython ...
In my case setting CLASSPATH is enough. Remember to use full path name and remember to use good .jar name (testmodule.jar and TestModul.jar are different). Maybe you use wrong file rights. Try file command to check if you can read that file. Example for one of jars I use:
mn$ file junit-4.1.jar
junit-4.1.jar: Zip archive data, at least v2.0 to extract
I was getting same issue.
I tried below function and worked well!
>>> import sys
>>> sys.path.append('/path/to/helloworld.jar')
>>> from com.leosoto import HelloWorld
For more info:
http://blog.leosoto.com/2008/07/jython-import-logic.html

file or directory not found for "UIConstants.js"

In Hamattan Application Project in Qt Creator. when I'm trying to import:
import "UIConstants.js" as UIConstants
I always get file or directory not found error after building. It tried to copy the file into my project, the same error pops out.
What could have gone wrong? Please Help, Thank you.
It's either of these two:
forgot to add it in res.qrc
it was located at a different directory(but is included in the project)

Resources