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

using CSV throws an error #337

Closed
orhanabar opened this issue Oct 21, 2018 · 9 comments
Closed

using CSV throws an error #337

orhanabar opened this issue Oct 21, 2018 · 9 comments

Comments

@orhanabar
Copy link

orhanabar commented Oct 21, 2018

I have run Pkg.add("CSV") and got this:
julia> Pkg.add("CSV")
Updating registry at C:\Users\orhan\.julia\registries\General
Updating git-repo https://github.com/JuliaRegistries/General.git
Resolving package versions...
Updating C:\Users\orhan\.julia\environments\v1.0\Project.toml
[no changes]
Updating C:\Users\orhan\.julia\environments\v1.0\Manifest.toml
[no changes]

I can run using CSV on Mac without any issue.
When I try to run using CSV code on a Windows 10 machine, I am getting this error:

julia> using CSV
ERROR: InitError: MethodError: no method matching Parsers.Delimited(::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}, ::String, ::String, ::String, ::String; ignore_repeated=false)
Closest candidates are:
Parsers.Delimited(::Union{Function, Layer, Type}, ::Union{Char, String}...; ignorerepeated, newline) at C:\Users\orhan.julia\packages\Parsers\v4oJT\src\Parsers.jl:308 got unsupported keyword argument "ignore_repeated"
Parsers.Delimited(::Union{Char, String}...; ignorerepeated, newline) at C:\Users\orhan.julia\packages\Parsers\v4oJT\src\Parsers.jl:309 got unsupported keyword argument "ignore_repeated"
Parsers.Delimited(::Bool, ::Bool, ::I, ::T<:Parsers.Trie) where {I, T<:Trie} at C:\Users\orhan.julia\packages\Parsers\v4oJT\src\Parsers.jl:307 got unsupported keyword argument "ignore_repeated"
Stacktrace:
[1] kwerr(::NamedTuple{(:ignore_repeated,),Tuple{Bool}}, ::Type, ::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}, ::String, ::String, ::String, ::String) at .\error.jl:97
[2] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:ignore_repeated,),Tuple{Bool}}, ::Type{Parsers.Delimited}, ::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}, ::String, ::String, ::String, ::String) at .\none:0
[3] (::getfield(CSV, Symbol("##6#12")){Bool,String})(::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}) at C:\Users\orhan.julia\packages\CSV\uLyo0\src\CSV.jl:151
[4] |>(::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}, ::getfield(CSV, Symbol("##6#12")){Bool,String}) at .\operators.jl:813
[5] (::getfield(CSV, Symbol("##3#9")){Bool,Char,Nothing,Nothing,Char,String,Bool})(::Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}) at C:\Users\orhan.julia\packages\CSV\uLyo0\src\CSV.jl:149
[6] |>(::Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}, ::getfield(CSV, Symbol("##3#9")){Bool,Char,Nothing,Nothing,Char,String,Bool}) at .\operators.jl:813
[7] #File#1(::Int64, ::Bool, ::Int64, ::Nothing, ::Int64, ::Nothing, ::Bool, ::Nothing, ::Bool, ::Array{String,1}, ::String, ::String, ::Bool, ::Char, ::Nothing, ::Nothing, ::Char, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Dict{Type,Type}, ::Symbol, ::Bool, ::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Type, ::String) at C:\Users\orhan.julia\packages\CSV\uLyo0\src\CSV.jl:148
[8] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:allowmissing,),Tuple{Symbol}}, ::Type{CSV.File}, ::String) at .\none:0
[9] init() at C:\Users\orhan.julia\packages\CSV\uLyo0\src\CSV.jl:247
[10] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:630
[11] macro expansion at .\logging.jl:312 [inlined]
[12] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:701
[13] _require(::Base.PkgId) at .\loading.jl:934
[14] require(::Base.PkgId) at .\loading.jl:855
[15] macro expansion at .\logging.jl:311 [inlined]
[16] require(::Module, ::Symbol) at .\loading.jl:837
during initialization of module CSV

@quinnj
Copy link
Member

quinnj commented Oct 21, 2018

Looks like your Parsers.jl version is outdated; for CSV 0.4.2, you'll need Parsers 0.2.9.

@orhanabar
Copy link
Author

Thank you Pkg.add("Parsers") solved the problem.

@orhanabar
Copy link
Author

I am trying to run a jl file which works well on Mac but again in Windows I am getting this error:
using CSV is working but still it doesn't read the file.

