# Vak prep crashes because of package version requirement

**URL:** <https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49>\
**Category:** Q&A\
**Tags:** vak\
**Created:** [November 15, 2022, 9:53am UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49 "2022-11-15T09:53:56Z")\
**Posts on this page:** 8\
**Page:** 1

<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:** [November 15, 2022, 9:53am UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49/1 "2022-11-15T09:53:56Z")

</div>

I created a new environment in a machine that served many successful runs with vak and tweetynet.  
This time I got an error when running vak prep on the tutorial data.

I tried creating the environment in two ways:

1. conda create --name tweety-env python=3.8 vak -c pytorch -c conda-forge
2. conda create --name tweety-env vak -c conda-forge

I then installed tweetynet:  
conda install tweetynet -c conda-forge

The error I get is that the package ‘protobuf’ is of the wrong version.  
It is a requirement in vak.  
@nicholdav, Can this be changed? Or, does it need changing in pypi or conda-forge?

(tweety-env) yardenc@USGPUbeast:/media/yardenc/New Volume/YardenBirds/BF/gy6or6$ vak prep gy6or6\_train.toml  
Traceback (most recent call last):  
File “/home/yardenc/miniconda3/envs/tweety-env/bin/vak”, line 10, in   
sys.exit(main())  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/vak/ **main**.py”, line 45, in main  
cli.cli(command=args.command, config\_file=args.configfile)  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/vak/cli/cli.py”, line 30, in cli  
COMMAND\_FUNCTION\_MAPcommand  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/vak/cli/prep.py”, line 87, in prep  
purpose = purpose\_from\_toml(config\_toml, toml\_path)  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/vak/cli/prep.py”, line 27, in purpose\_from\_toml  
are\_sections\_valid(config\_toml, toml\_path=toml\_path)  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/vak/config/validators.py”, line 94, in are\_sections\_valid  
MODEL\_NAMES = [model\_name for model\_name, model\_builder in models.find()]  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/vak/config/validators.py”, line 94, in   
MODEL\_NAMES = [model\_name for model\_name, model\_builder in models.find()]  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/vak/models/models.py”, line 32, in find  
yield entrypoint.name, entrypoint.load()  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/pkg\_resources/ **init**.py”, line 2470, in load  
self.require(\*args, \*\*kwargs)  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/pkg\_resources/ **init**.py”, line 2493, in require  
items = working\_set.resolve(reqs, env, installer, extras=self.extras)  
File “/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages/pkg\_resources/ **init**.py”, line 800, in resolve  
raise VersionConflict(dist, req).with\_context(dependent\_req)  
pkg\_resources.ContextualVersionConflict: (protobuf 4.21.9 (/home/yardenc/miniconda3/envs/tweety-env/lib/python3.8/site-packages), Requirement.parse(‘protobuf\<=3.20.1’), {‘vak’})

In option 2 it’s the same error, just a different version of python (3.10)

---

<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:** [November 15, 2022, 3:24pm UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49/2 "2022-11-15T15:24:24Z")

</div>

Hi @yardenc this is definitely a dependency issue we need to fix, thank you for catching it

#### workaround

Can you see if you can specify `protobuf<=3.20.1’` as a workaround? Like so:

```auto
conda create --name tweety-env python=3.8 vak protobuf<=3.20.1 -c pytorch -c conda-forge

```

#### longer-term fix

There’s two things going on here:

1. putting a temporary upper cap on this dependency to avoid an error  
which I did here: [DEV: Upper bound protobuf in pyproject.toml to avoid error · vocalpy/vak@d558ae3 · GitHub](https://github.com/vocalpy/vak/commit/d558ae39e49446501f46d9c70164a3ba65f77861)  
to deal with this issue: [[Python] Release 4.21.0 broke multiple Google Cloud client libraries ("TypeError: Descriptors cannot not be created directly.") · Issue #10051 · protocolbuffers/protobuf · GitHub](https://github.com/protocolbuffers/protobuf/issues/10051)
2. **not** specifying that upper cap in the `conda-forge` version  
which I think might be why it gets installed for you, not sure yet.

So

> Can this be changed? Or, does it need changing in pypi or conda-forge?

from that issue above it looks like release 3.20.2 might fix this issue. If so I will update that in the pyproject.toml, release a new vak, and then rebuild for conda-forge. Will get to this by the end of the week

---

<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:** [November 15, 2022, 5:37pm UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49/3 "2022-11-15T17:37:45Z")

</div>

The workaround worked straight away.

---

<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:** [November 16, 2022, 3:29am UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49/4 "2022-11-16T03:29:28Z")

</div>

Great, glad to hear it.

I removed the upper cap: [DEV: Remove upper cap on protobuf [skip ci] · vocalpy/vak@5c446fd · GitHub](https://github.com/vocalpy/vak/commit/5c446fd8f71319a758de700c6b9f23365409f970)

re-installed into the test environment, and everything seemed to run fine when `protobuf=20.1.3` got installed (it’s a transitive dependency, we don’t use it directly, I only specified it with that cap to avoid the issue).

I want to address your issue about spaces in paths but after that I’ll make a new release that should fix things for people installing via `conda` too

---

<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:** [November 19, 2022, 8:28pm UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49/5 "2022-11-19T20:28:47Z")

</div>

Please if you can install a dev version and test this pull request when merged – I think it should fix the spaces issue.

> <https://github.com/vocalpy/vak/pull/594>
>
> Makes two functions in \`files\` handle paths/filenames with spaces in them: \`vak.…files.files.find\_fname\` and \`vak.files.spect.find\_audio\_fname\`

Once you confirm, I’ll release a new version with the upper cap removed.

---

<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:** [November 21, 2022, 11:48am UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49/6 "2022-11-21T11:48:18Z")

</div>

> <https://github.com/vocalpy/vak/pull/594#issuecomment-1321936405>
>
> @NickleDave, I installed in a dev environment and confirmed that prep, train, an…d predict run with no crash on the tutorial data sets and configs.
> This confirms that the issue is dealt with.

---

<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:** [November 21, 2022, 1:58pm UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49/7 "2022-11-21T13:58:14Z")

</div>

Excellent, thank you @yardenc for testing that with the tutorial–good idea.

To address the original issue in this topic, I will release a new version later this week.

---

<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:** [December 5, 2022, 2:34am UTC](https://forum.vocalpy.org/t/vak-prep-crashes-because-of-package-version-requirement/49/8 "2022-12-05T02:34:17Z")

</div>

Just noting this was released, announcement here: [Vak version 0.7.0 released!](https://forum.vocalpy.org/t/vak-version-0-7-0-released/51)
