# Error loading CSV package in Jupyter Notebook

**URL:** <https://discourse.julialang.org/t/error-loading-csv-package-in-jupyter-notebook/85087>\
**Category:** New to Julia\
**Tags:** jupyter, csv\
**Created:** [August 1, 2022, 7:13am UTC](https://discourse.julialang.org/t/error-loading-csv-package-in-jupyter-notebook/85087 "2022-08-01T07:13:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Debartha\_Paul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/debartha_paul/32/202192_2.png) [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Post date:** [August 1, 2022, 7:13am UTC](https://discourse.julialang.org/t/error-loading-csv-package-in-jupyter-notebook/85087/1 "2022-08-01T07:13:38Z")

</div>

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](https://juliaacademy.com/courses/937702) from JuliaAcademy. Now, I am using Julia in Jupyter notebook inside Microsoft VS Code and upon running `using CSV`, I find the following error:

```julia
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
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:

```julia
(@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

```

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [August 1, 2022, 12:11pm UTC](https://discourse.julialang.org/t/error-loading-csv-package-in-jupyter-notebook/85087/2 "2022-08-01T12:11:10Z")

</div>

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

```julia
Base.active_project()

```

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

---

<div class="post-metadata">

**Author:** ![Debartha\_Paul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/debartha_paul/32/202192_2.png) [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Post date:** [August 1, 2022, 1:50pm UTC](https://discourse.julialang.org/t/error-loading-csv-package-in-jupyter-notebook/85087/3 "2022-08-01T13:50:31Z")

</div>

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

```julia
Base.active_project()
"C:\\Users\\user\\.julia\\environments\\v1.7\\Project.toml"

```

```julia
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:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/e/8e9627ac8ca3044a4062401c98238c206ac85f41.png)

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

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [August 2, 2022, 2:22am UTC](https://discourse.julialang.org/t/error-loading-csv-package-in-jupyter-notebook/85087/4 "2022-08-02T02:22:00Z")

</div>

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.
