Is it possible to activate an environment by absolute path?

For example

julia> using Pkg;

julia> Pkg.activate("~/abc")
  Activating new environment at `~/Dropbox/JuliaPackages/~/abc/Project.toml`

assumes that the path is relative, however I wanted to use an absolute path here. Is it possible to indicate this to activate? Or should I change to the home directory first and then activate the local path?

Interestingly, if the environment path is specified as a parameter while launching Julia, it is treated as an absolute path

jishnu:JuliaPackages/ $ julia --project=~/abc                                                                                                      [11:03:15]
┌ Warning: no Manifest.toml file found, static paths used
└ @ Revise ~/.julia/packages/Revise/1boD5/src/packagedef.jl:1369
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.3 (2021-09-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> Base.active_project()
"/home/jishnu/abc/Project.toml"

You could try using joinpath(homedir(), "abc"), probably ~ is not automatically interpreted as the home directory in the string in Julia and it is in the shell when you are passing the project parameter to Julia

2 Likes
julia> expanduser("~/abc")
"/home/gunnar/abc"
2 Likes

The Pkg REPL mode should also expand it.