3

I have downloaded Julia-1.1.0 (from here), then I executed the binary file (julia-1.1.0/bin/julia) and in the prompt I type

using Pkg

Julia returns:

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

if I type Pkg.add("Pkg"), julia returns

ERROR: UndefVarError: Pkg not defined

How can I get Pkg to wotk?

Sorry for my english.

Antonio Ramírez
  • 174
  • 1
  • 2
  • 10
  • 1
    Have you tried Julia's new package system by typing [`]`](https://julialang.github.io/Pkg.jl/v1/getting-started/) at the prompt? There's lots, probably most, of documentation that still refers to the old package system. – rickhg12hs Mar 03 '19 at 23:56
  • What is your OS? Have you installed a very old version of julia before? Could you try the solution here? https://github.com/JuliaLang/julia/issues/27359#issuecomment-395278485 Other reasons for the issue might be you do not have the necessary privileges to read/write to or to create the `.julia` directory. – hckr Mar 04 '19 at 07:25
  • You should be able to do `using Pkg` on 1.1. Try hckr's solution – Michael K. Borregaard Mar 04 '19 at 12:53
  • I type " ] " in the prompt, and when it changed to "(v1.1) pkg>" I wrote "add IJulia", and julia returned " Cloning registry from "https://github.com/JuliaRegistries/General.git" ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ECERTIFICATE, Class:SSL, the SSL certificate is invalid: 0x08 - The certificate is not correctly signed by the trusted CA)". Julia returns the same error with others packages. – Antonio Ramírez Mar 05 '19 at 02:55
  • Your problems seem to show that you are using Julia on some non-standard configuration of OS. Have you tried using the advice from https://stackoverflow.com/questions/45489105/julia-certificate-error? – Bogumił Kamiński Mar 05 '19 at 18:54

1 Answers1

1

In the comments to this question a SSL certificate error was mentioned. A solution on Linux (Ubuntu in my case) is to specify the location of the ssl certificates in the following manner;


julia> using LibGit2

julia> LibGit2.set_ssl_cert_locations("/etc/ssl/certs/ca-certificates.crt")

Thomas Dickson
  • 313
  • 3
  • 9