Linux installation

Hi,

After some issues with installation under Windows /and the fact I needed better HW) I tried to run under Ubuntu17, 16GB RAM. Starting prodigy

python3 -m prodigy dataset symptoms

gives the dump

_NDARRAY_ARRAY_FUNCTION = mu.ndarray.array_function
AttributeError: type object 'numpy.ndarray' has no attribute 'array_function

It is very well possible that it’s a Linux issue (I’m new to Linux). But running python from commandline, notebook or pycharm all works fine

thanks for the input

Full dump

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/ahe/.local/lib/python3.6/site-packages/prodigy/__init__.py", line 9, in <module>
    from . import recipes  # noqa
  File "/home/ahe/.local/lib/python3.6/site-packages/prodigy/recipes/__init__.py", line 4, in <module>
    from . import dep, ner, textcat, pos, compare, terms, generic, image  # noqa
  File "/home/ahe/.local/lib/python3.6/site-packages/prodigy/recipes/dep.py", line 5, in <module>
    import spacy
  File "/home/ahe/.local/lib/python3.6/site-packages/spacy/__init__.py", line 8, in <module>
    from thinc.neural.util import prefer_gpu, require_gpu
  File "/home/ahe/.local/lib/python3.6/site-packages/thinc/neural/__init__.py", line 1, in <module>
    from ._classes.model import Model
  File "/home/ahe/.local/lib/python3.6/site-packages/thinc/neural/_classes/model.py", line 2, in <module>
    from numpy import prod
  File "/home/ahe/.local/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>
    from . import core
  File "/home/ahe/.local/lib/python3.6/site-packages/numpy/core/__init__.py", line 59, in <module>
    from . import numeric
  File "/home/ahe/.local/lib/python3.6/site-packages/numpy/core/numeric.py", line 3093, in <module>
    from . import fromnumeric
  File "/home/ahe/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 17, in <module>
    from . import _methods
  File "/home/ahe/.local/lib/python3.6/site-packages/numpy/core/_methods.py", line 158, in <module>
    _NDARRAY_ARRAY_FUNCTION = mu.ndarray.__array_function__
AttributeError: type object 'numpy.ndarray' has no attribute '__array_function__

@aph61 I think this might be due to an unfortunate default in the current version of spaCy, which is fixed in v2.1.

Do you have cupy installed, and perhaps a GPU card installed in your Linux server? If so, I think spaCy is trying to enable GPU execution behind the scenes, which is causing problems. If this is indeed the case, running pip uninstall cupy should resolve the problem.

Hi Matt,

thanks for the quick response. I’ll try it out, and get back with the results Andreas

PS: Wish I had a linux server with GPU. Is a simple i7/16G :frowning:

Hi Matthew,

Spacy v2.1 is not available yet, the highest available is 2.0.18 (tried both “pip install -U spacy”; “pip3 install spacy==v2.1”). Do you have somewhere a .whl that I can download?

thanks,

Andreas

Prodigy works with v2.0.18 currently, I was just letting you know the status of that issue. But if you don’t have a GPU, nevermind! Hmm.

Could you give the output to python3 -m pip list?

Hi Matthew,

here the python3 -m pip list results

python3 -m pip list

