JuliaStats / RDatasets.jl

Julia package for loading many of the data sets available in R
GNU General Public License v3.0
159 stars 56 forks source link

Error encountered while loading #97

Closed hafez-ahmad closed 4 years ago

hafez-ahmad commented 4 years ago

dataset("datasets","iris") Error encountered while loading "C:\Users\hafez\.julia\packages\RDatasets\WIQKI\src\..\data\datasets\iris.rda".

Fatal error: ERROR: UndefVarError: identifier not defined Stacktrace: [1] handle_error(::UndefVarError, ::FileIO.File{FileIO.DataFormat{:RData}}) at C:\Users\hafez.julia\packages\FileIO\ZknoK\src\error_handling.jl:82 [2] handle_exceptions(::Array{Any,1}, ::String) at C:\Users\hafez.julia\packages\FileIO\ZknoK\src\error_handling.jl:77 [3] load(::FileIO.Formatted; options::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\hafez.julia\packages\FileIO\ZknoK\src\loadsave.jl:186 [4] load at C:\Users\hafez.julia\packages\FileIO\ZknoK\src\loadsave.jl:166 [inlined] [5] #load#13 at C:\Users\hafez.julia\packages\FileIO\ZknoK\src\loadsave.jl:118 [inlined] [6] load at C:\Users\hafez.julia\packages\FileIO\ZknoK\src\loadsave.jl:118 [inlined] [7] dataset(::String, ::String) at C:\Users\hafez.julia\packages\RDatasets\WIQKI\src\dataset.jl:12 [8] top-level scope at none:0

bkamins commented 4 years ago

This is fixed by RData.jl master that is not released yet. I will try to ask maintainers to make appropriate releases for RData.jl and RDatasets.jl.

bkamins commented 4 years ago

@hafez-ahmad and @liwen-alt - can you please report what are the versions of:

(in general just updating packages should resolve this issue)

liwen-alt commented 4 years ago

image

liwen-alt commented 4 years ago

I have the same problem,This is the version of my package

bkamins commented 4 years ago

You are not working on latest releases of the packages. Your version of DataFrames.jl is 0.20.2 and it still has identifer function defined in deprecated code, so it is strange you get this exact error.

The easiest fix is to update your packages:

Please let me know if this helped (it works on my computer).

liwen-alt commented 4 years ago

I have updated package,but the version of package hasn't changed. image image image

bkamins commented 4 years ago

The problem is that you are probably using default Project.toml for all your projects. This is not a recommended practice. However, if you want to use it then you can follow what I have described here to understand which package is causing problems with update.

(start with add DataFrames@0.21.2 and see what you get in the error message)

I have also noticed that you use outdated versions of CSV.jl and DataFramesMeta.jl (maybe also others, but for these I can quickly tell that you have them in wrong versions).

When you identify what package stops DataFrames.jl and RData.jl from being updated please let me know, as probably its maintainers should get notified about it. Thank you!

liwen-alt commented 4 years ago

Thank you! Now the problem is solved.

bkamins commented 4 years ago

Great, so I think the issue can be closed by someone from JuliaStats.jl.

asinghvi17 commented 4 years ago

@bkamins should we create a new release with more restrictive compat?

bkamins commented 4 years ago

It should be not strictly required, as RData.jl has a more restrictive compat and package manager should resolve it properly (as constraints in RDatasets.jl are not binding anyway).

However, in some cases (especially if someone uses default Project.toml/Manifest.toml which are typically quite polluted) actually using Package Manager is not as obvious as it seems (it does the right job, but you need to know more than just add PackageName to control things properly).

Therefore, the cleanest thing would be:

  1. have a new version of RDatatests.jl with more restrictive version requirements
  2. retroactively make version requirements for RDatasets.jl for past releases more restrictive in GlobalRegistry (as now they are flexible, so things potentially can get messy anyway)

But I think that the reported problem is only transitory, so things can be left as is.