question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error during pytest

See original GitHub issue

Hi, I am using a virtulenv with Python 3.6 on aarch64 infrastructure.

I have run the instructions as described to build from source. No issues faced. I was on v0.8.0 branch.

When I run: python3 -m pytest

I get: _________________________________________________________________________ ERROR collecting thinc/tests/regression/test_issue208.py _________________________________________________________________________ ImportError while importing test module '/home/vap-team-admin/Desktop/balefire_jetson/downloads/thinc/thinc/tests/regression/test_issue208.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.6/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) thinc/tests/regression/test_issue208.py:1: in <module> from thinc.api import chain, Linear thinc/api.py:2: in <module> from .initializers import normal_init, uniform_init, glorot_uniform_init, zero_init thinc/initializers.py:4: in <module> from .backends import Ops thinc/backends/__init__.py:8: in <module> from .cupy_ops import CupyOps, has_cupy thinc/backends/cupy_ops.py:18: in <module> from .numpy_ops import NumpyOps E ModuleNotFoundError: No module named 'thinc.backends.numpy_ops' ========================================================================================= short test summary info ========================================================================================== ERROR thinc/tests/test_config.py ERROR thinc/tests/test_initializers.py ERROR thinc/tests/test_loss.py ERROR thinc/tests/test_optimizers.py ERROR thinc/tests/test_schedules.py ERROR thinc/tests/test_serialize.py ERROR thinc/tests/test_util.py ERROR thinc/tests/backends/test_mem.py ERROR thinc/tests/backends/test_ops.py ERROR thinc/tests/extra/test_beam_search.py ERROR thinc/tests/layers/test_basic_tagger.py ERROR thinc/tests/layers/test_combinators.py ERROR thinc/tests/layers/test_feed_forward.py ERROR thinc/tests/layers/test_hash_embed.py ERROR thinc/tests/layers/test_layers_api.py ERROR thinc/tests/layers/test_linear.py ERROR thinc/tests/layers/test_lstm.py ERROR thinc/tests/layers/test_mnist.py ERROR thinc/tests/layers/test_mxnet_wrapper.py ERROR thinc/tests/layers/test_pytorch_wrapper.py ERROR thinc/tests/layers/test_reduce_first_last.py ERROR thinc/tests/layers/test_shim.py ERROR thinc/tests/layers/test_sparse_linear.py ERROR thinc/tests/layers/test_tensorflow_wrapper.py ERROR thinc/tests/layers/test_transforms.py ERROR thinc/tests/layers/test_uniqued.py ERROR thinc/tests/layers/test_with_debug.py ERROR thinc/tests/layers/test_with_transforms.py ERROR thinc/tests/model/test_model.py ERROR thinc/tests/model/test_validation.py ERROR thinc/tests/regression/test_issue208.py !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 31 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============================================================================================ 31 errors in 2.74s ============================================================================================

Full message is longer but its just a repeat of “ERROR collecting” message

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
polmcommented, Oct 18, 2021

I am installing from source for the purpose of using spacy, which requires thinc as a dependency. Does having thinc show up as thinc @ file:///home/vap-team-admin/Desktop/balefire_jetson/downloads/thinc in pip3 freeze allow it to be detected? No version is specified

That’s normal for editable installs, it’s not a problem.

Will installation with --editable change things? omitting --editable seemed to have caused the installation to be faulty.

Editable installs are useful when you’re modifying the code regularly, and one side effect is that they help pytest work by getting paths right. Installing Thinc as a dependency from source you can do something like pip path/to/thinc and shouldn’t need the --editable flag, though it would also work.

The main reason for the editable flag is that if an item is installed editable, the original source files are used rather than a copy. This means that as you modify your source the updates are automatically reflected in your virtualenv. Since you don’t seem to actually be modifying Thinc, just getting it set up, you don’t need that flag to use it. (But again, it helps with tests due to path issues or something.)

1reaction
polmcommented, Oct 18, 2021

When posting logs please use the “Preview” function to make sure they look OK. You should start and end them with a “fence”, or a line, of three backticks, not a single backtick at the start and end.

For the record I am able to run the tests locally without your issues - I get three failures but they’re mypy related, so probably due to in-progress changes. Give me some time to look at your logs.

Also, like the README says, insalling with --editable is the normal, correct way to build from source.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to test error messages with pytest
In this short article, you will learn, how and when to test the error message of an exception with pytest.
Read more >
python - Pytest - error vs fail
For pytest, any uncaught exception thrown in a test function is a failure, including but not limited to assertion errors.
Read more >
How to handle test failures
This will invoke the Python debugger on every failure (or KeyboardInterrupt). Often you might only want to do this for the first failing...
Read more >
pytest-error-for-skips
pytest-error-for-skips ... Pytest plugin to treat skipped tests a test failures. This is nice if you want to ensure that your CI tests...
Read more >
Treating warnings as errors in pytest
Running pytest -Werror turns those warnings into errors that fail the tests. ... The --pdb starts the debugger at the warning (now error)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found