{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/20339","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/20339/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/20339/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/20339/events","html_url":"https://github.com/JuliaLang/julia/issues/20339","id":204282110,"number":20339,"title":"Proposal: helpful warning when attempting to import / using a known but uninstalled package","user":{"login":"tpapastylianou","id":2027942,"avatar_url":"https://avatars.githubusercontent.com/u/2027942?v=3","gravatar_id":"","url":"https://api.github.com/users/tpapastylianou","html_url":"https://github.com/tpapastylianou","followers_url":"https://api.github.com/users/tpapastylianou/followers","following_url":"https://api.github.com/users/tpapastylianou/following{/other_user}","gists_url":"https://api.github.com/users/tpapastylianou/gists{/gist_id}","starred_url":"https://api.github.com/users/tpapastylianou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpapastylianou/subscriptions","organizations_url":"https://api.github.com/users/tpapastylianou/orgs","repos_url":"https://api.github.com/users/tpapastylianou/repos","events_url":"https://api.github.com/users/tpapastylianou/events{/privacy}","received_events_url":"https://api.github.com/users/tpapastylianou/received_events","type":"User","site_admin":false},"labels":[{"id":24139877,"url":"https://api.github.com/repos/JuliaLang/julia/labels/packages","name":"packages","color":"02e10c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-31T12:30:21Z","updated_at":"2017-02-01T13:21:44Z","closed_at":null,"body":"Currently if one attempts to use a package that is not installed, one gets a message like so:\r\n\r\n    julia> using DataFrames\r\n    ERROR: ArgumentError: Module DataFrames not found in current path.\r\n    Run `Pkg.add(\"DataFrames\")` to install the DataFrames package.\r\n\r\nThis is the case whether the package is known to julia or not. For example:\r\n\r\n    julia> using dataFrameS\r\n    ERROR: ArgumentError: Module dataFrameS not found in current path.\r\n    Run `Pkg.add(\"dataFrameS\")` to install the dataFrameS package.\r\n\r\n    julia> Pkg.add(\"dataFrameS\")\r\n    ERROR: unknown package dataFrameS\r\n    Stacktrace ... (etc etc)\r\n\r\nJulia has access to registered packages that can be `Pkg.add`ed automatically by name. It would therefore be useful to have a more helpful message, e.g.\r\n\r\n    julia> using DataFrames\r\n    ERROR: ArgumentError: Module DataFrames not found in current path.\r\n    'DataFrames' is a registered julia package; type `Pkg.add(\"DataFrames\")` to install.\r\n\r\nversus\r\n\r\n    julia> using dataFrameS\r\n    ERROR: ArgumentError: Module dataFrameS not found in current path.\r\n    'dataFrameS' is not a registered julia package; did you mean one of the following: \r\n        DataFrames\r\n        DataFramesMeta\r\n        DataStreams\r\n    Please check you have typed the module name correctly; if this is not a registered package\r\n    please install the module manually (see http://link.to.julia.manual.relevant.section.com).\r\n\r\nFurthermore, as an extension to this proposal, a similar warning would be useful if a function is called that is undefined in the current session, but defined in an already installed package (or even in a not-installed but registered package). This is how octave does it, by maintaining a very simple textfile of function names that comes with the distribution. e.g.:\r\n\r\n    >> nanmean\r\n    warning: the 'nanmean' function belongs to the financial package from Octave\r\n    Forge which seems to not be installed in your system.\r\n\r\n    >> mat2gray\r\n    warning: the 'mat2gray' function belongs to the image package from Octave Forge\r\n    which you have installed but not loaded.  To load the package, run 'pkg\r\n    load image' from the Octave prompt.\r\n\r\nThe equivalent in julia could be something like:\r\n\r\n    julia> DataFrame(a = 1)\r\n    ERROR: UndefVarError: DataFrame not defined\r\n    Warning: A \"DataFrame\" function is exported by the following modules\r\n    installed on your system but not currently \"used\":\r\n        DataFrames\r\n\r\n    julia> Pkg.search(\"DataFrame\")    # \"+\" means installed on system\r\n    7x1 Array{String}\r\n         + DataFrames.jl\r\n           JimmysAwesomeDataFrames.jl\r\n           DataFramesRUs.jl\r\n           DataFramesSux.jl\r\n           SarasCuteDataFrames.jl\r\n           MoarDataFrames.jl\r\n           DataFramesYUDoDis.jl\r\n        "},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/276655546","html_url":"https://github.com/JuliaLang/julia/issues/20339#issuecomment-276655546","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/20339","id":276655546,"user":{"login":"nalimilan","id":1120448,"avatar_url":"https://avatars.githubusercontent.com/u/1120448?v=3","gravatar_id":"","url":"https://api.github.com/users/nalimilan","html_url":"https://github.com/nalimilan","followers_url":"https://api.github.com/users/nalimilan/followers","following_url":"https://api.github.com/users/nalimilan/following{/other_user}","gists_url":"https://api.github.com/users/nalimilan/gists{/gist_id}","starred_url":"https://api.github.com/users/nalimilan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalimilan/subscriptions","organizations_url":"https://api.github.com/users/nalimilan/orgs","repos_url":"https://api.github.com/users/nalimilan/repos","events_url":"https://api.github.com/users/nalimilan/events{/privacy}","received_events_url":"https://api.github.com/users/nalimilan/received_events","type":"User","site_admin":false},"created_at":"2017-02-01T13:21:44Z","updated_at":"2017-02-01T13:21:44Z","body":"An additional feature mentioned in the description is listing approximate matches when no package is found. This is really helpful when you forget an `s` or get the case wrong. I guess the same code as for `help()` could be used."}}
{"actor":{"display_login":"nalimilan"}}