Adding Packages in VS code

I just added Julia to VS Code, and wrote my “Hello World” Program. But, when I try to use pkg.add(“Calulus.jl”) to add a calculus package, I get a load error.

Please include the full error including the stacktrace.

Is this verbatim what you tried? Note that it needs to be a capitalized P; Pkg.add(...), and you also need import Pkg to load the package manager.

I did Pkg.add, but I didn’t know if it was case sensitive. I just did this

import Pkg.add (“Calculus.jl”)

When installing a Julia package, you don’t need to include the .jl at the end of the package’s name.

Either of the following two options should work:

Option 1:

using Pkg

Pkg.add("Calculus")

Option 2:

import Pkg

Pkg.add("Calculus")
1 Like

That seems to have done it, it’s updating, and not giving me a an error, but I get a warning. I’ll keep an eye on it.

1 Like

All worked, but now I need to use

using

I get a warning:

If you have a VSCodeDebugger checked for development and have added Pkg as a dependency but haven’t updated your primary environment try ‘Pkg.resolve()’
Otherwise you may need to report an issue with VSCodeDebugger

When I added the Calculus pkg

using Calculus

gives a load error.

All sorted out. Thank’s Everyone