Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Other Languages

Tatiane Lima
Tatiane Lima
6,738 Points

I tryied to install the Julia and i get an error

julia> ENV["JUPYTER"] = "/anaconda3/bin/jupyter" "/anaconda3/bin/jupyter"

julia> Pkg.add("IJulia") ERROR: UndefVarError: Pkg not defined Stacktrace: [1] top-level scope at none:0


This is my version of Julia: Version 1.1.0 (2019-01-21)

Thanks a lot

May be case sensitive. It looks like you used lower case j

2 Answers

This is what I did:

In Julia press ] to enter package manager.

julia>]

You'll see the following prompt

(v1.1) pkg>

Enter:

add "IJulia"

Press delete to exit package manager

Tatiane Lima
Tatiane Lima
6,738 Points

Thanks Kris, it started to work but i get another error

(v1.1) pkg> add"Ijulia"
   Cloning default registries into `~/.julia`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
     Added registry `General` to `~/.julia/registries/General`
ERROR: The following package names could not be resolved:
 * Ijulia (not found in project, manifest or registry)
Please specify by known `name=uuid`.

i tried to find a solution in the internet and people said that i should run this code

rm(joinpath(homedir(), ".julia", "registries"); recursive=true)

That didn't work again, and i got this error message:

ERROR: could not determine command
Nicole Buckenwolf
Nicole Buckenwolf
8,721 Points

Thank you I was getting this error, which I'm adding here in case anyone else gets it:

ERROR: UndefVarError: `Pkg` not defined

but your comment worked for me.

To add a little clarification to this. The old way of installing julia add-ons (Pkg.add("IJulia")) no longer works.

Nowadays, to add a new package, you would first hit ']'. That should cause you to get a new prompt that says pkg>.

Next you can install it by saying:

add IJulia

I believe the most recent problem was because the user typed add "Ijulia" instead of ```add "IJulia". The package names are case sensitive.