apturl (0.5.2)
asn1crypto (0.24.0)
atomicwrites (1.2.1)
attrs (18.2.0)
backcall (0.1.0)
beautifulsoup4 (4.7.0)
bleach (3.0.2)
boto (2.49.0)
boto3 (1.9.73)
botocore (1.12.73)
Brlapi (0.6.6)
bs4 (0.0.1)
bz2file (0.98)
cachetools (3.0.0)
certifi (2018.11.29)
chardet (3.0.4)
command-not-found (0.3)
cryptography (2.1.4)
cupshelpers (1.0)
cycler (0.10.0)
cymem (2.0.2)
cytoolz (0.9.0.1)
decorator (4.3.0)
defer (1.0.6)
defusedxml (0.5.0)
dill (0.2.8.2)
distro-info (0.18)
docutils (0.14)
en-core-web-lg (2.0.0)
en-core-web-md (2.0.0)
en-core-web-sm (2.0.0)
en-vectors-web-lg (2.0.0)
entrypoints (0.2.3)
fake-useragent (0.1.11)
falcon (1.4.1)
funcy (1.11)
future (0.17.1)
gensim (3.6.0)
httplib2 (0.9.2)
hug (2.4.1)
hug-middleware-cors (1.0.0)
idna (2.8)
ipykernel (5.1.0)
ipython (7.2.0)
ipython-genutils (0.2.0)
ipywidgets (7.4.2)
jedi (0.13.2)
Jinja2 (2.10)
jmespath (0.9.3)
joblib (0.13.0)
jsonschema (2.6.0)
jupyter (1.0.0)
jupyter-client (5.2.4)
jupyter-console (6.0.0)
jupyter-core (4.4.0)
keyring (10.6.0)
keyrings.alt (3.0)
kiwisolver (1.0.1)
language-selector (0.1)
launchpadlib (1.10.6)
lazr.restfulclient (0.13.5)
lazr.uri (1.0.3)
louis (3.5.0)
macaroonbakery (1.1.3)
Mako (1.0.7)
MarkupSafe (1.1.0)
matplotlib (3.0.2)
mistune (0.8.4)
mmh3 (2.5.1)
more-itertools (5.0.0)
msgpack (0.6.0)
msgpack-numpy (0.4.3.2)
murmurhash (1.0.1)
nbconvert (5.4.0)
nbformat (4.4.0)
netifaces (0.10.4)
nltk (3.4)
notebook (5.7.4)
numexpr (2.6.9)
numpy (1.16.0)
oauth (1.0.1)
olefile (0.45.1)
pandas (0.23.4)
pandocfilters (1.4.2)
parso (0.3.1)
peewee (2.10.2)
pexpect (4.6.0)
pickleshare (0.7.5)
Pillow (5.1.0)
pip (9.0.1)
plac (0.9.6)
pluggy (0.8.0)
preshed (2.0.1)
prodigy (1.6.1)
prometheus-client (0.5.0)
prompt-toolkit (2.0.7)
protobuf (3.0.0)
ptyprocess (0.6.0)
py (1.7.0)
pycairo (1.16.2)
pycrypto (2.6.1)
pycups (1.9.73)
Pygments (2.3.1)
pygobject (3.26.1)
pyLDAvis (2.1.2)
pymacaroons (0.13.0)
PyNaCl (1.1.2)
pyparsing (2.3.0)
pyRFC3339 (1.0)
pytest (4.0.2)
python-apt (1.6.3)
python-dateutil (2.7.5)
python-debian (0.1.32)
python-mimeparse (1.6.0)
pytz (2018.9)
pyxdg (0.25)
PyYAML (3.12)
pyzmq (17.1.2)
qtconsole (4.4.3)
regex (2018.1.10)
reportlab (3.4.0)
requests (2.21.0)
requests-unixsocket (0.1.5)
s3transfer (0.1.13)
scikit-learn (0.20.2)
scipy (1.2.0)
SecretStorage (2.3.1)
Send2Trash (1.5.0)
setuptools (40.6.3)
simplejson (3.13.2)
singledispatch (3.4.0.3)
six (1.12.0)
smart-open (1.7.1)
soupsieve (1.6.2)
spacy (2.0.18)
system-service (0.3)
systemd-python (234)
terminado (0.8.1)
testpath (0.4.2)
thinc (6.12.1)
toolz (0.9.0)
tornado (5.1.1)
tqdm (4.29.1)
traitlets (4.3.2)
ubuntu-drivers-common (0.0.0)
ufw (0.35)
ujson (1.35)
unattended-upgrades (0.1)
urllib3 (1.24.1)
usb-creator (0.3.3)
uuid (1.30)
wadllib (1.3.2)
waitress (1.2.0)
wcwidth (0.1.7)
webencodings (0.5.1)
wheel (0.32.3)
widgetsnbextension (3.4.2)
wrapt (1.10.11)
xkit (0.0.0)
zope.interface (4.3.2)

best,

Andreas

Hi Matthew,

Running Prodigy 1.6+ (hence installation) works fine on Windows7 Pro installation. So I have a workaround, which is good enough for me. I’ll wait till you have the Prodigy 1.6.1 released

have a nice weekend,

Andreas

It looks like you’ve ended up installing a new version of numpy on top of an old one, and this has somehow caused problems. See here: https://github.com/numpy/numpy/issues/12736

In general you might avoid some of these confusing errors if you use virtual environments for each project. It means you end up with less software interacting, so you get fewer unexpected results.

Hi Matthew,

thanks for the suggestion. I’ve to do some catch-up on the virtual environments, so for simplicity) I first removed everything, then reinstalled (I use a minimal configuration, so it’s hardly an effort). I first installed numpy-1.15.1, then spacy. spacy by default installs numpy-1.16.1. Starting Prodigy caused a failure. After that I manually uninstalled numpy-1.16, and reinstalled numpy-15.1, and everything works like a breeze.

So it appears to be a numpy-1.16 v. numpy-1.15 issue.

best,

Andreas