Can't load pipeline, no module named srsly.ujson.ujson #8199
-
spaCy appears to install ok (on Windows 10), but when I try to download encore_web_sm (or any other), I get "ModuleNotFoundError: No module named: srsly.ujason.ujason'. I've tried installing with both Conda and Pip, using Python 3.8 and 3.9, both with and without a virtual environment. I see srsly module in the list of dependencies. I've tried updating srsly. Same error whatever I do. My install was 'conda install -c conda-forge spacy'. What am I doing wrong?? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Sorry you're having trouble with install. I've never heard of an issue like that before. Can you clarify some details?
|
Beta Was this translation helpful? Give feedback.
-
Thanks for getting back to me so quickly. I tried uninstalling and
reinstall srsly, and trying to import srsly.ujson gives me the same
error.
I've attached a text file capturing the entire process of installing
spaCy and then attempting to load the pipeline.
Cheers,
Doug
…------ Original Message ------
From: "polm" ***@***.***>
To: "explosion/spaCy" ***@***.***>
Cc: "diggymacd" ***@***.***>; "Author"
***@***.***>
Sent: 5/25/2021 10:29:02 PM
Subject: Re: [explosion/spaCy] Can't load pipeline (#8199)
Sorry you're having trouble with install. I've never heard of an issue
like that before. Can you clarify some details?
Can you paste the full error traceback?
If you uninstall and reinstall srsly, can you run import srsly.ujson?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8199 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOSTQPZ4KQUO37KJPRA5PLTPSBJ5ANCNFSM45Q3J7UQ>.
> Solving environment: done
>
> ## Package Plan ##
>
> environment location: C:\Users\Doug\miniconda3\envs\natlang
>
> added / updated specs:
> - spacy
>
>
> The following packages will be downloaded:
>
> package | build
> ---------------------------|-----------------
> boto3-1.17.80 | pyhd8ed1ab_0 70 KB conda-forge
> botocore-1.20.80 | pyhd8ed1ab_0 4.6 MB conda-forge
> pyasn1-0.4.8 | py_0 53 KB conda-forge
> spacy-3.0.6 | py38h2f20550_0 9.2 MB conda-forge
> yarl-1.6.3 | py38h294d835_1 136 KB conda-forge
> ------------------------------------------------------------
> Total: 14.1 MB
>
> The following NEW packages will be INSTALLED:
>
> aiohttp conda-forge/win-64::aiohttp-3.7.4-py38h294d835_0
> async-timeout conda-forge/noarch::async-timeout-3.0.1-py_1000
> attrs conda-forge/noarch::attrs-21.2.0-pyhd8ed1ab_0
> boto conda-forge/noarch::boto-2.49.0-py_0
> boto3 conda-forge/noarch::boto3-1.17.80-pyhd8ed1ab_0
> botocore conda-forge/noarch::botocore-1.20.80-pyhd8ed1ab_0
> brotlipy conda-forge/win-64::brotlipy-0.7.0-py38h294d835_1001
> bz2file conda-forge/noarch::bz2file-0.98-py_0
> cachetools conda-forge/noarch::cachetools-4.2.2-pyhd8ed1ab_0
> cffi conda-forge/win-64::cffi-1.14.5-py38hd8c33c5_0
> chardet conda-forge/win-64::chardet-4.0.0-py38haa244fe_1
> click conda-forge/noarch::click-7.1.2-pyh9f0ad1d_0
> colorama conda-forge/noarch::colorama-0.4.4-pyh9f0ad1d_0
> cryptography conda-forge/win-64::cryptography-3.4.7-py38hd7da0ea_0
> cymem conda-forge/win-64::cymem-2.0.5-py38h885f38d_1
> cython-blis conda-forge/win-64::cython-blis-0.7.4-py38h347fdf6_0
> dataclasses conda-forge/noarch::dataclasses-0.8-pyhc8e2a94_1
> google-api-core conda-forge/noarch::google-api-core-1.26.3-pyhd8ed1ab_0
> google-auth conda-forge/noarch::google-auth-1.30.0-pyh44b312d_0
> google-cloud-core conda-forge/noarch::google-cloud-core-1.5.0-pyhd3deb0d_0
> google-cloud-stor~ conda-forge/noarch::google-cloud-storage-1.19.0-py_0
> google-crc32c conda-forge/win-64::google-crc32c-1.1.2-py38h554a69a_0
> google-resumable-~ conda-forge/noarch::google-resumable-media-1.2.0-pyhd3deb0d_0
> googleapis-common~ conda-forge/win-64::googleapis-common-protos-1.53.0-py38h5b57dd5_0
> grpcio conda-forge/win-64::grpcio-1.38.0-py38he5377a8_0
> idna conda-forge/noarch::idna-2.10-pyh9f0ad1d_0
> intel-openmp conda-forge/win-64::intel-openmp-2021.2.0-h57928b3_616
> jinja2 conda-forge/noarch::jinja2-3.0.1-pyhd8ed1ab_0
> jmespath conda-forge/noarch::jmespath-0.10.0-pyh9f0ad1d_0
> libblas conda-forge/win-64::libblas-3.9.0-9_mkl
> libcblas conda-forge/win-64::libcblas-3.9.0-9_mkl
> libcrc32c conda-forge/win-64::libcrc32c-1.1.1-h0e60522_2
> liblapack conda-forge/win-64::liblapack-3.9.0-9_mkl
> libprotobuf conda-forge/win-64::libprotobuf-3.17.1-h7755175_0
> markupsafe conda-forge/win-64::markupsafe-2.0.1-py38h294d835_0
> mkl conda-forge/win-64::mkl-2021.2.0-hb70f87d_389
> multidict conda-forge/win-64::multidict-5.1.0-py38h294d835_1
> murmurhash conda-forge/win-64::murmurhash-1.0.5-py38h885f38d_0
> numpy conda-forge/win-64::numpy-1.20.3-py38h09042cb_0
> packaging conda-forge/noarch::packaging-20.9-pyh44b312d_0
> pathy conda-forge/noarch::pathy-0.5.2-pyhd8ed1ab_0
> preshed conda-forge/win-64::preshed-3.0.5-py38h885f38d_0
> protobuf conda-forge/win-64::protobuf-3.17.1-py38h885f38d_0
> pyasn1 conda-forge/noarch::pyasn1-0.4.8-py_0
> pyasn1-modules conda-forge/noarch::pyasn1-modules-0.2.7-py_0
> pycparser conda-forge/noarch::pycparser-2.20-pyh9f0ad1d_2
> pydantic conda-forge/win-64::pydantic-1.7.3-py38h294d835_1
> pyopenssl conda-forge/noarch::pyopenssl-20.0.1-pyhd8ed1ab_0
> pyparsing conda-forge/noarch::pyparsing-2.4.7-pyh9f0ad1d_0
> pysocks conda-forge/win-64::pysocks-1.7.1-py38haa244fe_3
> python-dateutil conda-forge/noarch::python-dateutil-2.8.1-py_0
> python_abi conda-forge/win-64::python_abi-3.8-1_cp38
> pytz conda-forge/noarch::pytz-2021.1-pyhd8ed1ab_0
> requests conda-forge/noarch::requests-2.25.1-pyhd3deb0d_0
> rsa conda-forge/noarch::rsa-4.7.2-pyh44b312d_0
> s3transfer conda-forge/noarch::s3transfer-0.4.2-pyhd8ed1ab_0
> shellingham conda-forge/noarch::shellingham-1.4.0-pyh44b312d_0
> six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
> smart_open conda-forge/noarch::smart_open-2.2.1-pyh9f0ad1d_0
> spacy conda-forge/win-64::spacy-3.0.6-py38h2f20550_0
> spacy-legacy conda-forge/noarch::spacy-legacy-3.0.5-pyhd8ed1ab_0
> tbb conda-forge/win-64::tbb-2021.2.0-h2d74725_0
> thinc conda-forge/win-64::thinc-8.0.3-py38h2f20550_1
> tqdm conda-forge/noarch::tqdm-4.61.0-pyhd8ed1ab_0
> typer conda-forge/noarch::typer-0.3.2-pyhd8ed1ab_0
> typing-extensions conda-forge/noarch::typing-extensions-3.7.4.3-0
> typing_extensions conda-forge/noarch::typing_extensions-3.7.4.3-py_0
> urllib3 conda-forge/noarch::urllib3-1.26.4-pyhd8ed1ab_0
> wasabi conda-forge/noarch::wasabi-0.8.2-pyh44b312d_0
> win_inet_pton conda-forge/win-64::win_inet_pton-1.1.0-py38haa244fe_2
> yarl conda-forge/win-64::yarl-1.6.3-py38h294d835_1
> zlib conda-forge/win-64::zlib-1.2.11-h62dcd97_1010
>
> The following packages will be UPDATED:
>
> catalogue pkgs/main::catalogue-1.0.0-py38_1 --> conda-forge::catalogue-2.0.4-py38haa244fe_0
> certifi pkgs/main::certifi-2020.12.5-py38haa9~ --> conda-forge::certifi-2020.12.5-py38haa244fe_1
>
> The following packages will be SUPERSEDED by a higher-priority channel:
>
> ca-certificates pkgs/main::ca-certificates-2021.4.13-~ --> conda-forge::ca-certificates-2020.12.5-h5b45459_0
> openssl pkgs/main::openssl-1.1.1k-h2bbff1b_0 --> conda-forge::openssl-1.1.1k-h8ffe710_0
>
>
> Proceed ([y]/n)? y
>
>
> Downloading and Extracting Packages
> spacy-3.0.6 | 9.2 MB | ############################################################################################## | 100%
> pyasn1-0.4.8 | 53 KB | ############################################################################################## | 100%
> yarl-1.6.3 | 136 KB | ############################################################################################## | 100%
> botocore-1.20.80 | 4.6 MB | ############################################################################################## | 100%
> boto3-1.17.80 | 70 KB | ############################################################################################## | 100%
> Preparing transaction: done
> Verifying transaction: done
> Executing transaction: done
> (natlang) PS C:\> python --version
> Python 3.8.10
> (natlang) PS C:\> python -m spacy download en_core_sm
> Traceback (most recent call last):
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\runpy.py", line 185, in _run_module_as_main
> mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\runpy.py", line 144, in _get_module_details
> return _get_module_details(pkg_main_name, error)
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\runpy.py", line 111, in _get_module_details
> __import__(pkg_name)
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\site-packages\spacy\__init__.py", line 10, in <module>
> from thinc.api import prefer_gpu, require_gpu, require_cpu # noqa: F401
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\site-packages\thinc\__init__.py", line 5, in <module>
> from .config import registry
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\site-packages\thinc\config.py", line 14, in <module>
> import srsly
> File "C:\Users\Doug\AppData\Local\Programs\Python\Python38\Lib\site-packages\srsly\__init__.py", line 1, in <module>
> from ._json_api import read_json, read_gzip_json, write_json, write_gzip_json
> File "C:\Users\Doug\AppData\Local\Programs\Python\Python38\Lib\site-packages\srsly\_json_api.py", line 6, in <module>
> from . import ujson
> File "C:\Users\Doug\AppData\Local\Programs\Python\Python38\Lib\site-packages\srsly\ujson\__init__.py", line 1, in <module>
> from .ujson import decode, encode, dump, dumps, load, loads # noqa: F401
> ModuleNotFoundError: No module named 'srsly.ujson.ujson'
> (natlang) PS C:\>(natlang) PS C:\>
> (natlang) PS C:\> conda install -c conda-forge spacy
> Collecting package metadata (current_repodata.json): done
> Solving environment: done
>
> ## Package Plan ##
>
> environment location: C:\Users\Doug\miniconda3\envs\natlang
>
> added / updated specs:
> - spacy
>
>
> The following packages will be downloaded:
>
> package | build
> ---------------------------|-----------------
> boto3-1.17.80 | pyhd8ed1ab_0 70 KB conda-forge
> botocore-1.20.80 | pyhd8ed1ab_0 4.6 MB conda-forge
> pyasn1-0.4.8 | py_0 53 KB conda-forge
> spacy-3.0.6 | py38h2f20550_0 9.2 MB conda-forge
> yarl-1.6.3 | py38h294d835_1 136 KB conda-forge
> ------------------------------------------------------------
> Total: 14.1 MB
>
> The following NEW packages will be INSTALLED:
>
> aiohttp conda-forge/win-64::aiohttp-3.7.4-py38h294d835_0
> async-timeout conda-forge/noarch::async-timeout-3.0.1-py_1000
> attrs conda-forge/noarch::attrs-21.2.0-pyhd8ed1ab_0
> boto conda-forge/noarch::boto-2.49.0-py_0
> boto3 conda-forge/noarch::boto3-1.17.80-pyhd8ed1ab_0
> botocore conda-forge/noarch::botocore-1.20.80-pyhd8ed1ab_0
> brotlipy conda-forge/win-64::brotlipy-0.7.0-py38h294d835_1001
> bz2file conda-forge/noarch::bz2file-0.98-py_0
> cachetools conda-forge/noarch::cachetools-4.2.2-pyhd8ed1ab_0
> cffi conda-forge/win-64::cffi-1.14.5-py38hd8c33c5_0
> chardet conda-forge/win-64::chardet-4.0.0-py38haa244fe_1
> click conda-forge/noarch::click-7.1.2-pyh9f0ad1d_0
> colorama conda-forge/noarch::colorama-0.4.4-pyh9f0ad1d_0
> cryptography conda-forge/win-64::cryptography-3.4.7-py38hd7da0ea_0
> cymem conda-forge/win-64::cymem-2.0.5-py38h885f38d_1
> cython-blis conda-forge/win-64::cython-blis-0.7.4-py38h347fdf6_0
> dataclasses conda-forge/noarch::dataclasses-0.8-pyhc8e2a94_1
> google-api-core conda-forge/noarch::google-api-core-1.26.3-pyhd8ed1ab_0
> google-auth conda-forge/noarch::google-auth-1.30.0-pyh44b312d_0
> google-cloud-core conda-forge/noarch::google-cloud-core-1.5.0-pyhd3deb0d_0
> google-cloud-stor~ conda-forge/noarch::google-cloud-storage-1.19.0-py_0
> google-crc32c conda-forge/win-64::google-crc32c-1.1.2-py38h554a69a_0
> google-resumable-~ conda-forge/noarch::google-resumable-media-1.2.0-pyhd3deb0d_0
> googleapis-common~ conda-forge/win-64::googleapis-common-protos-1.53.0-py38h5b57dd5_0
> grpcio conda-forge/win-64::grpcio-1.38.0-py38he5377a8_0
> idna conda-forge/noarch::idna-2.10-pyh9f0ad1d_0
> intel-openmp conda-forge/win-64::intel-openmp-2021.2.0-h57928b3_616
> jinja2 conda-forge/noarch::jinja2-3.0.1-pyhd8ed1ab_0
> jmespath conda-forge/noarch::jmespath-0.10.0-pyh9f0ad1d_0
> libblas conda-forge/win-64::libblas-3.9.0-9_mkl
> libcblas conda-forge/win-64::libcblas-3.9.0-9_mkl
> libcrc32c conda-forge/win-64::libcrc32c-1.1.1-h0e60522_2
> liblapack conda-forge/win-64::liblapack-3.9.0-9_mkl
> libprotobuf conda-forge/win-64::libprotobuf-3.17.1-h7755175_0
> markupsafe conda-forge/win-64::markupsafe-2.0.1-py38h294d835_0
> mkl conda-forge/win-64::mkl-2021.2.0-hb70f87d_389
> multidict conda-forge/win-64::multidict-5.1.0-py38h294d835_1
> murmurhash conda-forge/win-64::murmurhash-1.0.5-py38h885f38d_0
> numpy conda-forge/win-64::numpy-1.20.3-py38h09042cb_0
> packaging conda-forge/noarch::packaging-20.9-pyh44b312d_0
> pathy conda-forge/noarch::pathy-0.5.2-pyhd8ed1ab_0
> preshed conda-forge/win-64::preshed-3.0.5-py38h885f38d_0
> protobuf conda-forge/win-64::protobuf-3.17.1-py38h885f38d_0
> pyasn1 conda-forge/noarch::pyasn1-0.4.8-py_0
> pyasn1-modules conda-forge/noarch::pyasn1-modules-0.2.7-py_0
> pycparser conda-forge/noarch::pycparser-2.20-pyh9f0ad1d_2
> pydantic conda-forge/win-64::pydantic-1.7.3-py38h294d835_1
> pyopenssl conda-forge/noarch::pyopenssl-20.0.1-pyhd8ed1ab_0
> pyparsing conda-forge/noarch::pyparsing-2.4.7-pyh9f0ad1d_0
> pysocks conda-forge/win-64::pysocks-1.7.1-py38haa244fe_3
> python-dateutil conda-forge/noarch::python-dateutil-2.8.1-py_0
> python_abi conda-forge/win-64::python_abi-3.8-1_cp38
> pytz conda-forge/noarch::pytz-2021.1-pyhd8ed1ab_0
> requests conda-forge/noarch::requests-2.25.1-pyhd3deb0d_0
> rsa conda-forge/noarch::rsa-4.7.2-pyh44b312d_0
> s3transfer conda-forge/noarch::s3transfer-0.4.2-pyhd8ed1ab_0
> shellingham conda-forge/noarch::shellingham-1.4.0-pyh44b312d_0
> six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
> smart_open conda-forge/noarch::smart_open-2.2.1-pyh9f0ad1d_0
> spacy conda-forge/win-64::spacy-3.0.6-py38h2f20550_0
> spacy-legacy conda-forge/noarch::spacy-legacy-3.0.5-pyhd8ed1ab_0
> tbb conda-forge/win-64::tbb-2021.2.0-h2d74725_0
> thinc conda-forge/win-64::thinc-8.0.3-py38h2f20550_1
> tqdm conda-forge/noarch::tqdm-4.61.0-pyhd8ed1ab_0
> typer conda-forge/noarch::typer-0.3.2-pyhd8ed1ab_0
> typing-extensions conda-forge/noarch::typing-extensions-3.7.4.3-0
> typing_extensions conda-forge/noarch::typing_extensions-3.7.4.3-py_0
> urllib3 conda-forge/noarch::urllib3-1.26.4-pyhd8ed1ab_0
> wasabi conda-forge/noarch::wasabi-0.8.2-pyh44b312d_0
> win_inet_pton conda-forge/win-64::win_inet_pton-1.1.0-py38haa244fe_2
> yarl conda-forge/win-64::yarl-1.6.3-py38h294d835_1
> zlib conda-forge/win-64::zlib-1.2.11-h62dcd97_1010
>
> The following packages will be UPDATED:
>
> catalogue pkgs/main::catalogue-1.0.0-py38_1 --> conda-forge::catalogue-2.0.4-py38haa244fe_0
> certifi pkgs/main::certifi-2020.12.5-py38haa9~ --> conda-forge::certifi-2020.12.5-py38haa244fe_1
>
> The following packages will be SUPERSEDED by a higher-priority channel:
>
> ca-certificates pkgs/main::ca-certificates-2021.4.13-~ --> conda-forge::ca-certificates-2020.12.5-h5b45459_0
> openssl pkgs/main::openssl-1.1.1k-h2bbff1b_0 --> conda-forge::openssl-1.1.1k-h8ffe710_0
>
>
> Proceed ([y]/n)? y
>
>
> Downloading and Extracting Packages
> spacy-3.0.6 | 9.2 MB | ############################################################################################## | 100%
> pyasn1-0.4.8 | 53 KB | ############################################################################################## | 100%
> yarl-1.6.3 | 136 KB | ############################################################################################## | 100%
> botocore-1.20.80 | 4.6 MB | ############################################################################################## | 100%
> boto3-1.17.80 | 70 KB | ############################################################################################## | 100%
> Preparing transaction: done
> Verifying transaction: done
> Executing transaction: done
> (natlang) PS C:\> python --version
> Python 3.8.10
> (natlang) PS C:\> python -m spacy download en_core_sm
> Traceback (most recent call last):
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\runpy.py", line 185, in _run_module_as_main
> mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\runpy.py", line 144, in _get_module_details
> return _get_module_details(pkg_main_name, error)
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\runpy.py", line 111, in _get_module_details
> __import__(pkg_name)
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\site-packages\spacy\__init__.py", line 10, in <module>
> from thinc.api import prefer_gpu, require_gpu, require_cpu # noqa: F401
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\site-packages\thinc\__init__.py", line 5, in <module>
> from .config import registry
> File "C:\Users\Doug\miniconda3\envs\natlang\lib\site-packages\thinc\config.py", line 14, in <module>
> import srsly
> File "C:\Users\Doug\AppData\Local\Programs\Python\Python38\Lib\site-packages\srsly\__init__.py", line 1, in <module>
> from ._json_api import read_json, read_gzip_json, write_json, write_gzip_json
> File "C:\Users\Doug\AppData\Local\Programs\Python\Python38\Lib\site-packages\srsly\_json_api.py", line 6, in <module>
> from . import ujson
> File "C:\Users\Doug\AppData\Local\Programs\Python\Python38\Lib\site-packages\srsly\ujson\__init__.py", line 1, in <module>
> from .ujson import decode, encode, dump, dumps, load, loads # noqa: F401
> ModuleNotFoundError: No module named 'srsly.ujson.ujson'
> (natlang) PS C:\>
|
Beta Was this translation helpful? Give feedback.
-
Hi:
Yes, that solved the problem! Thanks a lot for your help and rapid
response.
Best regards,
Doug
…------ Original Message ------
From: "polm" ***@***.***>
To: "explosion/spaCy" ***@***.***>
Cc: "diggymacd" ***@***.***>; "Author"
***@***.***>
Sent: 5/26/2021 10:22:07 PM
Subject: Re: [explosion/spaCy] Can't load pipeline (#8199)
Thanks for the detailed info.
If you look at the output, you can see that your spaCy and Thinc
installs are in conda, but your srsly is in your non-conda Python env.
File "C:\Users\Doug\miniconda3\envs\natlang\lib\site-packages\spacy\__init__.py", line 10, in <module>
vs
File "C:\Users\Doug\AppData\Local\Programs\Python\Python38\Lib\site-packages\srsly\__init__.py", line 1, in <module>
Can you try uninstalling srsly with pip and then installing it with
conda directly?
I don't generally use conda, but mixing conda and pip can cause weird
issues like this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8199 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOSTQIQNZURR5Y3RNBGETTTPXJH7ANCNFSM45Q3J7UQ>.
|
Beta Was this translation helpful? Give feedback.
-
In general --no-binary option for pip helps me for this kind of issues:
Pip compiles wheel rather than download ready one from repository. More information about --no-binary option: https://pip.pypa.io/en/latest/cli/pip_install/#cmdoption-no-binary |
Beta Was this translation helpful? Give feedback.
Sorry you're having trouble with install. I've never heard of an issue like that before. Can you clarify some details?
import srsly.ujson
?