Pkg.add("PyCall") every time?

pycall
#1

I’ve installed both Python (2.7 and 3) & Julia on Ubuntu 18.04 LTS, and I’ve installed the package PyCall by running Pkg.add in the REPL. However, every time I need using PyCall, an ArgumentError pops up and I’m told to import Pkg; .... Is this the expected behaviour?

#2

Could you post the output of the status command here? Type ] to get in pkg> mode, then type status and enter:

tkluck@tkluck-xps:~$ /usr/bin/julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.3
 _/ |\__'_|_|_|\__'_|  |  Ubuntu ⛬  julia/1.0.3+dfsg-4
|__/                   |

(v1.0) pkg> status
    Status `~/.julia/environments/v1.0/Project.toml`
...
Is there a terminal command to upgrade from 1.1.0 to 1.1.1 ?
#3

Thanks for response.

There’s missing PyCall in st, but I remembered having run Pkg.add("PyCall") before, so the package PyCall has been installed under ~/.julia/packages/PyCall/. I’ve tried another package (LinearAlgebra) not present in st, but using LinearAlgebra is fine. That’s seems quite mysterious that I posted here.

julia -q
(v1.1) pkg> st
    Status `~/.julia/environments/v1.1/Project.toml`
  [c52e3926] Atom v0.8.5
  [336ed68f] CSV v0.5.2
  [a93c6f00] DataFrames v0.18.2
  [31c24e10] Distributions v0.19.2
  [38e38edf] GLM v1.1.1
  [cd3eb016] HTTP v0.8.0
  [09f84164] HypothesisTests v0.8.0
  [7073ff75] IJulia v1.18.1
  [916415d5] Images v0.18.0
  [682c06a0] JSON v0.20.0
  [e5e0dc1b] Juno v0.7.0
  [91a5bcdd] Plots v0.24.0
  [d330b81b] PyPlot v2.8.1
  [6f49c342] RCall v0.13.2
  [ce6b1742] RDatasets v0.6.1
  [295af30f] Revise v2.1.4
  [2913bbd2] StatsBase v0.30.0
  [24249f21] SymPy v1.0.3

shell> ls -l ~/.julia/packages/PyCall/
total 8
drwxrwxr-x 6 vin100 vin100 4096 Oct  8  2018 rUul9
drwxr-xr-x 7 vin100 vin100 4096 Apr 24 17:20 ttONZ

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

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:823

julia> using LinearAlgebra

julia> 
#4

LinearAlgebra is standard library.

Every Julia version has its own package environment, including point releases. Is it possible you installed PyCall in, say, v1.0, not in v1.1 ?

(FWIW, I don’t know the reasoning behind that particular choice, I just know that it may be an explanation for what you’re seeing.)

#5

Thanks for your question. :bulb: You’re right about that!

#6

I think that patch releases share the same environment. So, for example, Julia 1.0.3 shares the environment with 1.0.0, 1.0.1, and 1.0.2, but this is different from the 1.1 series.

#7

Yes, I’m using “point release” wrong. Thanks for the correction!