Why isn't pkg> activate creating a new environment?

I’m using
https://pkgdocs.julialang.org/v1/environments/
to make a new project directory, clean of all my added packages.
I do:

cd("MyNewProj")
pkg> activate```

Thinking I'd have a clean environment, but pkg> st shows All my old packages. What's not working?

] activate without any argument goes to the default environment. You want ] activate . which says “activate in this directory”

2 Likes

Thanks. So much for the docs :grinning:

Why do you sound like docs doesn’t mention this:

https://docs.julialang.org/en/v1/stdlib/Pkg/

When you are done experimenting with tutorial , you can return to the default environment by running activate with no arguments:

2 Likes

Also here.

It’s also available at the REPL

(@v1.6) pkg> ? activate
  activate
  activate [--shared|--temp] [path]

  Activate the environment at the given path, or the home project environment
  if no path is specified. The active environment is the environment that is
  modified by executing package commands. When the option --shared is given,
  path will be assumed to be a directory name and searched for in the
  environments folders of the depots in the depot stack. In case no such
  environment exists in any of the depots, it will be placed in the first
  depot of the stack. Use the temp option to create temporary environments.
  This should be useful for experimenting with packages.

Well, I ctrl-f searched that page for “activate” and didn’t see the following dot. I guess it’s just assumed you’ll know to do that. But thanks for the default environment tip.

image

The first example in that page has a dot, no?.

1 Like

If you are using Windows, you may like Jeeves, a nice utility to create new Julia projects, VSCode ready.