About "WARNING" in v0.7

question

#1

I use Julia-0.7.0-rc2 and get follow:

julia> Matrix{Float64}(I,5,6)
WARNING: Base.I is deprecated, run `using LinearAlgebra` to load linear algebra functionality.
 in module Main
5×6 Array{Float64,2}:
 1.0  0.0  0.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0  0.0  0.0
 0.0  0.0  1.0  0.0  0.0  0.0
 0.0  0.0  0.0  1.0  0.0  0.0
 0.0  0.0  0.0  0.0  1.0  0.0

julia>

What should be done to avoid similar warnings in the future?


#2

The suggestion is in the warning message.


#3

What I don’t understand is, why the warning only goes away if one restarts julia. Just doing what the warning message says doesn’t help in the same session.

julia> Matrix{Float64}(I,5,6)
WARNING: Base.I is deprecated, run `using LinearAlgebra` to load linear algebra functionality.
 in module Main
5×6 Array{Float64,2}:
 1.0  0.0  0.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0  0.0  0.0
 0.0  0.0  1.0  0.0  0.0  0.0
 0.0  0.0  0.0  1.0  0.0  0.0
 0.0  0.0  0.0  0.0  1.0  0.0

julia> using LinearAlgebra

julia> Matrix{Float64}(I,5,6)
WARNING: Base.I is deprecated, run `using LinearAlgebra` to load linear algebra functionality.
 in module Main
5×6 Array{Float64,2}:
 1.0  0.0  0.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0  0.0  0.0
 0.0  0.0  1.0  0.0  0.0  0.0
 0.0  0.0  0.0  1.0  0.0  0.0
 0.0  0.0  0.0  0.0  1.0  0.0

julia>
chappi@Treebook:~$ juliam
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |  [edit: `]
  | | |_| | | | (_| |  |  Version 1.0.0-DEV.53 (2018-08-06 16:03 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit e3bc48dba9 (0 days old master)
|__/                   |  x86_64-apple-darwin17.6.0

julia> using LinearAlgebra

julia> Matrix{Float64}(I,5,6)
5×6 Array{Float64,2}:
 1.0  0.0  0.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0  0.0  0.0
 0.0  0.0  1.0  0.0  0.0  0.0
 0.0  0.0  0.0  1.0  0.0  0.0
 0.0  0.0  0.0  0.0  1.0  0.0

(It’s in 1.0.0-DEV, but the same happened in 0.7)


#4

In short, the binding has already been “poisoned” by the deprecation warning and will keep referring to the deprecated binding.


Julia 0.7 pemanently call to use modules
#5

Ok, but here’s the next problem:

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-rc2.0 (2018-08-02 19:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-w64-mingw32

julia> using LinearAlgebra
ERROR: ArgumentError: Package LinearAlgebra not found in current path:
- Run `Pkg.add("LinearAlgebra")` to install the LinearAlgebra package.

Stacktrace:
 [1] require(::Module, ::Symbol) at .\loading.jl:817

julia>

I use Windows 8.1 - 64b and I’m not an administrator.


#6

That’s weird, since LinearAlgebra is a standard library that ships with Julia.


#7

Could you show what is in LOAD_PATH.


#8
julia> LOAD_PATH
2-element Array{String,1}:
 "C:\\junowork"
 "C:\\jupyterwork"

julia>

#9

Ok, that explains it. Try push! those paths to LOAD_PATH and not empty it first.


#10

I’m sorry I did not understand. What should I do?

Specify the path to the stdlib folder in the startup.jl file?

push! (LOAD_PATH, "C:\\Julia-0.7.0-rc2\\share\\julia\\stdlib\\v0.7")

#11

What are you doing currently? How is the LOAD_PATH set?


#12

You are clobbering (emptying) the LOAD_PATH somehow, probably in startup.jl


#13

Kristoffer! My startup.jl is empty!

Hi Stefan!
I have a user’s environment variable:

JULIA_LOAD_PATH=C:\junowork;C:\jupyterwork

#14

I believe you have to write

JULIA_LOAD_PATH=C:\junowork;C:\jupyterwork;$JULIA_LOAD_PATH
#or?
#JULIA_LOAD_PATH=C:\junowork;C:\jupyterwork;%JULIA_LOAD_PATH%

Otherwise - maybe better - leave JULIA_LOAD_PATH alone and put

push!(LOAD_PATH, "C:\\junowork")
push!(LOAD_PATH, "C:\\jupyterwork")

into startup.jl.


#15

If there is an empty entry in LOAD_PATH it is replaced with the default load path which is what you want here.


#16

I seem to have solved the problem, with your help.
I need to delete the user environment variable JULIA_LOAD_PATH, but I’m not a system administrator. I will look for it :slight_smile:

Small session in cmd.exe:

C:\Users\bobrov.ae>set JULIA_LOAD_PATH=

C:\Users\bobrov.ae>C:\Julia-0.7.0-rc2\bin\julia.exe
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-rc2.0 (2018-08-02 19:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-w64-mingw32

julia> LOAD_PATH
3-element Array{String,1}:
 "@"
 "@v#.#"
 "@stdlib"

julia> using LinearAlgebra

julia> Matrix{Float64}(I,6,7)
6×7 Array{Float64,2}:
 1.0  0.0  0.0  0.0  0.0  0.0  0.0
 0.0  1.0  0.0  0.0  0.0  0.0  0.0
 0.0  0.0  1.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  1.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  1.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0  1.0  0.0

Julia>