# Pluto on Binder: use a repo environment rather than Pluto managed environment?

**URL:** <https://discourse.julialang.org/t/pluto-on-binder-use-a-repo-environment-rather-than-pluto-managed-environment/75311>\
**Category:** Pluto\
**Tags:** binder\
**Created:** [January 27, 2022, 6:03pm UTC](https://discourse.julialang.org/t/pluto-on-binder-use-a-repo-environment-rather-than-pluto-managed-environment/75311 "2022-01-27T18:03:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![thompsonmj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thompsonmj/32/25172_2.png) [@thompsonmj](https://discourse.julialang.org/u/thompsonmj)\
**Post date:** [January 28, 2022, 8:28pm UTC](https://discourse.julialang.org/t/pluto-on-binder-use-a-repo-environment-rather-than-pluto-managed-environment/75311/4 "2022-01-28T20:28:07Z")

</div>

I’m trying with this code in the first cell to download config files to a temp directory:

```julia
begin
	using Downloads
	using Pkg

	owd = pwd()

	if isfile(joinpath("..","Manifest.toml")) && isfile(joinpath("..","Project.toml"))

		cd("..")
		Pkg.activate(".")
		Pkg.resolve()
		Pkg.instantiate()
		cd(owd)
		
	elseif isfile(joinpath(".","Manifest.toml")) && isfile(joinpath(".","Project.toml"))

		Pkg.activate(".")
		Pkg.resolve()
		Pkg.instantiate()
		
	else

		manifest_url = "https://URL/to/Manifest.toml"
		project_url = "https://URL/to/Project.toml"
		
		temp_dir = mktempdir(".",cleanup=true)
		
		Downloads.download(manifest_url,joinpath(owd,temp_dir,"Manifest.toml"))
		Downloads.download(project_url,joinpath(owd,temp_dir,"Project.toml"))
		
		cd(temp_dir)
		
		Pkg.activate(".")
		Pkg.instantiate()
		
		cd(owd)
	end

end

```

In some projects, I have these files in a folder just above the notebook. In others, I have them in the same folder. If it’s running on Binder, they won’t be in either location, so we can make a temp directory and download them from the repository, then activate and instantiate on that directory.

It works well locally and on Binder on simple test cases, but on my real notebook, I’m getting this error running the notebook on Binder:

```julia
expected package `QOI [4b34888f]` to be registered

    pkgerror(::String)@Types.jl:55
    check_registered(::Pkg.Types.Context, ::Vector{Pkg.Types.PackageSpec})@Operations.jl:1157
    var"#instantiate#253"(::Nothing, ::Bool, ::Bool, ::Base.BinaryPlatforms.Platform, ::Bool, ::Bool, ::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(Pkg.API.instantiate), ::Pkg.Types.Context)@API.jl:1372
    instantiate@API.jl:1325[inlined]
    #instantiate#252@API.jl:1321[inlined]
    instantiate()@API.jl:1321
    top-level scope@

```

[Some](https://stackoverflow.com/questions/65461774/error-expected-package-juno-e5e0dc1b-to-be-registered) solutions suggest deleting the registry to fix it, but I can’t do that on Binder.

Or to update the registry with [`Pkg.Registry.update()`](https://discourse.julialang.org/t/error-expected-package-to-be-registered-in-juliapro/52430). This also did not solve it.

I tried deleting the Manifest.toml and runing `pkg> instantiate` again to make it fresh, but that yields the same error.

Linking to newly created issues on [QOI](https://github.com/KristofferC/QOI.jl/issues/10) and [Pluto on Binder](https://github.com/fonsp/pluto-on-binder/issues/18) (don’t know if these are the issue or not).

---

_[View the full topic](https://discourse.julialang.org/t/pluto-on-binder-use-a-repo-environment-rather-than-pluto-managed-environment/75311)._
