question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Load a csx file from relative path into Jupyter Notebook doesn't work

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
strabucommented, Mar 21, 2021

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.

1reaction
radobson61commented, Sep 16, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found