# Pkg error messages in Pluto miss the often basic typo / not-loaded suggestions

**URL:** <https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [November 15, 2024, 12:00pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676 "2024-11-15T12:00:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [November 15, 2024, 12:00pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676/1 "2024-11-15T12:00:23Z")

</div>

In Pluto, when _`Using [pkg_name]`_ fails to load a package it gives “Things you could try”.

```julia
The package [pkg_name].jl could not load because it failed to initialize.

That's not nice! Things you could try:

    Restart the notebook.
    Try a different Julia version.
    Contact the developers of [pkg_name].jl about this error.

```

However I find the suggestions miss the often most basic ones, and can potentially point one off on a tangent. Despite now getting fairly familiar with Julia and Pkg, I still find the most common mistakes are actually:

- Check the spelling
- Check you’ve loaded the package (when in a project environment)

Any chance these could be added to the “Things to try” ?

Note: This is possibly/probably a request to one of the devs, but is the Julia Main or a Pkg error?

---

<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:** [November 15, 2024, 12:22pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676/2 "2024-11-15T12:22:35Z")

</div>

I think this is neither Julia nor Pkg?

In Julia:

```julia
julia> using DatFrames
ERROR: ArgumentError: Package DatFrames not found in current path.
- Run `import Pkg; Pkg.add("DatFrames")` to install the DatFrames package.

```

whereas in Pluto:

```julia
Error message from Main

The package DatFrames.jl could not load because it failed to initialize.

That's not nice! Things you could try:

    Restart the notebook.
    Try a different Julia version.
    Contact the developers of DatFrames.jl about this error.

You might find useful information in the package installation log:

```

So I assume you’re talking about Pluto here?

Btw `Pkg` already does what you suggests when installing (rather than loading) packages:

```julia
pkg> add DatFrames
ERROR: The following package names could not be resolved:
 * DatFrames (not found in project, manifest or registry)
   Suggestions: DataFrames GeoDataFrames Pathnames TSFrames DataFrameTools DataFramesMeta StanDataFrames TimeDataFrames NCDataFrame DateFormats TimeFrames DataTables DataGraphs DataValues DataFrameMacro

```

---

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [November 15, 2024, 12:29pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676/3 "2024-11-15T12:29:33Z")

</div>

Thanks @nilshg. Yes indeed Pluto.  
The suggestions when type during `pkg.add` is excellent… but one doesn’t get there when having forgotten to `add` the pkg first, which was my 2nd point. 😉

So looks like it’s Pluto. I’ll raise a request there.

---

<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:** [November 15, 2024, 12:34pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676/4 "2024-11-15T12:34:43Z")

</div>

Well in Pluto that doesn’t make a lot of sense as there is no `add` (packages are automatically added on `using` by default). That would of course make it more useful if the error on `using` would warn about typos.

---

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [November 15, 2024, 12:40pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676/5 "2024-11-15T12:40:23Z")

</div>

Ah… I found it didn’t automatically add the packages I needed in a project environment. But quickly checking a MWE I find it _does_.

```julia
begin
	using Pkg
	Pkg.activate("Env_MWE") # set up new env
        # Pkg.add("Plots") # NOT needed
	using Plots # load (not add) any package
	plot([1,2], [3,4]) # Works!
end

```

Must have been the JuliaHub environment I was in.  
Thanks for the clarification!

---

<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:** [November 15, 2024, 12:44pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676/6 "2024-11-15T12:44:32Z")

</div>

Huh, interesting - my recollection was that when you do `using Pkg` in a Pluto notebook it disables the Pluto package manager and you’re back to plain `Pkg`, but maybe that has changed, I haven’t used Pluto in a while.

---

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [November 15, 2024, 12:47pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676/7 "2024-11-15T12:47:53Z")

</div>

You’re still correct @nilshg. `using Pkg` disables the Pluto pkg mgr.

---

<div class="post-metadata">

**Author:** ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Post date:** [November 15, 2024, 2:05pm UTC](https://discourse.julialang.org/t/pkg-error-messages-in-pluto-miss-the-often-basic-typo-not-loaded-suggestions/122676/8 "2024-11-15T14:05:05Z")

</div>

BTW: Pkg.add() is required when adding packages to a project environment and/or using a non-default package direct from github.  
From what I can see, not using `Pkg.add()` in a project environment but only `using [pkg_name]` will auto-load (default) packages BUT it’ll load them in the Julia generic entries instead of the specific environment.

```julia
begin
	using Pkg
	Pkg.activate("Env_MWE2")
    # Pkg.add("Plots") # try with and without this 
	using Plots
end

```

```julia
plot([1,2], [3,4]) # still works!

```

but then having NOT used Pkg.add() to add Plots

```julia
Pkg.rm("Plots")

```

results in

```julia
The following package names could not be resolved:
 * Plots (not found in project or manifest)
   Suggestions: Colors

```

As when Plots had been added with `Pkg.add("Plots")` it adds -a dedicated version- to the project directory, and subsequently removes fine.

As expected per [https://pkgdocs.julialang.org/v1/environments/](https://pkgdocs.julialang.org/v1/environments/)
