# How do I enable / install moc?

**URL:** <https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005>\
**Category:** Language Support\
**Created:** [January 16, 2023, 7:29pm UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005 "2023-01-16T19:29:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![blabagastered](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/blabagastered/32/8592_2.png) [@blabagastered](https://forum.dfinity.org/u/blabagastered)\
**Post date:** [January 16, 2023, 7:29pm UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/1 "2023-01-16T19:29:12Z")

</div>

On `dfx deploy icrc_token` I’m getting:

> [@icrc1/src/ICRC1/lib.mo:16.1-16.40: import error \[M0010\], package "StableTrieMap" not defined](https://forum.dfinity.org/t/icrc1-src-icrc1-lib-mo-16-1-16-40-import-error-m0010-package-stabletriemap-not-defined/18004/1):
>
> `Failed to run 'moc'.`

How do I install it / add it / make it runnable?

---

<div class="post-metadata">

**Author:** ![blabagastered](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/blabagastered/32/8592_2.png) [@blabagastered](https://forum.dfinity.org/u/blabagastered)\
**Post date:** [January 17, 2023, 5:00am UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/2 "2023-01-17T05:00:15Z")

</div>

The problem was that `mops install` needs to be run, I had gotten two repos mixed up.

It’s not listed as part of the instructions in the mops documentation [Internet Computer Content Validation Bootstrap](https://j4mwm-bqaaa-aaaam-qajbq-cai.ic0.app/docs/install)

---

<div class="post-metadata">

**Author:** ![Gekctek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gekctek/32/6863_2.png) [@Gekctek](https://forum.dfinity.org/u/Gekctek)\
**Post date:** [January 17, 2023, 5:15am UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/3 "2023-01-17T05:15:08Z")

</div>

@ZenVoich ^  
Maybe add a line in there about `mops install`  
@blabagastered  
My guess is the `mops add <..>` installs them, vs just modifying the config file and doing `mops install`

---

<div class="post-metadata">

**Author:** ![blabagastered](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/blabagastered/32/8592_2.png) [@blabagastered](https://forum.dfinity.org/u/blabagastered)\
**Post date:** [January 17, 2023, 5:22am UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/4 "2023-01-17T05:22:32Z")

</div>

`mops add <package_name>` seems a bit odd to me because if you need 10 packages that means running 10 commands, which seems off.

Perhaps stating on docs there are two ways: adding dependencies to mops.toml + running `mops install`, or running `mops add <package_name>` for each package individually (if that is indeed correct).

Generally, for cloned repos, `mops install` will make more sense.

---

<div class="post-metadata">

**Author:** ![ZenVoich](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zenvoich/32/5969_2.png) [@ZenVoich](https://forum.dfinity.org/u/ZenVoich)\
**Post date:** [January 17, 2023, 5:56am UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/5 "2023-01-17T05:56:03Z")

</div>

@blabagastered @Gekctek  
I will add information about `mops install` to the documentation

---

<div class="post-metadata">

**Author:** ![blabagastered](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/blabagastered/32/8592_2.png) [@blabagastered](https://forum.dfinity.org/u/blabagastered)\
**Post date:** [January 17, 2023, 6:04am UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/6 "2023-01-17T06:04:07Z")

</div>

Great.

@ZenVoich,maybe a 4.A and a 4.B sections (mops add, mops install), with a brief “you can do either this or that” sort of thing.

I’d also suggest changing this line

> `import Lib "mo:<package_name>";`

for these two:

> `import PackageName "mo:<package_name>";`  
> for example, `import Itertools "mo:itertools/Iter";`

To avoid ambiguity and to stay consistent in the “packages” language (as opposed to “library”) found in the rest of the documentation.

---

<div class="post-metadata">

**Author:** ![blabagastered](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/blabagastered/32/8592_2.png) [@blabagastered](https://forum.dfinity.org/u/blabagastered)\
**Post date:** [January 18, 2023, 3:24pm UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/7 "2023-01-18T15:24:12Z")

</div>

Hey, how can I install this repo ([GitHub - ZhenyaUsenko/motoko-hash-map: Stable hash maps for Motoko](https://github.com/ZhenyaUsenko/motoko-hash-map)  
) into a project so that I can use it via

`import Map "mo:hashmap/Map";`  
?

Tried `mops add hashmap` but no luck.

---

<div class="post-metadata">

**Author:** ![ZenVoich](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zenvoich/32/5969_2.png) [@ZenVoich](https://forum.dfinity.org/u/ZenVoich)\
**Post date:** [January 19, 2023, 5:13am UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/8 "2023-01-19T05:13:23Z")

</div>

> [@blabagastered](#):
>
> Tried `mops add hashmap` but no luck.

This only works for packages published to mops.

Try this to install from github:

```auto
mops add https://github.com/ZhenyaUsenko/motoko-hash-map#v7.0.0

```

and import like this

```motoko
import Map "mo:motoko-hash-map/Map";

```

Also you can rename `motoko-hash-map` to `hashmap` in mops.toml to be able to import like this

```motoko
import Map "mo:hashmap/Map";

```

If you rename package in `mops.toml` you need to run `mops install` to install the package with new name.

---

<div class="post-metadata">

**Author:** ![blabagastered](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/blabagastered/32/8592_2.png) [@blabagastered](https://forum.dfinity.org/u/blabagastered)\
**Post date:** [January 19, 2023, 10:46am UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/9 "2023-01-19T10:46:26Z")

</div>

Thank you.

I only realised now this is meant to be a vessel package. I’ve not used vessel. Only mops.

Is it ok to use both vessel and mops together in the same project / repo, or might it cause issues?

---

<div class="post-metadata">

**Author:** ![ZenVoich](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zenvoich/32/5969_2.png) [@ZenVoich](https://forum.dfinity.org/u/ZenVoich)\
**Post date:** [January 19, 2023, 11:08am UTC](https://forum.dfinity.org/t/how-do-i-enable-install-moc/18005/10 "2023-01-19T11:08:48Z")

</div>

> [@blabagastered](#):
>
> Is it ok to use both vessel and mops together in the same project / repo, or might it cause issues?

You can use only one of these when you build canisters (which is listed in `packtool` in `dfx.json`)
