Error loading CSV package in Jupyter Notebook

I found a discrepancy in behaviour while loading the CSV package in Julia in a Jupyter notebook. I am currently learning Julia for Data Science from JuliaAcademy. Now, I am using Julia in Jupyter notebook inside Microsoft VS Code and upon running using CSV, I find the following error:

in expression starting at C:\Users\user\.julia\packages\CSV\jFiCn\src\CSV.jl:1
Failed to precompile CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b] to C:\Users\user\.julia\compiled\v1.7\CSV\jl_25FF.tmp.

Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base .\loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base .\loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base .\loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:997
 [7] eval
   @ .\boot.jl:373 [inlined]
 [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base .\loading.jl:1196

However, upon running the same thing in Julia REPL, surprisingly, no errors pop up:

julia> using CSV
[ Info: Precompiling CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]

julia> C=CSV.read("D:/Julia/Julia for Data Science/DataScience-main/programming_languages.csv",DataFrame)
73×2 DataFrame
 Row │ year   language
     │ Int64  String31
─────┼───────────────────────────────────
   1 │  1951  Regional Assembly Language
   2 │  1952  Autocode
   3 │  1954  IPL
   4 │  1955  FLOW-MATIC
   5 │  1957  FORTRAN
   6 │  1957  COMTRAN
   7 │  1958  LISP
   8 │  1958  ALGOL 58
   9 │  1959  FACT
  10 │  1959  COBOL
  11 │  1959  RPG
  ⋮  │   ⋮                ⋮
  64 │  2006  PowerShell
  65 │  2007  Clojure
  66 │  2009  Go
  67 │  2010  Rust
  68 │  2011  Dart
  69 │  2011  Kotlin
  70 │  2011  Red
  71 │  2011  Elixir
  72 │  2012  Julia
  73 │  2014  Swift
                          52 rows omitted

I don’t get why am I getting an error in my Jupyter notebook. I tried to restart my Julia kernel several times inside VS Code but to no avail. I am currently using Julia version 1.7.2. I would very much appreciate your help with this issue. Also, I guess it’s better to note that I didn’t change my directory.

Package status reports from REPL:

(@v1.7) pkg> st
      Status `C:\Users\user\.julia\environments\v1.7\Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.1
  [336ed68f] CSV v0.10.4
  [5ae59095] Colors v0.12.8
  [8f4d0f93] Conda v1.7.0
  [a93c6f00] DataFrames v1.3.4
  [7876af07] Example v0.5.3
  [7073ff75] IJulia v1.23.3
  [bac558e1] OrderedCollections v1.4.1
  [58dd65bb] Plotly v0.4.1
  [f0f68f2c] PlotlyJS v0.18.8
  [91a5bcdd] Plots v1.31.4
  [27ebfcd6] Primes v0.5.3
  [438e738f] PyCall v1.93.1
  [bd369af6] Tables v1.7.0
  [b8865327] UnicodePlots v3.0.4
  [fdbf4ff8] XLSX v0.8.1
  [8bb1440f] DelimitedFiles
  [f43a241f] Downloads
  [fa267f1f] TOML

What is the active environment in your notebook? Can you show what

Base.active_project()

or Pkg.status() returns in a Jupyter cell?

I don’t know how or what happened, but the problem got solved somehow. Still, as you requested the outputs, here are they:

Base.active_project()
"C:\\Users\\user\\.julia\\environments\\v1.7\\Project.toml"
using Pkg
Pkg.status()
      Status `C:\Users\user\.julia\environments\v1.7\Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.1
  [336ed68f] CSV v0.10.4
  [5ae59095] Colors v0.12.8
  [8f4d0f93] Conda v1.7.0
  [a93c6f00] DataFrames v1.3.4
  [7876af07] Example v0.5.3
  [7073ff75] IJulia v1.23.3
  [bac558e1] OrderedCollections v1.4.1
  [58dd65bb] Plotly v0.4.1
  [f0f68f2c] PlotlyJS v0.18.8
  [91a5bcdd] Plots v1.31.4
  [27ebfcd6] Primes v0.5.3
  [438e738f] PyCall v1.93.1
  [bd369af6] Tables v1.7.0
  [b8865327] UnicodePlots v3.0.4
  [fdbf4ff8] XLSX v0.8.1
  [8bb1440f] DelimitedFiles
  [f43a241f] Downloads
  [fa267f1f] TOML

As to how my problem got solved, I think I have a guess. I selected a different kernel than what I normally do, as that one is not showing up inside the Change kernel options:

However, I cannot figure out why my generally selected kernel is not showing up in the list above.

Glad it works. You can try
jupyter kernelspec list
in the REPL to see if your normal kernel is listed there. Otherwise you may have to manually add it again.