# Writeshortest error

**URL:** <https://discourse.julialang.org/t/writeshortest-error/92764>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 10, 2023, 5:27pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764 "2023-01-10T17:27:38Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [January 10, 2023, 5:27pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/1 "2023-01-10T17:27:38Z")

</div>

I keep getting this error as below, after I upgraded my DIVAnd.jl package. Not sure if they are realted, but I was able to run scripts like CSV.write without any issues even yesterday.

“UndefVarError: writeshortest not defined”.

Does anyone know how to fix this issue? Many thanks.

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [January 10, 2023, 5:35pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/2 "2023-01-10T17:35:31Z")

</div>

It’s a version mismatch between Parsers + CSV; it shouldn’t be possible to get those versions out of sync, but sometimes it happens. Probably just need to update Parsers.

---

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [January 10, 2023, 6:26pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/3 "2023-01-10T18:26:54Z")

</div>

Many thanks. How do I update Parsers? I just did the below and the error remains.

```julia
using Pkg
Pkg.add("Parsers")

```

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [January 10, 2023, 6:36pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/4 "2023-01-10T18:36:54Z")

</div>

`] up Parsers`. You need to make sure you get a Parsers.jl version that is \>= 2.5.

---

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [January 10, 2023, 6:41pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/5 "2023-01-10T18:41:17Z")

</div>

Just did as you recommended. I checked the version as well, v2.5.2. Unfortunately, it still produces the same error as below:

`LoadError: UndefVarError: writeshortest not defined`

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [January 10, 2023, 6:50pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/6 "2023-01-10T18:50:58Z")

</div>

Hmmmm, where is the error coming from exactly? (what’s the full error backtrace?) Maybe it’s CSV.jl that needs to be updated.

---

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [January 10, 2023, 7:56pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/7 "2023-01-10T19:56:33Z")

</div>

My CSV is up to date, version 0.10.4.

Below is my full error backtrace:

```julia
ERROR: LoadError: UndefVarError: writeshortest not defined
Stacktrace:
  [1] writecell(buf::Vector{UInt8}, pos::Int64, len::Int64, io::IOStream, x::Float64, opts::CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)})
    @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:444
  [2] (::CSV.var"#106#107"{Vector{UInt8}, Base.RefValue{Int64}, Int64, IOStream, Int64, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, UInt8, UInt8})(val::Float64, col::Int64, nm::Symbol)
    @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:371
  [3] eachcolumn
    @ ~/.julia/packages/Tables/T7rHm/src/utils.jl:70 [inlined]
  [4] writerow(buf::Vector{UInt8}, pos::Base.RefValue{Int64}, len::Int64, io::IOStream, sch::Tables.Schema{(:Variable, :ARAG, :CALC, :pH, :H, :Hfree, :CO3, :fCO2, :RF, :DIC, :TA, :Temp, :Sal), Tuple{String, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64}}, row::DataFrameRow{DataFrame, DataFrames.Index}, cols::Int64, opts::CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)})
    @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:367
  [5] (::CSV.var"#99#100"{Bool, Bool, Tables.Schema{(:Variable, :ARAG, :CALC, :pH, :H, :Hfree, :CO3, :fCO2, :RF, :DIC, :TA, :Temp, :Sal), Tuple{String, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64}}, DataFrames.DataFrameRows{DataFrame}, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, Vector{UInt8}, Int64, Int64, NTuple{13, Symbol}})(io::IOStream)
    @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:235
  [6] with(f::CSV.var"#99#100"{Bool, Bool, Tables.Schema{(:Variable, :ARAG, :CALC, :pH, :H, :Hfree, :CO3, :fCO2, :RF, :DIC, :TA, :Temp, :Sal), Tuple{String, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64, Float64}}, DataFrames.DataFrameRows{DataFrame}, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, Vector{UInt8}, Int64, Int64, NTuple{13, Symbol}}, io::Any, append::Bool, compress::Bool)
    @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:303
  [7] #write#98
    @ ~/.julia/packages/CSV/jFiCn/src/write.jl:225 [inlined]
  [8] write(file::String, itr::DataFrame; delim::Char, quotechar::Char, openquotechar::Nothing, closequotechar::Nothing, escapechar::Char, newline::Char, decimal::Char, dateformat::Nothing, quotestrings::Bool, missingstring::String, transform::typeof(CSV._identity), bom::Bool, append::Bool, compress::Bool, writeheader::Nothing, partition::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:210
  [9] write(file::String, itr::DataFrame)
    @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:171
 [10] top-level scope
    @ ~/Desktop/Julia_coding/A03_global_decadal/test.jl:85
in expression starting at /Users/Doe/Desktop/Julia_coding/A03_global_decadal/test.jl:85

```

