I am starting with Makie. I installed Makie and CairoMakie; the editor is VSCode
I am trying to run the following example, taken from the juliaplots.org website:
using Makie
x = rand(10)
y = rand(10)
colors = rand(10)
scene = scatter(x, y, color = colors)
Whatever I try, I get the following warning + error:
Warning: Error requiring `StaticArrays` from `ArrayInterface`
│ exception =
│ too many parameters for type
I am using Julia 1.6.2.
I tried your suggestion, without success. using Makie, CairoMakie or using both.
Removed until I had only Makie or CairoMakie. Not working.
I forgot to mention I am running VSCode on a Mac.
it could very well be that some of the other packages are holding up the version update.
Just to verify, did you restart julia after installing the new CairoMakie ?
Try installing CairoMakie into a new environment, e.g. :
using Pkg
Pkg.activate(; temp=true)
Pkg.add("CairoMakie")
using CairoMakie
scatter(rand(10), rand(10), color=rand(10))
(Julia) pkg> add Makie@v0.15.2
Updating registry at ~/.julia/registries/General
Resolving package versions…
ERROR: Unsatisfiable requirements detected for package PlotUtils [995b91a9]:
PlotUtils [995b91a9] log:
├─possible versions are: 0.5.0-1.0.13 or uninstalled
├─restricted by compatibility requirements with Makie [ee78f7c6] to versions: 1.0.0-1.0.13
│ └─Makie [ee78f7c6] log:
│ ├─possible versions are: 0.9.0-0.15.2 or uninstalled
│ └─restricted to versions 0.15.2 by an explicit requirement, leaving only versions 0.15.2
└─restricted by compatibility requirements with Plots [91a5bcdd] to versions: 0.5.0-0.6.5 — no versions left
└─Plots [91a5bcdd] log:
├─possible versions are: 0.12.1-1.21.2 or uninstalled
├─restricted by compatibility requirements with StatPlots [60ddc479] to versions: 0.14.0-0.29.9
│ └─StatPlots [60ddc479] log:
│ ├─possible versions are: 0.8.0-0.9.2 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.8.0-0.9.2
└─restricted by compatibility requirements with FixedPointNumbers [53c48c17] to versions: 0.25.0-1.21.2 or uninstalled, leaving only versions: 0.25.0-0.29.9
└─FixedPointNumbers [53c48c17] log:
├─possible versions are: 0.5.0-0.8.4 or uninstalled
└─restricted by compatibility requirements with Makie [ee78f7c6] to versions: 0.6.0-0.8.4
└─Makie [ee78f7c6] log: see above
julia> using Plots
julia> using PlotUtils
ERROR: ArgumentError: Package PlotUtils not found in current path:
- Run `import Pkg; Pkg.add("PlotUtils")` to install the PlotUtils package.
Can I clean the apparent mess by reinstalling Julia? Does that help for the toml files?
Earlier, I installed Jupyter for working with Julia (required MiniConda). Maybe the PATH has something to do with it
You have a lot of different plotting packages in the same environment that share a dependency (PlotUtils). Since only one version of a dependency can be loaded at any given time, a common state is found by downgrading versions until they’re compatible. This may not give you the most recent version of packages and the fact that a lot of packages don’t want to commit to a 1.x doesn’t help here.
If you’re just trying out plotting packages, I’d recommend familiarizing yourself with Pkg environments to seperate experimentation and different projects.
There’s no need to reinstall julia. It’s just a package environment that has old versions due to dependency management.
No, the PATH is not touched by julia. Julia usually handles those packages (and especially python dependencies) in a seperate environment, to make sure they don’t mess with the system version (unless you explicitly ask for the system version to be used).
Thanks. I was indeed checking capabilities and ease of use of plotting packages. I am coming from R and I am quite impressed with Julia.
I will use the environments in the future for testing purposes.
I will remove all plotting packages besides Plots and CairoMakie. See if I can install Makie 0.15.2
Just to be sure don’t just use environments for testing purposes, but use them for everything - when you start some new project give it it’s own folder, ] activate an environment in that folder, and add the packages you need. Then when you go back to that project in a few weeks/months/years time, the Project.toml and Manifest.toml files will still be there to ensure your code still runs, and isn’t broken because of some package updates that happened in the meantime. Having this built into the language and so easily accessible is one of the big benefits of Julia imho.
Yes exactly. It will also prevent cross-contamination of dependencies from happening between different projects of yours.
Think like this: Project A requires some package B at version 0.3, which requires Package C at version <=0.2. Project A1 requires package B at version 0.4, which requires Package C at version >1. If you have two environments, one for Project A and one for A1, you can work in them seperately and they won’t interfere. If, however, you use the same environment for both of them, things won’t work for one of the two projects because you can’t have both C@v1 and C@v0.2 active at the same time.
if StaticArrays.SizedArray{Tuple{8,8},Float64,2,2} isa UnionAll
@inline strides(B::StaticArrays.SizedArray{S,T,M,N,A}) where {S,T,M,N,A<:SubArray} = strides(B.data)
parent_type(::Type{<:StaticArrays.SizedArray{S,T,M,N,A}}) where {S,T,M,N,A} = A
else
parent_type(::Type{<:StaticArrays.SizedArray{S,T,M,N}}) where {S,T,M,N} =
Array{T,N}
end
and used to work with StaticArrays 0.12.5.
So I’d like to have some idea of whether this check is now failing for some reason, or whether some code has been added since then that is incompatible with StaticArrays 0.12.5.
I think we should have one last version of ArrayInterface using StaticArrays 0.12.5, and then drop support for it in the next version to avoid problems like this.
I don’t know how to help here. Just started with Julia. My problem was solved by removing packages that prevented updating Makie and CairoMakie. Versions having the issue are: Makie 0.10.0 and CairoMakie 0.2.4