# WARNING: Base.Pkg is deprecated in 0.7 release

**URL:** <https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038>\
**Category:** General Usage\
**Created:** [August 8, 2018, 12:49pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038 "2018-08-08T12:49:12Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![gideonsimpson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gideonsimpson/32/1928_2.png) [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Post date:** [August 8, 2018, 12:49pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/1 "2018-08-08T12:49:12Z")

</div>

I just installed the released 0.7 on MacOS, and whenever I try to install packages, I see the message:

```julia
julia> Pkg.add("IJulia")
WARNING: Base.Pkg is deprecated, run `using Pkg` instead
 in module Main

```

Is this simply one of the deprecations I’ll need to deal with before upgrading to 1.0, or is something “wrong” with my installation?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 8, 2018, 12:50pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/2 "2018-08-08T12:50:12Z")

</div>

This is the old interface. Press `]`, then

```julia
pkg> add IJulia

```

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [August 8, 2018, 12:55pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/3 "2018-08-08T12:55:15Z")

</div>

Note that that is just complaining about the implicit import from `Base`. If you do `using Pkg` first, then `Pkg.add` will work as before (but use the new package manager). See [- YouTube](https://www.youtube.com/watch?v=GBi__3nF-rM) for more.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [August 8, 2018, 1:09pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/4 "2018-08-08T13:09:38Z")

</div>

How do I cd to the directory of a package in 0.7? `cd(Pkg.dir(...))` is deprecated it seems.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 8, 2018, 1:21pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/5 "2018-08-08T13:21:54Z")

</div>

