# False error?

**URL:** <https://discourse.julialang.org/t/false-error/32305>\
**Category:** General Usage\
**Created:** [December 15, 2019, 4:13pm UTC](https://discourse.julialang.org/t/false-error/32305 "2019-12-15T16:13:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alaraints](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@alaraints](https://discourse.julialang.org/u/alaraints)\
**Post date:** [December 15, 2019, 4:13pm UTC](https://discourse.julialang.org/t/false-error/32305/1 "2019-12-15T16:13:51Z")

</div>

can this be true?:

MethodError: no method matching sort!(::Dict{Int64,String})

that seems to be basic thing, am I doing something wrong?

Regards,

Alar Aints,

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [December 15, 2019, 4:26pm UTC](https://discourse.julialang.org/t/false-error/32305/2 "2019-12-15T16:26:56Z")

</div>

`Dict`s are unordered, so you cannot sort them.  
[OrderedDict](https://github.com/JuliaCollections/OrderedCollections.jl)s are ordered, so you can sort them.

```julia
julia> using OrderedCollections

julia> d = OrderedDict(1 => :a, 4 => :b, 3 => :c, 2 => :d)
OrderedDict{Int64,Symbol} with 4 entries:
  1 => :a
  4 => :b
  3 => :c
  2 => :d

julia> sort!(d)
OrderedDict{Int64,Symbol} with 4 entries:
  1 => :a
  2 => :d
  3 => :c
  4 => :b

julia> d
OrderedDict{Int64,Symbol} with 4 entries:
  1 => :a
  2 => :d
  3 => :c
  4 => :b

```

---

<div class="post-metadata">

**Author:** ![alaraints](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@alaraints](https://discourse.julialang.org/u/alaraints)\
**Post date:** [December 15, 2019, 4:46pm UTC](https://discourse.julialang.org/t/false-error/32305/3 "2019-12-15T16:46:42Z")

</div>

Thanks, so how do I get it?  
I typed:  
using Pkg  
Pkg.add(“OrderedCollections.jl”)  
I got:  
**julia\>** Pkg.add(“OrderedCollections.jl”)

**Cloning** default registries into `~/.julia`

**Cloning** registry from “[GitHub - JuliaRegistries/General: The official registry of general Julia packages](https://github.com/JuliaRegistries/General.git)”

**Added** registry `General` to `~/.julia/registries/General`

**ERROR:** The following package names could not be resolved:

- OrderedCollections.jl (not found in project, manifest or registry)

Please specify by known `name=uuid`.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [December 15, 2019, 4:47pm UTC](https://discourse.julialang.org/t/false-error/32305/4 "2019-12-15T16:47:54Z")

</div>

> [@alaraints](#):
>
> Pkg.add(“OrderedCollections.jl”)

Try:

```julia
Pkg.add(“OrderedCollections”)

```

---

<div class="post-metadata">

**Author:** ![alaraints](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@alaraints](https://discourse.julialang.org/u/alaraints)\
**Post date:** [December 15, 2019, 4:49pm UTC](https://discourse.julialang.org/t/false-error/32305/5 "2019-12-15T16:49:17Z")

</div>

Thanks, works. 🙂
