# no hyphens in model names?

**URL:** <https://support.prodi.gy/t/no-hyphens-in-model-names/868>\
**Category:** Uncategorized\
**Tags:** spacy\
**Created:** [October 9, 2018, 9:16pm UTC](https://support.prodi.gy/t/no-hyphens-in-model-names/868 "2018-10-09T21:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbmpp](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/jbmpp/32/467_2.png) [@jbmpp](https://support.prodi.gy/u/jbmpp)\
**Post date:** [October 9, 2018, 9:16pm UTC](https://support.prodi.gy/t/no-hyphens-in-model-names/868/1 "2018-10-09T21:16:35Z")

</div>

When I try to package and install a newly-trained textcat model and if I give it a name with a hyphen in it, I can’t figure out how to `import` the resulting package.

```python
$ python -m spacy package ./models/ /tmp/ --meta example_meta.json --force --create-meta`
    Model name (default: core_web_sm): jbmpp-3label
...
$ python setup.py sdist`
$ pip install en_jbmpp-3label-2.0.0.tar.gz # succeeds

$ python -c "import spacy; spacy.load('en_jbmpp_3label')"
ModuleNotFoundError: No module named 'en_jbmpp_3label'
$ python -c "import spacy; spacy.load('en_jbmpp-3label')"
ModuleNotFoundError: No module named 'en_jbmpp-3label'
$ python -c "import spacy; spacy.load('en-jbmpp-3label')"
ModuleNotFoundError: No module named 'en-jbmpp-3label'

```

When I go through the exact same workflow, but with a model name that doesn’t have a hyphen in it (e.g. `jbmpp3label`), everything works correctly.

I think this is a bug – albeit a small one and one that’s easy to work around – but I wanted to alert you to it. It threw me off for 20 minutes or so and wanted to (a) give the solution some google juice and (b) give you all a chance to fix it when you can.

It’s also possible I missing something.

Prodigy is super helpful, amazing software that’s sped me up significantly. Thank you!

---

<div class="post-metadata">

**Author:** ![honnibal](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/honnibal/32/35_2.png) [@honnibal](https://support.prodi.gy/u/honnibal)\
**Post date:** [October 10, 2018, 5:30pm UTC](https://support.prodi.gy/t/no-hyphens-in-model-names/868/2 "2018-10-10T17:30:53Z")

</div>

Hi @jbmpp,

The packaging process bundles the model into a Python module, which needs to be named according to the normal Python naming rules. You’ll be able to something like `import en_jbmpp_3label; nlp = jbmpp_3label.load()`. Plainly you can’t do this if the name is something like `en-jbmpp-3label` – that would be a syntax error.

---

<div class="post-metadata">

**Author:** ![jbmpp](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/jbmpp/32/467_2.png) [@jbmpp](https://support.prodi.gy/u/jbmpp)\
**Post date:** [October 16, 2018, 2:15pm UTC](https://support.prodi.gy/t/no-hyphens-in-model-names/868/3 "2018-10-16T14:15:19Z")

</div>

Hi @honnibal: Thanks! Makes sense. I wonder if there couldn’t be a warning in the `spacy package` workflow, rather than accepting a name with a hyphen. Or at least a note in the docs. It’s not immediately intuitive in `spacy package` that I’m naming a python module.
