Error: I cannot install package Meshes

Hi, I’m a new user and I have had problems with scripts that use the command Point3f, Point2f and others to generate plots. Well, apparently, the problem is caused by errors in packages installation. I uninstalled the Julia, reinstall, and the problem continue.

So, I ran the update all packages after the Julia installation (Windows 10 64bits as admin). And I discoved the problem: the package Meshes.

Julia version: 1.7.3

julia> Pkg.update()
    Updating registry at `C:\Users\EvSchulz\.julia\registries\General.toml`
   Installed GR_jll ────────── v0.66.0+0
   Installed RecipesPipeline ─ v0.6.1
   Installed Plots ─────────── v1.31.2
   Installed GR ────────────── v0.66.0
  Downloaded artifact: GR
    Updating `C:\Users\EvSchulz\.julia\environments\v1.7\Project.toml`
  [91a5bcdd] ↑ Plots v1.31.1 β‡’ v1.31.2
    Updating `C:\Users\EvSchulz\.julia\environments\v1.7\Manifest.toml`
  [28b8d3ca] ↑ GR v0.64.4 β‡’ v0.66.0
  [91a5bcdd] ↑ Plots v1.31.1 β‡’ v1.31.2
  [01d81517] ↑ RecipesPipeline v0.5.2 β‡’ v0.6.1
  [05181044] ↑ RelocatableFolders v0.1.3 β‡’ v0.3.0
  [d2c73de3] ↑ GR_jll v0.65.1+0 β‡’ v0.66.0+0
    Building GR β†’ `C:\Users\EvSchulz\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\037a1ca47e8a5989cc07d19729567bb71bfabd0c\build.log`
Precompiling project...
  5 dependencies successfully precompiled in 47 seconds (259 already precompiled)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

Well, 1 dependency error occurred with package β€œGR”. After, I ran Pkg.precompile(), to discover the error:

julia> Pkg.precompile()
  0 dependencies successfully precompiled in 2 seconds (264 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

Meshes [eacbb407-ea5a-433e-ab97-5258b1ca43fa]

Error: Missing source file for Meshes [eacbb407-ea5a-433e-ab97-5258b1ca43fa
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types C:\Users\EvSchulz\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API C:\Users\EvSchulz\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:1362
 [3] precompile
   @ C:\Users\EvSchulz\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:1013 [inlined]
 [4] #precompile#220
   @ C:\Users\EvSchulz\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:1011 [inlined]
 [5] precompile()
   @ Pkg.API C:\Users\EvSchulz\AppData\Local\Programs\Julia-1.7.3\share\julia\stdlib\v1.7\Pkg\src\API.jl:1011
 [6] top-level scope
   @ REPL[4]:1

Well, here is the problem: Meshes [eacbb407-ea5a-433e-ab97-5258b1ca43fa]

I’m tried to install the package:

Pkg.add("Meshes")
   Resolving package versions...
  No Changes to `C:\Users\EvSchulz\.julia\environments\v1.7\Project.toml`
  No Changes to `C:\Users\EvSchulz\.julia\environments\v1.7\Manifest.toml`
  0 dependencies successfully precompiled in 2 seconds (264 already precompiled)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

I do not know howI can do to solve it.

I just tried installing Meshes in a clean environment in Julia 1.7.3, Windows 10, and everything worked without issues. I then added Plots, and again everything just worked.

It looks like you’re dumping all of your projects into the default environment (don’t do this, it’s a bad idea), so you might just have some versioning conflict somewhere? Try installing things in a new environment to see if the issue persists.

1 Like

Thanks nilshg. How I can installing in a new environment?

This might help: 4. Working with Environments Β· Pkg.jl

All above comments are missing this detail:

It looks like the directory of the Meshes package is borked. I suggest deleting it (C:\Users\EvSchulz\.julia\packages/Meshes) and trying again

The problem not happen when I install the package in a new environment as @nilshg suggested. Thank you. But I it is stranger. @giordano the problem continue. I tried to install in the Linux, and the same problem occurred. Apparently, we need to work with β€˜environments’ in Julia. But, does I need to install the packages all times that I create a new environment?

Working with environments is good anyway, but it’s orthogonal to the problem of having the source code of the package missing.

1 Like

I always create a new environment for each new project.

mkdir new_project
cd new_project
julia --project="."
]add xxx

You don’t have to, but it makes it possible to use different versions of the same package per project. I often want to use old versions for old projects and new versions for new projects.

1 Like

Note that when you use multiple projects/environments with the same package versions, each unique version of a given package is only installed once in a central Julia-wide depot, so additional environments with the same packages don’t take up more hard drive space.

1 Like