cannot import name 'EntityRecognizer' from 'arcgis.learn'

223
5
Jump to solution
05-02-2020 04:23 PM
SeanGrant3
New Contributor II

OS version: Win10 Pro 1909

Conda version: 4.8.3

python version: 3.7.4

Ran conda cmd:

conda install -c esri arcgis fastai pillow scikit-image

Opened notebook and import commands failed:

Tried removing and installing again but no luck.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Esteemed Contributor

Don't pip install if at all.  When using conda, stick with it.

conda update numpy --no-pin --dry-run

will show you what it will install.... numpy 1.18.1 is the latest version on the anaconda site, It is what I am using.  1.18.4 is due out soon, but Anaconda hasn't been updating their site as quickly, for obvious reasons.

Should it show numpy 1.18.1 remove the --dry-run portion and update.

Esri tends to be a bit slower on the updates for things like numpy and the various science packages.

The esri-Anaconda site shows that Pro 2.6 is due for beta soon

https://anaconda.org/Esri/repo 

and it looks like they won't even be moving to python 3.7 and are probably sticking with python 1.16.5 based on the

'pinned' file (numpy 1.16.* in you C:\...your_install_path...\bin\Python\res\pinned

View solution in original post

0 Kudos
5 Replies
DanPatterson_Retired
MVP Esteemed Contributor

It is there... check your version and install path

arcgis.__version__
'1.8.0'

from arcgis.learn import EntityRecognizer

dir(arcgis.learn.EntityRecognizer)

['__class__'... snip...
'_arcgis_init_callback', '_check_backbone_support', '_check_requisites', '_check_tf',
'_create_emd', '_create_emd_template', '_create_html', '_create_tfonnx_emd_template',
'_extract_entities_text', '_find_lr', '_get_emd_params', '_get_post_processed_model',
'_get_tfonnx_emd_params', '_model_metrics', '_post_process_address_df',
'_post_process_non_address_df', '_publish_dlpk', '_save', '_save_as_tfonnx',
'_save_model_characteristics', '_save_tflite', '_show_lr_plot', '_write_emd',
'extract_entities', 'fit', 'from_model', 'load', 'lr_find', 'save', 'show_results',
'unfreeze'
]
0 Kudos
SeanGrant3
New Contributor II

It is not because the version conda is installing in 1.6.0 not 1.8.0

While the anaconda site says it is at 1.8.0...only 1.6.0 gets installed

When I manually try to install the tarball I receive more errors

I think this is a Numpy version error as that one also is not updating to the latest (1.18) so there is something going on with my machine.

I will keep digging....

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Don't pip install if at all.  When using conda, stick with it.

conda update numpy --no-pin --dry-run

will show you what it will install.... numpy 1.18.1 is the latest version on the anaconda site, It is what I am using.  1.18.4 is due out soon, but Anaconda hasn't been updating their site as quickly, for obvious reasons.

Should it show numpy 1.18.1 remove the --dry-run portion and update.

Esri tends to be a bit slower on the updates for things like numpy and the various science packages.

The esri-Anaconda site shows that Pro 2.6 is due for beta soon

https://anaconda.org/Esri/repo 

and it looks like they won't even be moving to python 3.7 and are probably sticking with python 1.16.5 based on the

'pinned' file (numpy 1.16.* in you C:\...your_install_path...\bin\Python\res\pinned

View solution in original post

0 Kudos
SeanGrant3
New Contributor II

Thanks Dan,

I meant to use conda, my fault. I ended up cleaning up my env for conda and restarting then retrying and that seemed to clear things up a bit. I am able to import the EntityRecognizer now and the version are good so far.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Glad it worked out.  It is too bad that esri can't put Anaconda Navigator in the distribution by default... it makes package management a lot easier for most rather than conda command line or trying to manage packages through Pro.

Post back if things go wrong any more.