# Packages not found

**URL:** https://discourse.julialang.org/t/packages-not-found/123756
**Category:** New to Julia
**Tags:** package
**Created:** [December 12, 2024, 12:00pm UTC](https://discourse.julialang.org/t/packages-not-found/123756 "2024-12-12T12:00:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![odipus](https://avatars.discourse-cdn.com/v4/letter/o/8e8cbc/32.png) [@odipus](https://discourse.julialang.org/u/odipus)
#### Post date: [December 12, 2024, 12:00pm UTC](https://discourse.julialang.org/t/packages-not-found/123756/1 "2024-12-12T12:00:45Z")

</div>

I have created a docker image

```julia
# Use the official Julia image
FROM julia:1.9
ENV JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"

# # Install Julia dependencies
RUN julia -e "using Pkg; Pkg.add([\"CSV\", \"DataFrames\", \"Dates\", \"CairoMakie\"])"
RUN julia -e "using Pkg; Pkg.precompile();"

CMD ["julia"]

```

When i ssh into the container with this image, I can access all the packages. But when I use non interactive shell, I cant access those packages and I get

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

```

I am running my jl code via bashscript

```julia
#!/bin/bash
export HOME=/root
export JULIA_DEPOT_PATH=$HOME/.julia

/usr/local/julia/bin/julia --project="/root/.julia/environments/v1.9" demo.jl

```

What can I do so that I have access to those packages?

---

<div class="post-metadata">

### Author: ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)
#### Post date: [December 12, 2024, 12:04pm UTC](https://discourse.julialang.org/t/packages-not-found/123756/2 "2024-12-12T12:04:52Z")

</div>

since the packages are in the global environment, you shouldn’t need to specify a project:

```julia
/usr/local/julia/bin/julia demo.jl

```

Maybe the path is wrong and removing it will fix things?

---

<div class="post-metadata">

### Author: ![odipus](https://avatars.discourse-cdn.com/v4/letter/o/8e8cbc/32.png) [@odipus](https://discourse.julialang.org/u/odipus)
#### Post date: [December 12, 2024, 12:09pm UTC](https://discourse.julialang.org/t/packages-not-found/123756/3 "2024-12-12T12:09:38Z")

</div>

After removing that this is the new error i get

`ERROR: LoadError: Failed to precompile CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b] to "/root/.julia/compiled/v1.9/CSV/jl_APriNU". Stacktrace: [1] error(s::String) @ Base ./error.jl:35 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool) @ Base ./loading.jl:2294 [3] compilecache @ ./loading.jl:2167 [inlined] [4] _require(pkg::Base.PkgId, env::String) @ Base ./loading.jl:1805 [5] _require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1660 [6] macro expansion @ ./loading.jl:1648 [inlined] [7] macro expansion @ ./lock.jl:267 [inlined] [8] require(into::Module, mod::Symbol) @ Base ./loading.jl:1611 in expression starting at /electric-summ.jl:4`  
Since I already precompiled the packages in the dockerfile, I want to avoid precompiling it again.

---

<div class="post-metadata">

### Author: ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)
#### Post date: [December 12, 2024, 4:56pm UTC](https://discourse.julialang.org/t/packages-not-found/123756/4 "2024-12-12T16:56:43Z")

</div>

> [@odipus](#):
>
> already precompiled the packages in the dockerfile, I want to avoid precompiling it again

This is probably unrelated to your latest error, but here are some things I did to address the issue in the quote.

I had to do this in my Dockerfile

```julia
# Setting JULIA_CPU_TARGET makes the precompiled code compatible with the runtime target so
# that precompilation doesn't happen again at runtime.
# This actual value for JULIA_CPU_TARGET may need optimization.
# See https://github.com/JuliaLang/julia/issues/50102#issuecomment-1588774131 etc
# including https://github.com/JuliaLang/julia/issues/50102#issuecomment-1592560219
ENV JULIA_CPU_TARGET "generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"

```

I also specified this before precompiling

```julia
# Use a special depot path to store precompiled binaries
ENV JULIA_DEPOT_PATH /var/task/.julia

```

And this later, in case some code didn’t get precompiled

```julia
# Allows more precompilation during runtime?
# /var/task is a read-only path during runtime.
ENV JULIA_DEPOT_PATH /tmp/.julia:/var/task/.julia

```
