# Can't get \`Preferences.set\_preferences!()\` to work

**URL:** <https://discourse.julialang.org/t/cant-get-preferences-set-preferences-to-work/74155>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [January 6, 2022, 5:33pm UTC](https://discourse.julialang.org/t/cant-get-preferences-set-preferences-to-work/74155 "2022-01-06T17:33:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Di11on](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/di11on/32/6352_2.png) [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Post date:** [January 6, 2022, 5:33pm UTC](https://discourse.julialang.org/t/cant-get-preferences-set-preferences-to-work/74155/1 "2022-01-06T17:33:19Z")

</div>

Hi folks,

I’m trying to use a custom binary with HiGHS.jl. I am following the instructions here: [Custom binaries · JuMP](https://jump.dev/JuMP.jl/dev/developers/custom_solver_binaries/)

These instructions involve using `Preferences.set_preferences!()` to set the path to the custom binary. However, I can’t get this to work. Here is what I get:

```julia

julia> using HiGHS_jll

julia> HiGHS_jll.libhighs_path
"C:\\Users\\jodyd\\.julia\\artifacts\\bdd0d05b425c3feb2c354051d1fdad3210faa8ec\\bin\\libhighs.dll"

julia> using Preferences

julia> set_preferences!(
           "LocalPreferences.toml",
           "HiGHS_jll",
           "libhighs_path" => "C:\\Workspace\\Spine\\HiGHS\\build\\bin\\Release\\libhighs.dll"
       )

julia> exit()

C:\Users\jodyd>julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.6.3 (2021-09-23)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using HiGHS_jll

julia> HiGHS_jll.libhighs_path
"C:\\Users\\jodyd\\.julia\\artifacts\\bdd0d05b425c3feb2c354051d1fdad3210faa8ec\\bin\\libhighs.dll"

```

So, it looks like `set_preferences!` isn’t doing what I’m expecting it to do or I am doing something wrong.

When I look in `LocalPreferences.toml` I see the expected content:

```julia
[HiGHS_jll]
libhighs_path = "C:\\Workspace\\Spine\\HiGHS\\build\\bin\\Release\\libhighs.dll"

```

I would be grateful for any assistance!

---

<div class="post-metadata">

**Author:** ![Di11on](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/di11on/32/6352_2.png) [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Post date:** [January 7, 2022, 9:06pm UTC](https://discourse.julialang.org/t/cant-get-preferences-set-preferences-to-work/74155/2 "2022-01-07T21:06:43Z")

</div>

Anyone any thoughts on this?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [January 7, 2022, 11:36pm UTC](https://discourse.julialang.org/t/cant-get-preferences-set-preferences-to-work/74155/3 "2022-01-07T23:36:23Z")

</div>

Feel free to tag me if it’s JuMP-related; I don’t read every post here 🙂 .

It seems I’m missing some crucial documentation.

I think `LocalPreferences.toml` needs to be in the same directory as your currently active `Project.toml`. So since you’ve just started in the global environment, it needs to be `C:\\Users\\jodyd\\.julia\\environments\\v1.6\\LocalPreferences.toml`.

I’d suggest you use a new local environment for this however, instead of overriding the global one.