julia> df = CSV.File("Some_file.csv") |> DataFrame
ERROR: MethodError: no method matching Parsers.Delimited(::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}, ::String, ::String, ::String, ::String; ignore_repeated=false)
Closest candidates are:
Parsers.Delimited(::Union{Function, Layer, Type}, ::Union{Char, String}...; ignorerepeated, newline) at C:\Users\user.julia\packages\Parsers\v4oJT\src\Parsers.jl:308 got unsupported keyword argument "ignore_repeated"
Parsers.Delimited(::Union{Char, String}...; ignorerepeated, newline) at C:\Users\user.julia\packages\Parsers\v4oJT\src\Parsers.jl:309 got unsupported keyword argument "ignore_repeated"
Parsers.Delimited(::Bool, ::Bool, ::I, ::T<:Parsers.Trie) where {I, T<:Trie} at C:\Users\user.julia\packages\Parsers\v4oJT\src\Parsers.jl:307 got unsupported keyword argument "ignore_repeated"
Stacktrace:
[1] kwerr(::NamedTuple{(:ignore_repeated,),Tuple{Bool}}, ::Type, ::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}, ::String, ::String, ::String, ::String) at .\error.jl:97
[2] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:ignore_repeated,),Tuple{Bool}}, ::Type{Parsers.Delimited}, ::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}, ::String, ::String, ::String, ::String) at .\none:0
[3] (::getfield(CSV, Symbol("##6#12")){Bool,String})(::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}) at C:\Users\user.julia\packages\CSV\uLyo0\src\CSV.jl:151
[4] |>(::Parsers.Quoted{Parsers.Strip{Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}}}, ::getfield(CSV, Symbol("##6#12")){Bool,String}) at .\operators.jl:813
[5] (::getfield(CSV, Symbol("##3#9")){Bool,Char,Nothing,Nothing,Char,String,Bool})(::Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}) at C:\Users\user.julia\packages\CSV\uLyo0\src\CSV.jl:149
[6] |>(::Parsers.Sentinel{typeof(Parsers.defaultparser),Parsers.Trie{0x00,false,missing,2,Tuple{}}}, ::getfield(CSV, Symbol("##3#9")){Bool,Char,Nothing,Nothing,Char,String,Bool}) at .\operators.jl:813
[7] #File#1(::Int64, ::Bool, ::Int64, ::Nothing, ::Int64, ::Nothing, ::Bool, ::Nothing, ::Bool, ::Array{String,1}, ::String, ::String, ::Bool, ::Char, ::Nothing, ::Nothing, ::Char, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Dict{Type,Type}, ::Symbol, ::Bool, ::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Type, ::String) at C:\Users\user.julia\packages\CSV\uLyo0\src\CSV.jl:148
[8] CSV.File(::String) at C:\Users\user.julia\packages\CSV\uLyo0\src\CSV.jl:138
[9] top-level scope at none:0

@quinnj
Copy link
Member

quinnj commented Oct 21, 2018

Can you share the output of pkg> st (it prints out the version of each package in your environment). It looks like you still don't have the latest Parsers.jl version.

@orhanabar
Copy link
Author

Thsi is the output and I have the Parsers v0.2.9. I have a lot of problems with julia on Windows. I start thinking julia is not intended to be used on windows.

(v1.0) pkg> st
Status C:\Users\orhan\.julia\environments\v1.0\Project.toml
[336ed68f] CSV v0.4.1
[9961bab8] Cbc v0.4.2
[a93c6f00] DataFrames v0.14.1
[7073ff75] IJulia v1.13.0
[a98d9a8b] Interpolations v0.10.3
[682c06a0] JSON v0.19.0
[69de0a69] Parsers v0.2.9
[91a5bcdd] Plots v0.20.5
[30578b45] URIParser v0.4.0

@quinnj
Copy link
Member

quinnj commented Oct 21, 2018

Ah, it looks like your CSV is outdated though; the current release is v0.4.2.

@orhanabar
Copy link
Author

I cannot update it.
When I run:
(v1.0) pkg> add CSV
Resolving package versions...
Updating C:\Users\orhan\.julia\environments\v1.0\Project.toml
[no changes]
Updating C:\Users\orhan\.julia\environments\v1.0\Manifest.toml
[no changes]

@quinnj
Copy link
Member

quinnj commented Oct 23, 2018

See another user's solution here: #338 (comment)

@orhanabar
Copy link
Author

Removing and adding again solved the issue. thanks.

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