[https://github.com/JuliaLang/Pkg.jl/issues/417](https://github.com/JuliaLang/Pkg.jl/issues/417)

TL;DR:

1. you may not need it in most cases any more,
2. use `@ __DIR__ ` in your module,
3. `Base.pathof(::Module)` if you really need it.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [August 8, 2018, 1:26pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/6 "2018-08-08T13:26:38Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [August 8, 2018, 2:15pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/7 "2018-08-08T14:15:05Z")

</div>

Wait so what do I do when I want to open up Julia and make a change to a package? Normally i would do

```julia
cd(Pkg.dir("MyPackage"))
using Revise
using MyPackage
edit("MyPackage.jl")
... make edits 

```

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [August 8, 2018, 2:17pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/8 "2018-08-08T14:17:27Z")

</div>

you type `dev MyPackage` into the Pkg repl and it’ll get you a git clone of it into `~/.julia/dev/MyPackage`. In particular, you should no longer edit packages in situ without `dev`ing them first, because the package manager is in charge of non-dev packages.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [August 8, 2018, 2:18pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/9 "2018-08-08T14:18:34Z")

</div>

It will change my directory to the right place, then?

Thanks that’s exactly what I needed.

---

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [August 8, 2018, 3:06pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/10 "2018-08-08T15:06:35Z")

</div>

How to get out of this state ( `pkg>` ) on REPL?  
And how to add a package in Jupyter with Julia v. 0.7?

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [August 8, 2018, 3:08pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/11 "2018-08-08T15:08:28Z")

</div>

> How to get out of this state ( `pkg>` ) on REPL?

Backspace

> And how to add a package in Jupyter with Julia v. 0.7?

You can still use the `Pkg.add` API (after a `using Pkg`). And there’s also a `pkg""` string macro to execute Pkg REPL commands programatically.

---

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [August 8, 2018, 3:24pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/12 "2018-08-08T15:24:40Z")

</div>

In Jupyter I tried:

```julia
using Pkg
Pkg.add("Gadfly")
using Gadfly

```

And I got the following errors:

```julia
 ┌ Info: Precompiling Gadfly [c91e804a-d5a3-530f-b6f0-dfbca275c004]
└ @ Base loading.jl:1187
┌ Warning: Deprecated syntax `try without catch or finally` at /Users/sergiobacelar/.julia/packages/Gadfly/ojGNo/src/Gadfly.jl:971.
└ @ ~/.julia/packages/Gadfly/ojGNo/src/Gadfly.jl:971
┌ Warning: Deprecated syntax `try without catch or finally` at /Users/sergiobacelar/.julia/packages/Gadfly/ojGNo/src/Gadfly.jl:980.
└ @ ~/.julia/packages/Gadfly/ojGNo/src/Gadfly.jl:980
┌ Warning: Deprecated syntax `try without catch or finally` at /Users/sergiobacelar/.julia/packages/Compose/8DJMJ/src/Compose.jl:207.
└ @ ~/.julia/packages/Compose/8DJMJ/src/Compose.jl:207
WARNING: importing deprecated binding Base.Nullable into Compose.
ERROR: LoadError: LoadError: TypeError: in Type{...} expression, expected UnionAll, got typeof(Base.Nullable)
Stacktrace:
 [1] top-level scope at none:0
 [2] include at ./boot.jl:317 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1038
 [4] include at ./sysimg.jl:29 [inlined]
 [5] include(::String) at /Users/sergiobacelar/.julia/packages/Compose/8DJMJ/src/Compose.jl:3
 [6] top-level scope at none:0
 [7] include at ./boot.jl:317 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1038
 [9] include(::Module, ::String) at ./sysimg.jl:29
 [10] top-level scope at none:2
 [11] eval at ./boot.jl:319 [inlined]
 [12] eval(::Expr) at ./client.jl:399
 [13] top-level scope at ./none:3
in expression starting at /Users/sergiobacelar/.julia/packages/Compose/8DJMJ/src/measure.jl:133
in expression starting at /Users/sergiobacelar/.julia/packages/Compose/8DJMJ/src/Compose.jl:69
ERROR: LoadError: Failed to precompile Compose [a81c6b42-2e10-5240-aca2-a61377ecd94b] to /Users/sergiobacelar/.julia/compiled/v0.7/Compose/sbiEw.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:313 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1185
 [4] _require(::Base.PkgId) at ./logging.jl:311
 [5] require(::Base.PkgId) at ./loading.jl:852
 [6] macro expansion at ./logging.jl:311 [inlined]
 [7] require(::Module, ::Symbol) at ./loading.jl:834
 [8] include at ./boot.jl:317 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1038
 [10] include(::Module, ::String) at ./sysimg.jl:29
 [11] top-level scope at none:2
 [12] eval at ./boot.jl:319 [inlined]
 [13] eval(::Expr) at ./client.jl:399
 [14] top-level scope at ./none:3
in expression starting at /Users/sergiobacelar/.julia/packages/Gadfly/ojGNo/src/Gadfly.jl:7
Failed to precompile Gadfly [c91e804a-d5a3-530f-b6f0-dfbca275c004] to /Users/sergiobacelar/.julia/compiled/v0.7/Gadfly/DvECm.ji.

Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:313 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1185
 [4] macro expansion at ./logging.jl:311 [inlined]
 [5] _require(::Base.PkgId) at ./loading.jl:941
 [6] require(::Base.PkgId) at ./loading.jl:852
 [7] macro expansion at ./logging.jl:311 [inlined]
 [8] require(::Module, ::Symbol) at ./loading.jl:834

```

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [August 8, 2018, 3:27pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/13 "2018-08-08T15:27:22Z")

</div>

Well, you installed Gadfly successfully, it’s just not updated for 0.7 yet.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [August 8, 2018, 4:14pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/14 "2018-08-08T16:14:19Z")

</div>

I can’t add any packages…

```nohighlight
   _ _ _(_)_ | A fresh approach to technical computing
  (_) | (_) (_) | Documentation: https://docs.julialang.org
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 0.7.0 (2018-08-08 06:46 UTC)
 _/ |\ __'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu

pkg> add PyPlot
ERROR: no active project
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] find_project_file(::Nothing) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Types.jl:243
 [3] Pkg.Types.EnvCache(::Nothing) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Types.jl:285 (repeats 2 times)
 [4] Type at ./none:0 [inlined]
 [5] Context!(::Array{Pair{Symbol,Any},1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/Types.jl:367
 [6] Context! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:497 [inlined]
 [7] do_add!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:633
 [8] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:691
 [9] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:690
 [10] do_cmd!(::Pkg.REPLMode.PkgCommand, ::REPL.LineEditREPL) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:542
 [11] #do_cmd#30(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:507
 [12] do_cmd at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:503 [inlined]
 [13] (::getfield(Pkg.REPLMode, Symbol("##41#44")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:842
 [14] #invokelatest#1 at ./essentials.jl:691 [inlined]
 [15] invokelatest at ./essentials.jl:690 [inlined]
 [16] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/REPL/src/LineEdit.jl:2261
 [17] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:1029
 [18] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:191
 [19] (::getfield(Base, Symbol("##831#833")){Bool,Bool,Bool,Bool})(::Module) at ./logging.jl:311
 [20] #invokelatest#1 at ./essentials.jl:691 [inlined]
 [21] invokelatest at ./essentials.jl:690 [inlined]
 [22] macro expansion at ./logging.jl:308 [inlined]
 [23] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:340
 [24] exec_options(::Base.JLOptions) at ./client.jl:252
 [25] _start() at ./client.jl:432

```

---

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [August 8, 2018, 4:34pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/15 "2018-08-08T16:34:32Z")

</div>

The same command worked for me in MacOS `x86_64-apple-darwin14.5.0`.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [August 8, 2018, 4:40pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/16 "2018-08-08T16:40:26Z")

</div>

You seem to have messed with `DEPOT_PATH` and/or `LOAD_PATH`. Whats the values of those?

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [August 8, 2018, 5:06pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/17 "2018-08-08T17:06:54Z")

</div>

JULIA\_LOAD\_PATH=.

i.e. set to the current directory.

edit: DEPOT\_PATH is not set.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [August 8, 2018, 6:10pm UTC](https://discourse.julialang.org/t/warning-base-pkg-is-deprecated-in-0-7-release/13038/18 "2018-08-08T18:10:07Z")

</div>

Okay. You either need to `pkg> activate` to get an environment, or instead append `LOAD_PATH` instead, i.e. `JULIA_LOAD_PATH=.:` (I think).
