# \`vak\` installation issue with conda

**URL:** <https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27>\
**Category:** Q&A\
**Tags:** vak\
**Created:** [June 7, 2022, 7:10pm UTC](https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27 "2022-06-07T19:10:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![YMK123](https://avatars.discourse-cdn.com/v4/letter/y/e36b37/32.png) [@YMK123](https://forum.vocalpy.org/u/YMK123)\
**Post date:** [June 7, 2022, 7:10pm UTC](https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27/1 "2022-06-07T19:10:42Z")

</div>

Hi,  
I was following the tutorial for installing vak using conda for MacOS and on Linux. While the conda installation did not produce any errors, the program produces a segmentation fault error when typing in the commands.

> conda create --name vak-env vak -c conda-forge  
> conda activate vak-env  
> vak --help

On MacOS, I receive the following error:

> OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized.

On Linux, I receive the following error:

> segmentation fault

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![nicholdav](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.vocalpy.org/nicholdav/32/5_2.png) [@nicholdav](https://forum.vocalpy.org/u/nicholdav)\
**Post date:** [June 7, 2022, 7:25pm UTC](https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27/2 "2022-06-07T19:25:23Z")

</div>

Hi @YMK123 welcome to VocalPy and thank you for posting your help question here!  
Sorry you’re running into these errors.

Can you just confirm, to install you did the following?

```auto
conda create --name vak-env vak -c conda-forge
conda install vak -c conda-forge
conda install tweetynet -c conda-forge

```

And you did _not_ use `pip` to install?

Also, can you please enter the commands below on both Mac and Linux, and reply with the environment files they produce?

```auto
conda activate vak-env # if you haven't already
conda env export > environment.yml
conda list --explicit > spec-file.txt

```

Please name the files differently to indicate which operating system you created them on, e.g.

## on mac

```auto
conda activate vak-env # if you haven't already
conda env export > mac-environment.yml
conda list --explicit > mac-spec-file.txt

```

## on linux

```auto
conda activate vak-env # if you haven't already
conda env export > linux-environment.yml
conda list --explicit > linux-spec-file.txt

```

Thank you!

I should be able to use those files to recreate the environment and see if I can reproduce the error.

I remember that @mizuki had a similar error on WSL recently but AFAIK installs on Mac and Linux should be working! Sorry again that you’re running into this, we will get it sorted out

---

<div class="post-metadata">

**Author:** ![nicholdav](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.vocalpy.org/nicholdav/32/5_2.png) [@nicholdav](https://forum.vocalpy.org/u/nicholdav)\
**Post date:** [June 8, 2022, 2:09am UTC](https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27/3 "2022-06-08T02:09:52Z")

</div>

Replying to myself to save @YMK123 the work since I failed to realize people couldn’t attach files because of the default Discourse settings (Thank you @YMK123 for pointing us to the right Discourse meta post: [Uploading attachments to topics - Support - Discourse Meta](https://meta.discourse.org/t/uploading-attachments-to-topics/70934) – for future reference this is under Settings \> Files)

> I can confirm that I used the same conda commands, and did not use pip.

ok makes me think this is something conda forge-specific

I’m attaching the env .txt files (since the .txt and .yml extensions are now allowed)  
[linux-spec-file.txt](https://forum.vocalpy.org/uploads/short-url/kFpbWPfMToQCJoKUvMNHlhKtrzm.txt) (14.0 KB)  
[mac-spec-file.txt](https://forum.vocalpy.org/uploads/short-url/3m8dg0gahZqegr16M1CdEiTNNp3.txt) (12.4 KB)  
[linux-environment.yml](https://forum.vocalpy.org/uploads/short-url/r5Hwe12cOTt3a1HjvdmhnzxlRz3.yml) (5.5 KB)  
[mac-environment.yml](https://forum.vocalpy.org/uploads/short-url/fxASjDs5lqJCxFHSXlRgxFSJpfn.yml) (4.9 KB)

## Tests

(Adding sections here instead of replying to myself five times in a row)

### Mac env

I started with the MacOS environment and I think I can reproduce the error that @YMK123 observed:

```auto
(young-mi-env) davidnicholson@Davids-MacBook-Pro  ~/Downloads 
$ vak --help
OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
[1] 22865 abort vak --help

```

---

<div class="post-metadata">

**Author:** ![nicholdav](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.vocalpy.org/nicholdav/32/5_2.png) [@nicholdav](https://forum.vocalpy.org/u/nicholdav)\
**Post date:** [June 8, 2022, 2:37am UTC](https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27/4 "2022-06-08T02:37:24Z")

</div>

Ok now I am replying separately because I want you to make sure you see this @YMK123

Can you please try creating a new environment and testing the install with the following commands?  
On MacOS:

```auto
conda create -n vak-env python=3.9 # because it's what you had before
conda activate vak-env
conda install pytorch torchvision -c pytorch
conda install vak tweetynet -c conda-forge
vak --help

```

When I did this it worked for me on Mac.

The key difference here is that we’re installing `pytorch` and `torchvision` _first_ from the `pytorch` channel.  
We fixed a similar issue the same way before:

> <https://github.com/vocalpy/vak/issues/508#issuecomment-1126564606>
>
> I'm on a computer with RTX3090, which is supported with "cuda" of which version …is more than 11.0 and thus vak's "pytorch" version seems unmatched, so I get the warning;
> \`\`\`
> NVIDIA GeForce RTX 3090 with CUDA capability sm\_86 is not compatible with the current PyTorch installation.
> 
> The current PyTorch install supports CUDA capabilities sm\_37 sm\_50 sm\_60 sm\_61 sm\_70 sm\_75 compute\_37.
> If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
> 
> warnings.warn(incompatible\_device\_warn.format(device\_name, capability, " ".join(arch\_list), device\_name))
> \`\`\`
> I tried to update pytorch in (vak-env) which I created according to the installation documentation of vak to run vak with tweetynet, but I failed. It might be because my command was not correct as I'm not a skillful user, though.

I think what’s going on is that when we just specify the `conda-forge` channel we get some version of `pytorch` that’s built by `conda-forge`, which we do not want.  
I need to confirm that though.  
The fact that this is now affecting multiple people is a reason to figure that out sooner rather than later.

To try on Linux you’ll want to modify the commands as appropriate for your machine.  
Not sure if you have a GPU; you can go to [Start Locally | PyTorch](https://pytorch.org/get-started/locally/) on that machine and the site should let you pick here:

 ![Screen Shot 2022-06-07 at 10.32.13 PM](https://canada1.discourse-cdn.com/flex032/uploads/vocalpy/original/1X/0cb7ef7cac700637eecef104b1e0726730108731.png)  
Basically you’ll need to say either `conda install pytorch torchvision cpuonly -c pytorch` if you’re not using a GPU or specify the `cudatoolkit` you need if you are using a GPU, `conda install pytorch torchvision cudatoolkit=10.2 -c pytorch`

---

<div class="post-metadata">

**Author:** ![yardenc](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.vocalpy.org/yardenc/32/38_2.png) [@yardenc](https://forum.vocalpy.org/u/yardenc)\
**Post date:** [June 8, 2022, 8:51am UTC](https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27/5 "2022-06-08T08:51:19Z")

</div>

@nicholdav will confirm or correct me if I’m wrong. There should be a preference to use using pytorch on linux \> windows \> Mac.

For example, [Unable to install pytorch with pip on macOS Monterey 12.0.1 (M1 chip) · Issue #75534 · pytorch/pytorch · GitHub](https://github.com/pytorch/pytorch/issues/75534), reports pytorch install issues on MacOS Monterey.

Also, MacOs is incompatible with most relevant GPUs.

---

<div class="post-metadata">

**Author:** ![nicholdav](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.vocalpy.org/nicholdav/32/5_2.png) [@nicholdav](https://forum.vocalpy.org/u/nicholdav)\
**Post date:** [June 8, 2022, 1:12pm UTC](https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27/6 "2022-06-08T13:12:48Z")

</div>

> @nicholdav will confirm or correct me if I’m wrong. There should be a preference to use using pytorch on linux \> windows \> Mac.

I don’t think there should be a preference!  
There are at least a few people training on Mac that I know of.

But @yardenc you are right that there is a bit of a “bias” where it’s easier to install on Unix systems, unfortunately

One good thing about TweetyNet is that for the use cases we tested it’s pretty lightweight and you don’t necessarily need a GPU. @YMK123 that could of course be different if your data is not an acoustically isolated individual. But as a very rough rule of thumb if you’re training on CPU then it will probably be a couple hours to overnight to train a model, versus ~half an hour to an hour on a GPU.

---

<div class="post-metadata">

**Author:** ![YMK123](https://avatars.discourse-cdn.com/v4/letter/y/e36b37/32.png) [@YMK123](https://forum.vocalpy.org/u/YMK123)\
**Post date:** [June 8, 2022, 4:45pm UTC](https://forum.vocalpy.org/t/vak-installation-issue-with-conda/27/7 "2022-06-08T16:45:51Z")

</div>

@nicholdav Thanks, the installation of pytorch and torchvision before vak seems to do the trick! While I was able to run through the remainder of the tutorial smoothly, I had some trouble with vak prep on my own pilot dataset that I’ll add as a separate post to keep the issues separate.

Previously, I was able to train a CNN model on the Mac through keras which took a few hours, but I haven’t tried any RNN-based model. The recordings are from single individuals, but I hope to train the model across individuals which may also add to the computational time.
