Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'spacy.he'No module named 'spacy.he' when running tests #947

Closed
mikeando opened this issue Apr 1, 2017 · 5 comments
Closed
Labels
bug Bugs and behaviour differing from documentation

Comments

@mikeando
Copy link

mikeando commented Apr 1, 2017

I'm trying to set up spaCy to run in a docker container:

my Dockerfile is:

FROM python:3.6

# Install spaCy.io
RUN pip install -U spacy
RUN python -m spacy download en
RUN python -m pip install -U pytest

building the contained all seems to go OK.
but when I try to run the tests I get

> docker run spacytest python -c "import os; import spacy; print(os.path.dirname(spacy.__file__))"
/usr/local/lib/python3.6/site-packages/spacy
> docker run spacytest python -m pytest /usr/local/lib/python3.6/site-packages/spacy
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/_pytest/config.py", line 325, in _getconftestmodules
    return self._path2confmods[path]
KeyError: local('/usr/local/lib/python3.6/site-packages/spacy/tests')

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/_pytest/config.py", line 356, in _importconftest
    return self._conftestpath2mod[conftestpath]
KeyError: local('/usr/local/lib/python3.6/site-packages/spacy/tests/conftest.py')

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/_pytest/config.py", line 362, in _importconftest
    mod = conftestpath.pyimport()
  File "/usr/local/lib/python3.6/site-packages/py/_path/local.py", line 662, in pyimport
    __import__(modname)
  File "/usr/local/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line 216, in load_module
    py.builtin.exec_(co, mod.__dict__)
  File "/usr/local/lib/python3.6/site-packages/spacy/tests/conftest.py", line 15, in <module>
    from ..he import Hebrew
ModuleNotFoundError: No module named 'spacy.he'
ERROR: could not load /usr/local/lib/python3.6/site-packages/spacy/tests/conftest.py

Any ideas what might be causing this?

Your Environment

I'm running in OS X 10.12.3, but spaCy is getting installed into a docker container (based of
the standard python3.6 container)

> docker run spacytest python -m spacy info --markdown

## Info about spaCy

* **spaCy version:** 1.7.3
* **Platform:** Linux-4.9.13-moby-x86_64-with-debian-8.7
* **Python version:** 3.6.1
* **Installed models:** en
@honnibal
Copy link
Member

honnibal commented Apr 2, 2017

This bug is fixed in master, but unfortunately slipped through in 1.7.3.

The setup.py doesn't list the he package, which means when you pip install, it's missing that directory. I'm not sure what the best mitigation is for now.

@mikeando
Copy link
Author

mikeando commented Apr 2, 2017

As these images are currently only for prototyping, there may be a few options.

  • if the absence of this package only effects testing - then I'll just continue as is,
  • if the missing package is only used in some quantifiable cases, then I may be able to continue
    as is.
  • if switching to an older version is possible, and available through pip, I can use this until a new version is released.
  • if switching to an older version of python fixes this, I could also do that.
  • if a new version with a fix is forthcoming soon, then I can just wait a while for testing suitability of spaCy for our needs.

Will any of these work?

@honnibal
Copy link
Member

honnibal commented Apr 2, 2017

It only affects testing, yes.

@honnibal honnibal added the bug Bugs and behaviour differing from documentation label Apr 7, 2017
@honnibal
Copy link
Member

honnibal commented Apr 7, 2017

Closing this, as it's fixed on master.

@honnibal honnibal closed this as completed Apr 7, 2017
@lock
Copy link

lock bot commented May 9, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

2 participants