---

<div class="post-metadata">

**Author:** ![simonluzara](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonluzara/32/205260_2.png) [@simonluzara](https://discourse.julialang.org/u/simonluzara)\
**Post date:** [January 11, 2023, 10:06am UTC](https://discourse.julialang.org/t/writeshortest-error/92764/8 "2023-01-11T10:06:58Z")

</div>

Same here, have got the same problem.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [January 11, 2023, 12:20pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/9 "2023-01-11T12:20:52Z")

</div>

The current version of CSV is 0.10.9, not 0.10.4 - are you on some old Julia version (I think Julia 1.5 and earlier only support CSV up to 0.10.4)?

---

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [January 11, 2023, 1:12pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/10 "2023-01-11T13:12:03Z")

</div>

Thanks for the info. I’m on Julia V1.7.2. Kind of reluctant to upgrade, because it will likely mess up my GMT.jl package.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [January 11, 2023, 1:59pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/11 "2023-01-11T13:59:09Z")

</div>

Well then you might be out of luck, as clearly the current versions you have aren’t working. You can try to `pin` GMT in your environment and update (and `undo` if the update doesn’t go as planned), but I’m not sure why you would excpet GMT to be “messed up” by an update.

---

<div class="post-metadata">

**Author:** ![simonluzara](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonluzara/32/205260_2.png) [@simonluzara](https://discourse.julialang.org/u/simonluzara)\
**Post date:** [January 13, 2023, 11:41am UTC](https://discourse.julialang.org/t/writeshortest-error/92764/12 "2023-01-13T11:41:49Z")

</div>

Hey, found a better and fast solution.

“using DelimitedFiles\n”,  
“\n”,  
“open("sundial\_3.txt", "w") do io\n”,  
" writedlm(io, [time\_3rd P\_ex\_1\_3rd P\_co\_1\_3rd P\_res\_1\_3rd],‘,’)\n",  
" end;"

time\_3rd P\_ex\_1\_3rd P\_co\_1\_3rd P\_res\_1\_3rd…they are vectors of length 5000. It created a text file with 4x5000 which is readable in Matlab, Excel and pyhton.

Cheers!

Sorry for the code, I use jupyter notebook on a Notepad++

---

<div class="post-metadata">

**Author:** ![Leon6](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leon6/32/205483_2.png) [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Post date:** [January 13, 2023, 1:14pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/13 "2023-01-13T13:14:04Z")

</div>

After I upgrade my Julia to V1.8.5 and update the CSV package, this issue has been resolved. Many thanks.

---

<div class="post-metadata">

**Author:** ![Clark](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@Clark](https://discourse.julialang.org/u/Clark)\
**Post date:** [March 20, 2023, 4:46pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/14 "2023-03-20T16:46:16Z")

</div>

I got this error strangely between earlier this morning and later this morning. I updated everything (was in julia 1.8.1 → 1.8.5) CSV → 0.10.9, DataFrames → 1.3.6, Parsers → 2.5.8

---

<div class="post-metadata">

**Author:** ![simonluzara](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonluzara/32/205260_2.png) [@simonluzara](https://discourse.julialang.org/u/simonluzara)\
**Post date:** [July 21, 2023, 12:25pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764/15 "2023-07-21T12:25:27Z")

</div>

Try the method I just mentioned.
