Unable to add any packages

Dear all

I have a problem with Julia,
I had to stop working on my project in Julia for a while,
The last time (around 2 weeks ago, everything worked well)
but yesterday when I got back to my work and opened Julia, I could not add any packages,
I tried all possible ways on the internet, but it was not solved,
I tried to update Julia and it is up to date,
I uninstall it (manually) and download and install it again,
not solved,
I tried to uninstall using the terminal but:

% juliaup self uninstall
Do you really want to uninstall Julia? yes
Removing background self update task. Success.
Removing startup self update configuration. Success.
Removing PATH modifications in startup scripts.Well, this is embarrassing.

Juliaup had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/var/folders/_8/lh026mfn3cq8301kvl5ptwj40000gn/T/report-fae45a8b-4d81-4922-99d5-56b5161faddf.toml". Submit an issue or email with the subject of "Juliaup Crash Report" and include the report as an attachment.

- Homepage: https://github.com/JuliaLang/juliaup

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!

When I want to install any package, I receive the following error:

julia> import Pkg; Pkg.add("LinearAlgebra")
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CUDA [052768ef]:
 CUDA [052768ef] log:
 ├─possible versions are: 0.1.0-5.3.0 or uninstalled
 ├─restricted by julia compatibility requirements to versions: [2.3.0, 2.5.0-5.3.0] or uninstalled
 ├─restricted by compatibility requirements with GPUCompiler [61eb1bfa] to versions: 5.0.0-5.3.0 or uninstalled
 │ └─GPUCompiler [61eb1bfa] log:
 │   ├─possible versions are: 0.1.0-0.26.4 or uninstalled
 │   └─restricted by julia compatibility requirements to versions: 0.22.0-0.26.4 or uninstalled
 └─restricted by compatibility requirements with Flux [587475ba] to versions: 3.0.0-4.4.2 — no versions left
   └─Flux [587475ba] log:
     ├─possible versions are: 0.4.1-0.14.15 or uninstalled
     └─restricted by compatibility requirements with AutomationLabsModelPredictiveControl [731a2950] to versions: 0.13.0-0.13.17
       └─AutomationLabsModelPredictiveControl [731a2950] log:
         ├─possible versions are: 0.1.0-0.1.4 or uninstalled
         └─restricted to versions * by an explicit requirement, leaving only versions: 0.1.0-0.1.4
Stacktrace:
  [1] propagate_constraints!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; log_events::Bool)
    @ Pkg.Resolve /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Resolve/graphtype.jl:1072
  [2] propagate_constraints! (repeats 2 times)
    @ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Resolve/graphtype.jl:1008 [inlined]
  [3] simplify_graph!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; clean_graph::Bool)
    @ Pkg.Resolve /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Resolve/graphtype.jl:1533
  [4] simplify_graph! (repeats 2 times)
    @ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Resolve/graphtype.jl:1532 [inlined]
  [5] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{…}, pkgs::Vector{…}, julia_version::VersionNumber, installed_only::Bool)
    @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:407
  [6] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{…}, pkgs::Vector{…}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1360
  [7] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{…}, pkgs::Vector{…}, julia_version::VersionNumber, try_all_installed::Bool)
    @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1349
  [8] _resolve(io::Base.TTY, env::Pkg.Types.EnvCache, registries::Vector{…}, pkgs::Vector{…}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1370
  [9] add(ctx::Pkg.Types.Context, pkgs::Vector{…}, new_git::Set{…}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1387
 [10] add
    @ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1376 [inlined]
 [11] add(ctx::Pkg.Types.Context, pkgs::Vector{…}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::@Kwargs{…})
    @ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:278
 [12] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})
    @ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
 [13] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:148
 [14] add
    @ /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
 [15] add(pkg::String)
    @ Pkg.API /Applications/Julia-1.10.app/Contents/Resources/julia/share/julia/stdlib/v1.10/Pkg/src/API.jl:146
 [16] top-level scope
    @ REPL[3]:1
Some type information was truncated. Use `show(err)` to see complete types.```

This seems like an issue with your Project.toml file. Can you share that?

1 Like

Thank you for your reply

this is the code I want to try (Julia’s example)

I received an error because of necessary packages, while I was trying to add them, I received the previous reply err

using ControlSystemsBase
using LinearAlgebra # For identity matrix I
using Plots

# Create system
Ts      = 0.1
A       = [1 Ts; 0 1]
B       = [0; 1]
C       = [1 0]
sys     = ss(A,B,C,0,Ts)

# Design controller
Q       = I # Weighting matrix for state
R       = I # Weighting matrix for input
L       = lqr(Discrete,A,B,Q,R) # lqr(sys,Q,R) can also be used

# Simulation
u(x,t)  = -L*x .+ 1.5(t>=2.5) # Form control law (u is a function of t and x), a constant input disturbance is affecting the system from t≧2.5
t       = 0:Ts:5              # Time vector
x0      = [1,0]               # Initial condition
y, t, x, uout = lsim(sys,u,t,x0=x0)
plot(t,x', lab=["Position" "Velocity"], xlabel="Time [s]")

save_docs_plot("lqrplot.svg"); # hide

Can you share the file Project.toml instead? The problem is not related to the code you try to execute, but to your Julia environment.

It might be in the following folder (or similar):

ufechner@framework:~/.julia/environments/v1.10$ ls
Manifest.toml  Project.toml

You could also try to create a clean environment:

mkdir my_project
cd my_project
julia --project="."

and then add the packages you need…

2 Likes

Thank you very much, the second option helped me and it worked.

I know the problem is coming with the Environment and directories but to be honest,
it is tough for me to follow related training, they are very different, There are so many videos, and the main Julia webpage is very vague to me (maybe to those who have more experience in visual software)

BTW, thanks for your help!