Running top-level `make test` crashes with "no sklearn" when run with no venv activated
erikrose opened this issue · 0 comments
erikrose commented
/fathom]% make test
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C cli test
python3 -m venv ./venv
pip3 install -r dev-requirements.txt
Collecting flake8==3.7.8 (from -r dev-requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/26/de/3f815a99d86eb10464ea7bd6059c0172c7ca97d4bdcfca41051b388a653b/flake8-3.7.8-py2.py3-none-any.whl
Collecting flake8-quotes==2.1.0 (from -r dev-requirements.txt (line 4))
Using cached https://files.pythonhosted.org/packages/18/f9/3323327526354c90fa0e6ff0f043133ae13dd2b89c5b638189cfd5fc9027/flake8-quotes-2.1.0.tar.gz
Collecting pytest==5.1.2 (from -r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/2f/19/d5f71752f71451ccc5ed5f6739e9da4a235f38783fdaf3629cae41b2ca7b/pytest-5.1.2-py3-none-any.whl
Collecting wheel==0.34.2 (from -r dev-requirements.txt (line 6))
Using cached https://files.pythonhosted.org/packages/8c/23/848298cccf8e40f5bbb59009b32848a4c38f4e7f3364297ab3c3e2e2cd14/wheel-0.34.2-py2.py3-none-any.whl
Collecting mccabe<0.7.0,>=0.6.0 (from flake8==3.7.8->-r dev-requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting entrypoints<0.4.0,>=0.3.0 (from flake8==3.7.8->-r dev-requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/ac/c6/44694103f8c221443ee6b0041f69e2740d89a25641e62fb4f2ee568f2f9c/entrypoints-0.3-py2.py3-none-any.whl
Collecting pyflakes<2.2.0,>=2.1.0 (from flake8==3.7.8->-r dev-requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/84/f2/ed0ffb887f8138a8fe5a621b8c0bb9598bfb3989e029f6c6a85ee66628ee/pyflakes-2.1.1-py2.py3-none-any.whl
Collecting pycodestyle<2.6.0,>=2.5.0 (from flake8==3.7.8->-r dev-requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/0e/0c/04a353e104d2f324f8ee5f4b32012618c1c86dd79e52a433b64fceed511b/pycodestyle-2.5.0-py2.py3-none-any.whl
Collecting atomicwrites>=1.0 (from pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/52/90/6155aa926f43f2b2a22b01be7241be3bfd1ceaf7d0b3267213e8127d41f4/atomicwrites-1.3.0-py2.py3-none-any.whl
Collecting py>=1.5.0 (from pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/99/8d/21e1767c009211a62a8e3067280bfce76e89c9f876180308515942304d2d/py-1.8.1-py2.py3-none-any.whl
Collecting wcwidth (from pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/f6/d5/1ecdac957e3ea12c1b319fcdee8b6917ffaff8b4644d673c4d72d2f20b49/wcwidth-0.1.9-py2.py3-none-any.whl
Collecting attrs>=17.4.0 (from pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting more-itertools>=4.0.0 (from pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/72/96/4297306cc270eef1e3461da034a3bebe7c84eff052326b130824e98fc3fb/more_itertools-8.2.0-py3-none-any.whl
Collecting pluggy<1.0,>=0.12 (from pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl
Collecting importlib-metadata>=0.12; python_version < "3.8" (from pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/0f/b0/3302e1a1711aaa920e82b025ef07fb5fe81f09634e4f7af0fb4695b72cab/importlib_metadata-1.5.2-py2.py3-none-any.whl
Collecting packaging (from pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/62/0a/34641d2bf5c917c96db0ded85ae4da25b6cd922d6b794648d4e7e07c88e5/packaging-20.3-py2.py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata>=0.12; python_version < "3.8"->pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/b2/34/bfcb43cc0ba81f527bc4f40ef41ba2ff4080e047acb0586b56b3d017ace4/zipp-3.1.0-py3-none-any.whl
Collecting six (from packaging->pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting pyparsing>=2.0.2 (from packaging->pytest==5.1.2->-r dev-requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/5d/bc/1e58593167fade7b544bfe9502a26dc860940a79ab306e651e7f13be68c2/pyparsing-2.4.6-py2.py3-none-any.whl
Installing collected packages: mccabe, entrypoints, pyflakes, pycodestyle, flake8, flake8-quotes, atomicwrites, py, wcwidth, attrs, more-itertools, zipp, importlib-metadata, pluggy, six, pyparsing, packaging, pytest, wheel
Running setup.py install for flake8-quotes ... done
Successfully installed atomicwrites-1.3.0 attrs-19.3.0 entrypoints-0.3 flake8-3.7.8 flake8-quotes-2.1.0 importlib-metadata-1.5.2 mccabe-0.6.1 more-itertools-8.2.0 packaging-20.3 pluggy-0.13.1 py-1.8.1 pycodestyle-2.5.0 pyflakes-2.1.1 pyparsing-2.4.6 pytest-5.1.2 six-1.14.0 wcwidth-0.1.9 wheel-0.34.2 zipp-3.1.0
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
pip3 install -e . -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Obtaining file:///Users/me/Checkouts/fathom/cli
Collecting click<8.0,>=7.0 (from fathom-web==3.3)
Using cached https://files.pythonhosted.org/packages/dd/c0/4d8f43a9b16e289f36478422031b8a63b54b6ac3b1ba605d602f10dd54d6/click-7.1.1-py2.py3-none-any.whl
Requirement already satisfied: more-itertools<9.0,>=8.2 in ./venv/lib/python3.7/site-packages (from fathom-web==3.3) (8.2.0)
Collecting numpy<2.0,>=1.18.1 (from fathom-web==3.3)
Using cached https://files.pythonhosted.org/packages/81/14/6d7c914dac1cb2b596d2adace4aa4574d20c0789780f1339d535e69e271f/numpy-1.18.2-cp37-cp37m-macosx_10_9_x86_64.whl
Collecting scikit-learn>=0.22.2 (from fathom-web==3.3)
Using cached https://files.pythonhosted.org/packages/64/57/23176044d9371e1af286176fd61cf7f74ed46d0b99122624ab93b3f32715/scikit_learn-0.22.2.post1-cp37-cp37m-macosx_10_9_x86_64.whl
Collecting tensorboardX<2.0,>=1.6 (from fathom-web==3.3)
Using cached https://files.pythonhosted.org/packages/a6/5c/e918d9f190baab8d55bad52840d8091dd5114cc99f03eaa6d72d404503cc/tensorboardX-1.9-py2.py3-none-any.whl
Collecting torch<2.0,>=1.0 (from fathom-web==3.3)
Using cached https://files.pythonhosted.org/packages/4a/72/0282449efe6e8a7ab6354ac990b8275bd8c881dcbf95b3ef0a041da3897b/torch-1.4.0-cp37-none-macosx_10_9_x86_64.whl
Collecting joblib>=0.11 (from scikit-learn>=0.22.2->fathom-web==3.3)
Using cached https://files.pythonhosted.org/packages/28/5c/cf6a2b65a321c4a209efcdf64c2689efae2cb62661f8f6f4bb28547cf1bf/joblib-0.14.1-py2.py3-none-any.whl
Collecting scipy>=0.17.0 (from scikit-learn>=0.22.2->fathom-web==3.3)
Using cached https://files.pythonhosted.org/packages/85/7a/ae480be23b768910a9327c33517ced4623ba88dc035f9ce0206657c353a9/scipy-1.4.1-cp37-cp37m-macosx_10_6_intel.whl
Collecting protobuf>=3.8.0 (from tensorboardX<2.0,>=1.6->fathom-web==3.3)
Using cached https://files.pythonhosted.org/packages/4c/25/c057a298635d08d087a20f51ff4287d821814208ebb045d84ea65535b3e3/protobuf-3.11.3-cp37-cp37m-macosx_10_9_x86_64.whl
Requirement already satisfied: six in ./venv/lib/python3.7/site-packages (from tensorboardX<2.0,>=1.6->fathom-web==3.3) (1.14.0)
Requirement already satisfied: setuptools in ./venv/lib/python3.7/site-packages (from protobuf>=3.8.0->tensorboardX<2.0,>=1.6->fathom-web==3.3) (40.8.0)
Installing collected packages: click, numpy, joblib, scipy, scikit-learn, protobuf, tensorboardX, torch, fathom-web
Running setup.py develop for fathom-web
Successfully installed click-7.1.1 fathom-web joblib-0.14.1 numpy-1.18.2 protobuf-3.11.3 scikit-learn-0.22.2.post1 scipy-1.4.1 tensorboardX-1.9 torch-1.4.0
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
======================================= test session starts ========================================
platform darwin -- Python 3.7.6, pytest-5.1.2, py-1.8.0, pluggy-0.12.0
rootdir: /Users/me/Checkouts/fathom/cli
collected 22 items / 3 errors / 19 selected
============================================== ERRORS ==============================================
__________________________ ERROR collecting fathom_web/test/test_test.py ___________________________
ImportError while importing test module '/Users/me/Checkouts/fathom/cli/fathom_web/test/test_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
fathom_web/test/test_test.py:4: in <module>
from ..commands.test import decode_weights
fathom_web/commands/test.py:5: in <module>
from ..accuracy import accuracy_per_tag, per_tag_metrics, pretty_accuracy, print_per_tag_report
fathom_web/accuracy.py:9: in <module>
from .utils import tensors_from, fit_unicode
fathom_web/utils.py:11: in <module>
from sklearn.preprocessing import minmax_scale
E ModuleNotFoundError: No module named 'sklearn'
__________________________ ERROR collecting fathom_web/test/test_train.py __________________________
ImportError while importing test module '/Users/me/Checkouts/fathom/cli/fathom_web/test/test_train.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
fathom_web/test/test_train.py:1: in <module>
from ..commands.train import exclude_indices
fathom_web/commands/train.py:10: in <module>
from ..accuracy import accuracy_per_tag, per_tag_metrics, pretty_accuracy, print_per_tag_report
fathom_web/accuracy.py:9: in <module>
from .utils import tensors_from, fit_unicode
fathom_web/utils.py:11: in <module>
from sklearn.preprocessing import minmax_scale
E ModuleNotFoundError: No module named 'sklearn'
__________________________ ERROR collecting fathom_web/test/test_utils.py __________________________
ImportError while importing test module '/Users/me/Checkouts/fathom/cli/fathom_web/test/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
fathom_web/test/test_utils.py:1: in <module>
from ..utils import fit_unicode
fathom_web/utils.py:11: in <module>
from sklearn.preprocessing import minmax_scale
E ModuleNotFoundError: No module named 'sklearn'
========================================= warnings summary =========================================
/usr/local/lib/python3.7/site-packages/google/protobuf/descriptor.py:47
/usr/local/lib/python3.7/site-packages/google/protobuf/descriptor.py:47: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
from google.protobuf.pyext import _message
-- Docs: https://docs.pytest.org/en/latest/warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================== 1 warnings, 3 error in 0.60s ===================================
make[1]: *** [test] Error 2
make: *** [test] Error 2