# How does one activate the environment of an added package?

**URL:** <https://discourse.julialang.org/t/how-does-one-activate-the-environment-of-an-added-package/29478>\
**Category:** General Usage\
**Tags:** package\
**Created:** [October 4, 2019, 10:28am UTC](https://discourse.julialang.org/t/how-does-one-activate-the-environment-of-an-added-package/29478 "2019-10-04T10:28:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 4, 2019, 10:28am UTC](https://discourse.julialang.org/t/how-does-one-activate-the-environment-of-an-added-package/29478/1 "2019-10-04T10:28:10Z")

</div>

I start with the Julia folder wiped clean. So I do

```julia
PetrKrysl@Spectre MINGW64 ~
$ rm -rf ~/.julia/

PetrKrysl@Spectre MINGW64 ~
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.2.0 (2019-08-20)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using Pkg

julia> Pkg.add(PackageSpec(url="https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl"))
   Cloning git-repo `https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl`
  Updating git-repo `https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl`
  Updating git-repo `https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl`
 Resolving package versions...
   Cloning default registries into `C:\Users\PetrKrysl\.julia`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
     Added registry `General` to `C:\Users\PetrKrysl\.julia\registries\General`
 Installed Missings ──────────────────── v0.4.3
 Installed DimensionalPlotRecipes ────── v0.2.0
 Installed Inflate ───────────────────── v0.1.1
 Installed NLsolve ───────────────────── v4.1.0
 Installed ArrayInterface ────────────── v1.2.1
 Installed DelayDiffEq ───────────────── v5.16.0
 Installed DiffEqCallbacks ───────────── v2.8.0
 Installed StaticArrays ──────────────── v0.11.0
 Installed GenericSVD ────────────────── v0.2.2
 Installed Compat ────────────────────── v2.1.0
 Installed ExponentialUtilities ──────── v1.5.1
 Installed Calculus ──────────────────── v0.5.0
 Installed SortingAlgorithms ─────────── v0.3.1
 Installed LineSearches ──────────────── v7.0.1
 Installed MacroTools ────────────────── v0.5.1
 Installed SparseDiffTools ───────────── v0.9.1
 Installed Requires ──────────────────── v0.5.2
 Installed TreeViews ─────────────────── v0.3.0
 Installed BlockBandedMatrices ───────── v0.5.1
 Installed ArnoldiMethod ─────────────── v0.0.4
 Installed NLSolversBase ─────────────── v7.5.0
 Installed CommonSubexpressions ──────── v0.2.0
 Installed RecursiveFactorization ────── v0.1.0
 Installed DiffEqJump ────────────────── v6.2.2
 Installed Reexport ──────────────────── v0.2.0
 Installed IteratorInterfaceExtensions ─ v1.0.0
 Installed PoissonRandom ─────────────── v0.4.0
 Installed BoundaryValueDiffEq ───────── v2.3.0
 Installed Arpack ────────────────────── v0.3.1
 Installed BinaryProvider ────────────── v0.5.6
 Installed DiffEqBase ────────────────── v6.3.3
 Installed FillArrays ────────────────── v0.7.2
 Installed VertexSafeGraphs ──────────── v0.1.0
 Installed NaNMath ───────────────────── v0.3.2
 Installed DiffRules ─────────────────── v0.0.10
 Installed MatrixFactorizations ──────── v0.2.0
 Installed LazyArrays ────────────────── v0.12.1
 Installed ResettableStacks ──────────── v0.6.0
 Installed StatsBase ─────────────────── v0.32.0
 Installed FinEtools ─────────────────── v3.0.1
 Installed Parsers ───────────────────── v0.3.7
 Installed Parameters ────────────────── v0.12.0
 Installed TableTraits ───────────────── v1.0.0
 Installed StochasticDiffEq ──────────── v6.11.2
 Installed RecipesBase ───────────────── v0.7.0
 Installed RandomNumbers ─────────────── v1.3.0
 Installed IterativeSolvers ──────────── v0.8.1
 Installed Distances ─────────────────── v0.8.2
 Installed DiffEqDiffTools ───────────── v1.3.0
 Installed Tokenize ──────────────────── v0.5.6
 Installed URIParser ─────────────────── v0.4.0
 Installed BinDeps ───────────────────── v0.8.10
 Installed OrdinaryDiffEq ────────────── v5.17.2
 Installed DifferentialEquations ─────── v6.8.0
 Installed OrderedCollections ────────── v1.1.0
 Installed JSON ──────────────────────── v0.21.0
 Installed Sundials ──────────────────── v3.7.0
 Installed BlockArrays ───────────────── v0.10.0
 Installed RecursiveArrayTools ───────── v1.0.2
 Installed CSTParser ─────────────────── v0.6.2
 Installed BandedMatrices ────────────── v0.12.2
 Installed SpecialFunctions ──────────── v0.8.0
 Installed DataStructures ────────────── v0.17.1
 Installed MuladdMacro ───────────────── v0.2.1
 Installed LightGraphs ───────────────── v1.3.0
 Installed DiffEqPhysics ─────────────── v3.2.0
 Installed SimpleTraits ──────────────── v0.9.1
 Installed MultiScaleArrays ──────────── v1.5.0
 Installed SteadyStateDiffEq ─────────── v1.5.0
 Installed ForwardDiff ───────────────── v0.10.3
 Installed DiffResults ───────────────── v0.0.4
 Installed DiffEqNoiseProcess ────────── v3.3.1
 Installed Roots ─────────────────────── v0.8.3
 Installed FunctionWrappers ──────────── v1.0.0
 Installed DiffEqFinancial ───────────── v2.2.1
 Installed BenchmarkTools ────────────── v0.4.3
 Installed DocStringExtensions ───────── v0.8.0
 Installed Adapt ─────────────────────── v1.0.0
 Installed DataAPI ───────────────────── v1.1.0
  Updating `C:\Users\PetrKrysl\.julia\environments\v1.2\Project.toml`
  [972d1c22] + FinEtoolsHeatDiff v0.1.0 #master (https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl)
  Updating `C:\Users\PetrKrysl\.julia\environments\v1.2\Manifest.toml`
  [79e6a3ab] + Adapt v1.0.0
  [ec485272] + ArnoldiMethod v0.0.4
  [7d9fca2a] + Arpack v0.3.1
  [4fba245c] + ArrayInterface v1.2.1
  [aae01518] + BandedMatrices v0.12.2
  [6e4b80f9] + BenchmarkTools v0.4.3
  [9e28174c] + BinDeps v0.8.10
  [b99e7846] + BinaryProvider v0.5.6
  [8e7c35d0] + BlockArrays v0.10.0
  [ffab5731] + BlockBandedMatrices v0.5.1
  [764a87c0] + BoundaryValueDiffEq v2.3.0
  [00ebfdb7] + CSTParser v0.6.2
  [49dc2e85] + Calculus v0.5.0
  [bbf7d656] + CommonSubexpressions v0.2.0
  [34da2185] + Compat v2.1.0
  [9a962f9c] + DataAPI v1.1.0
  [864edb3b] + DataStructures v0.17.1
  [bcd4f6db] + DelayDiffEq v5.16.0
  [2b5f629d] + DiffEqBase v6.3.3
  [459566f4] + DiffEqCallbacks v2.8.0
  [01453d9d] + DiffEqDiffTools v1.3.0
  [5a0ffddc] + DiffEqFinancial v2.2.1
  [c894b116] + DiffEqJump v6.2.2
  [77a26b50] + DiffEqNoiseProcess v3.3.1
  [055956cb] + DiffEqPhysics v3.2.0
  [163ba53b] + DiffResults v0.0.4
  [b552c78f] + DiffRules v0.0.10
  [0c46a032] + DifferentialEquations v6.8.0
  [c619ae07] + DimensionalPlotRecipes v0.2.0
  [b4f34e82] + Distances v0.8.2
  [ffbed154] + DocStringExtensions v0.8.0
  [d4d017d3] + ExponentialUtilities v1.5.1
  [1a297f60] + FillArrays v0.7.2
  [91bb5406] + FinEtools v3.0.1
  [972d1c22] + FinEtoolsHeatDiff v0.1.0 #master (https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl)
  [f6369f11] + ForwardDiff v0.10.3
  [069b7b12] + FunctionWrappers v1.0.0
  [01680d73] + GenericSVD v0.2.2
  [d25df0c9] + Inflate v0.1.1
  [42fd0dbc] + IterativeSolvers v0.8.1
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [682c06a0] + JSON v0.21.0
  [5078a376] + LazyArrays v0.12.1
  [093fc24a] + LightGraphs v1.3.0
  [d3d80556] + LineSearches v7.0.1
  [1914dd2f] + MacroTools v0.5.1
  [a3b82374] + MatrixFactorizations v0.2.0
  [e1d29d7a] + Missings v0.4.3
  [46d2c3a1] + MuladdMacro v0.2.1
  [f9640e96] + MultiScaleArrays v1.5.0
  [d41bc354] + NLSolversBase v7.5.0
  [2774e3e8] + NLsolve v4.1.0
  [77ba4419] + NaNMath v0.3.2
  [bac558e1] + OrderedCollections v1.1.0
  [1dea7af3] + OrdinaryDiffEq v5.17.2
  [d96e819e] + Parameters v0.12.0
  [69de0a69] + Parsers v0.3.7
  [e409e4f3] + PoissonRandom v0.4.0
  [e6cf234a] + RandomNumbers v1.3.0
  [3cdcf5f2] + RecipesBase v0.7.0
  [731186ca] + RecursiveArrayTools v1.0.2
  [f2c3362d] + RecursiveFactorization v0.1.0
  [189a3867] + Reexport v0.2.0
  [ae029012] + Requires v0.5.2
  [ae5879a3] + ResettableStacks v0.6.0
  [f2b01f46] + Roots v0.8.3
  [699a6c99] + SimpleTraits v0.9.1
  [a2af1166] + SortingAlgorithms v0.3.1
  [47a9eef4] + SparseDiffTools v0.9.1
  [276daf66] + SpecialFunctions v0.8.0
  [90137ffa] + StaticArrays v0.11.0
  [2913bbd2] + StatsBase v0.32.0
  [9672c7b4] + SteadyStateDiffEq v1.5.0
  [789caeaf] + StochasticDiffEq v6.11.2
  [c3572dad] + Sundials v3.7.0
  [3783bdb8] + TableTraits v1.0.0
  [0796e94c] + Tokenize v0.5.6
  [a2a6695c] + TreeViews v0.3.0
  [30578b45] + URIParser v0.4.0
  [19fa3120] + VertexSafeGraphs v0.1.0
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8bb1440f] + DelimitedFiles
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [9abbd945] + Profile
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [1a1011a3] + SharedArrays
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [4607b0f0] + SuiteSparse
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  Building Arpack ──────────→ `C:\Users\PetrKrysl\.julia\packages\Arpack\cu5By\deps\build.log`
  Building Sundials ────────→ `C:\Users\PetrKrysl\.julia\packages\Sundials\CRi5j\deps\build.log`
  Building SpecialFunctions → `C:\Users\PetrKrysl\.julia\packages\SpecialFunctions\ne2iw\deps\build.log`

julia> Pkg.activate("FinEtoolsHeatDiff")
Activating new environment at `C:\Users\PetrKrysl\FinEtoolsHeatDiff\Project.toml`

julia> Pkg.instantiate()
  Updating registry at `C:\Users\PetrKrysl\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...

```

I have added a package as `Pkg.add(PackageSpec(url="https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl"))`. Now I want to activate its environment so I say `Pkg.activate("FinEtoolsHeatDiff")`. Unfortunately, that seems to do “Activating new environment at `C:\Users\PetrKrysl\FinEtoolsHeatDiff\Project.toml`”, but there is no such folder and no such project. Somehow I need to be able to refer to the package I added (and which lives now in `C:\Users\PetrKrysl\.julia\packages\FinEtoolsHeatDiff`).

This whole thing works fine with a `dev`ed package in a local folder. That is what I have been doing this whole time. But now I had the idea of `add`ing the package, and activation doesn’t work anymore. Is there a solution?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 4, 2019, 6:01pm UTC](https://discourse.julialang.org/t/how-does-one-activate-the-environment-of-an-added-package/29478/2 "2019-10-04T18:01:49Z")

</div>

I’ve tried specifying the package path as  
/c/Users/PetrKrysl/.julia/packages/FinEtoolsHeatDiff/  
or  
/c/Users/PetrKrysl/.julia/packages/FinEtoolsHeatDiff/08kpy/  
(because that’s where the Project and Manifest files actually live).  
Neither one worked.

---

<div class="post-metadata">

**Author:** ![sostock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sostock/32/5546_2.png) [@sostock](https://discourse.julialang.org/u/sostock)\
**Post date:** [October 4, 2019, 8:25pm UTC](https://discourse.julialang.org/t/how-does-one-activate-the-environment-of-an-added-package/29478/3 "2019-10-04T20:25:53Z")

</div>

I think only `dev`ed packages can be `activate`d. But you should be able to `dev` the package cloned from github instead of using the local folder, just use `dev` instead of `add`:

```julia
pkg> dev https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl
pkg> activate FinEtoolsHeatDiff

```

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 5, 2019, 5:37am UTC](https://discourse.julialang.org/t/how-does-one-activate-the-environment-of-an-added-package/29478/4 "2019-10-05T05:37:52Z")

</div>

Excellent. That worked. I believe it actually makes sense for it to work with “develop” since “add” creates those subfolders…
