Load a csx file from relative path into Jupyter Notebook doesn't work
See original GitHub issueI try to load a csx file into Jupyter Notebook and it throws the next error: error CS1504: Source file ‘Models.cs’ could not be opened – Could not find file. The relative path doesn’t work for #load directive, but the absolute path is ok.
E.g. Having a Jupyter notebook like this: C:/path/to/myNotebook.ipynb:
#load "C:/path/to/file.csx" works
#load "file.csx" doesn't work
#load "./file.csx" doesn't work
#load "../to/file.csx" doesn't work
.NET Interactive 1.0.115407
- OS
- Windows 10
- macOS
- Linux (Please specify distro)
- iOS
- Android
- Browser
- Chrome
- Edge
- Firefox
- Safari
- Frontend
- Jupyter Notebook
- Jupyter Lab
- nteract
- Visual Studio Code
- Other (please specify)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Error on creating relative path in Jupyter Notebook using ...
This problem comes from the relative path of your system. If you want to run another file under the same directory, you could...
Read more >How to Fix a Wrong Path Issue in Jupyter Notebooks
This error is often caused by incorrect file paths, which can be frustrating and time-consuming to fix.
Read more >How to Import a CSV File in Online Jupyter Notebook
Step 1: Check Your File Path ... The first step in importing a CSV file into Jupyter is to ensure that you have...
Read more >Jupyter Recognizes file path in one script but not other
I worked with a file two days ago using the path: file=open('Desktop/LL/Ex/Data/ciRF_VSL2_2.csv') I tried to create a new notebook, ...
Read more >My File is Over There: File Paths for Data Scientists
Relative Paths · Go back one step to the directory that contains the working directory where you are now. · Then look for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey guys, I’m missing loading .csx-files in VSCode/.NET Interactive so much, because I can’t push my Notebooks to git-repos or to Github. They don’t work for other people because they clone to different directories.
Here you’ll find a notebook that describes 3 cases how I want to use it: https://github.com/strabu/dotnet-interactive-issue-repro
I guess I found a solution for this in Microsoft.DotNet.Interactive.CSharp/CSharpKernel.cs, I’ve written a UnitTest and I’ll try to send a pull-request for that.
@jonsequitur for what its worth, that location on my C: drive where the Notebook is, is also where my OneDrive (Personal, not Business) is mapped to, so that location is synching.