What's the `Pkg` equivalent of `pin Pkg1@0.5.0`?

I can do Pkg.add("Pkg1") which is the same as ]add Pkg1.

What’s the equivalent of ]pin Pkg1@0.5.0? I can’t run this in Jupyter notebook.

I tried Pkg.pin("Pkg1", v"0.50") but it doesn’t have this signature.

From running

using Pkg

I get the example:

Pkg.pin(PackageSpec(name="Example", version="0.3.1"))

Is that not working for you?

Of course, in your example it would be

Pkg.pin(PackageSpec(name="Pkg1", version="0.50"))