Can't open Jupyter Notebook files - Unhandled error - python

I've been having an issue with Jupyter Notebook where I keep getting error
File Load Error for FILENAME.ipynb
Unhandled error
I've looked through many posts including this one that says you can remove the checkpoint folder. I've done that but for some reason it feels like it's ignoring my command
c.FileCheckpoints.checkpoint_dir = ''
The issue seems to be happening with notebooks I've cloned from our Git repo.
When I look at the Jupyter Server output I can see that it's trying to locate the checkpoint file for the file I'm trying to open and it can't find it.
FileNotFoundError: [Errno 2] No such file or directory: '\\\\\\some_folder\\some_folder\\some_folder\\some_folder\\some_folder\\some_folder\\some_folder\\test checkpoints\\some_folder\\.ipynb_checkpoints\\0.Clf_Variable_sig_categorical-checkpoint.ipynb'
I don't understand why it's looking for a checkpoint file? How can I get it to not look for this file and just open the file that I'm trying to open?
This error does not happen to all files that I cloned. Some open others don't, and I can't figure out why it would do that?
Also, if I open the same folder with VS Code, then it opens all the files without any issues.
Any help would be greatly appreciated, I've been going at this for days now and can't figure it out.

Related

pyinstaller unable to find file even though it is there

I would like if anyone encountered the following error while running Pyinstaller.
Loading module hook "hook-notebook.py"...
Unable to find "c:\program files...\symbols\greek-mathfonts-sans-serif-bold.js" when adding binary and data files.
I followed the directory to the 'missing file' but it is right there with the same file name "greek-mathfonts-sans-serif-bold" and is a JS file.
Does anyone know the solution to this?

I cannot run python on vscode because my computer believes that my .py file is untrusted

Previously I had python running just fine in VSCode but recently something has gone wrong and I'm not sure how to resolve it.
When I open a .py file (downloaded from an email) in VSCode I get a message saying that this source is not trusted. I then followed through the suggestions and made the file trusted and I get a box saying that all extensions are enabled. However, when I try and run it, the box is still blurred out
This is the error I get when I try and run the whole file, not just the cell.
Does someone know how to get this up and running first? Thanks
See the comment and say it is .ipynb file, you only need to enter the trusted file name on the command line of Jupiter notebook
"$ jupyter trust 'filename'.ipynb"
This is a link to instructions:https://jupyter-notebook.readthedocs.io/en/stable/notebook.html#trusting-notebooks

RuntimeError: Unable to open shape_predictor_68_face_landmarks.dat?

I´ve made a project with python OpenCV, and used the shape_predictor_68... a .dat file.
Now when I build the project with cx_freeze, everything does right, but when I run the app build, it shows a error.
I am also facing the same issue but after some search, I get to know my shape_predictor_68_face_landmarks.dat is not updated or correct so I replace it with another and issue resolved, the link for the new shape_predictor_68_face_landmarks.dat file is
https://github.com/AKSHAYUBHAT/TensorFace/blob/master/openface/models/dlib/shape_predictor_68_face_landmarks.dat
replace the new file with older one.
Referring the solution to a similar issue here
If you are getting this error:
RuntimeError: Unable to open /home/lyz/openface-master/demos/web/../../models/dlib/shape_predictor_68_face_landmarks.dat
You probably haven't downloaded dlibs models properly, perform Step 4 from https://cmusatyalab.github.io/openface/setup/ again. In short, cd into your openface library and run
./models/get-models.sh
Also, I can't tell how you are running this but it could also be a case that the library may not be correctly imported in your current venv - where your interpreter is.
Install dlib correctly and just paste this .dat file in the same working directory as your code is present and try to run the code.
The link is
http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
You can find the .dat file here after extracting a WinZip file that can be downloaded from the dlib.net website.

No such file or directory error when trying to open a file executing a Python script via VSCodium

I've been using VSCodium lately and writing Python code with it. However, I can't seem to find a way to open an existing file when running the script with VSCodium.
This is the code I have, it's working perfectly fine when ran from a terminal, it works. But not with VSCodium.
def remove_e_words(path,path_copy):
newfile = open(path_copy,"w")
orig = open(path,"r")
lines = orig.readlines()
for line in lines:
newfile.write(sans_e_spec(line)+"\n")
newfile.close()
orig.close()
Here's the error I have :
FileNotFoundError: [Errno 2] No such file or directory: 'vers-queneau.txt'
I've searched for similar issues on stackoverflow, I've tried this:
Can't run python code through VS Code. Can't open file ptvsd_launcher.py [Errno 22] Invalid Argument
I have the downgraded version, it still doesn't work.
I also tried to use the file directory instead, changing a parameter in the Settings, it also didn't fix the issue.
What could I do to be able to solve this problem please?
Thanks.
You probably don't have the current working directory set to what you expect. If you run your code with print(os.getcwd()) you will very likely find that is not the directory you expect it to be. Either adjust your relative file path to take that cwd into account or specify the path in an absolute fashion (if the file is next to the file you're running you can calculate its location based on __file__).

Jupyter notebook not reading an existing file

I have the exact same file directory but Jupyter Notebook is saying there is no such file or directory found.
Here is the error:
FileNotFoundError: [Errno 2] No such file or directory: 'Macintosh HD/Users/kishanpatel/Documents/Machine Learning Data/train.zip'
When you seek help here it is helpful if you provide more details (e.g. How did you verify that Path) and formulate a question.
I am guessing you are trying to write an absolute path which starts with / on MacOS.
In your case it is maybe /Users/kishanpatel/Documents/Machine Learning Data/train.zip

Categories