Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"] activate ./" required before “] status” in the "1. Environment setup.ipynb" #2

Closed
adam-zd opened this issue Jul 29, 2020 · 4 comments

Comments

@adam-zd
Copy link

adam-zd commented Jul 29, 2020

Hey Professor Kamiński,

Thanks for the awesome DataFrames.jl package and the pragmatic tutorial on JuliaAcademy!

It seems we need an additional line of code, "] activate ./", before we call “] status” in the first notebook "1. Environment setup.ipynb".

I'm using nteract 0.24.0 with Julia 1.4.2 on a Mac. Without "] activate ./", the "] status" looks for Project.toml file in the default Julia path (~/.julia/environments/v1.4/Project.toml) instead of the current working path where the notebook locates.

Thanks,
Adam

@bkamins
Copy link
Contributor

bkamins commented Jul 29, 2020

Thank you for reporting this. It seems to be a problem with nteract as what I use follows the specification how things should work https://github.com/JuliaLang/IJulia.jl#julia-projects (and they work this way for me).

Before we move forward - please confirm that you start Jupyter Notebook in the directory where Project.toml is located (I assume yes). If this is the case then I will report the issue in https://github.com/JuliaLang/IJulia.jl.

CC @stevengj as you maybe know about this issue already.

@adam-zd
Copy link
Author

adam-zd commented Jul 29, 2020

You are welcome. I did more tests just now to reproduce this issue:

  • Step 1: Download the "1. Environment setup.ipynb" from the link below the tutorial video on JuliaAcademy and put it under "./Introduction to DataFrames.jl/"
  • Step 2: Double-click to run the notebook with nteract. (At this time, the Project.toml file doesn't exist. The folder only contains one notebook file.)
  • Step 3: Yesterday when I reached "isfile.(["Project.toml", "Manifest.toml"])" I realized I need these two files from GitHub. So I downloaded as zip archive and extracted the files to the same folder where the "1. Environment setup.ipynb" from Step 1 located. (At this time, the "1. Environment setup.ipynb" was still open in nteract.)
  • Step 4: Run "isfile.(["Project.toml", "Manifest.toml"])" to get two 1s.
  • Step 5: Run "] status" to get "~/.julia/environments/v1.4/Project.toml" checked instead of the "./Introduction to DataFrames.jl/Project.toml"

I tried to run the same notebook with Project.toml already exists in the same folder. It correctly recognized the path "./Introduction to DataFrames.jl/Project.toml" without an issue.

I guess IJulia has a mechanism to look for Project.toml file in the same folder as the notebook first, if it doesn't exist, then fallback to the default Julia path.

If this is true, then this issue can be avoided if a student clones all notebooks and toml files from GitHub directly instead of just download one notebook from JuliaAcademy. Or just add "] activate ./" before “] status” as a safe net.

@bkamins
Copy link
Contributor

bkamins commented Jul 29, 2020

So - you are correct. Project.toml is looked for when you start the notebook. A standard procedure is - as you indicated - to clone the whole repository first (rather than downloading a single file). I will update README.md to highlight that.

@bkamins bkamins closed this as completed Jul 29, 2020
@adam-zd
Copy link
Author

adam-zd commented Jul 29, 2020

Thank you professor! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants