Spacy: Problems installing spacy 1.8.2 on centos with anaconda

Created on 16 May 2017  Â·  7Comments  Â·  Source: explosion/spaCy

This is the reporoduction case:

conda install spacy

[@ ids]$ conda install spacy
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment /anaconda3:

The following NEW packages will be INSTALLED:

    spacy: 1.8.2-np111py36_0 conda-forge

Proceed ([y]/n)?

Linking packages ...
[      COMPLETE      ]

[@ ids]$ python -mspacy
Traceback (most recent call last):
  File "/anaconda3/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/anaconda3/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/anaconda3/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/anaconda3/lib/python3.6/site-packages/spacy/__init__.py", line 4, in <module>
    from . import util
  File "/anaconda3/lib/python3.6/site-packages/spacy/util.py", line 5, in <module>
    import regex as re
  File "/anaconda3/lib/python3.6/site-packages/regex.py", line 394, in <module>
    import _regex_core
  File "/anaconda3/lib/python3.6/site-packages/_regex_core.py", line 21, in <module>
    import _regex
ImportError: /anaconda3/lib/python3.6/site-packages/_regex.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_AdjustIndices
[@ ids]$ python -m spacy
Traceback (most recent call last):
  File "/anaconda3/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/anaconda3/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/anaconda3/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/anaconda3/lib/python3.6/site-packages/spacy/__init__.py", line 4, in <module>
    from . import util
  File "/anaconda3/lib/python3.6/site-packages/spacy/util.py", line 5, in <module>
    import regex as re
  File "/anaconda3/lib/python3.6/site-packages/regex.py", line 394, in <module>
    import _regex_core
  File "/anaconda3/lib/python3.6/site-packages/_regex_core.py", line 21, in <module>
    import _regex
ImportError: /anaconda3/lib/python3.6/site-packages/_regex.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_AdjustIndices

If you're looking for help with your code, consider posting a question on StackOverflow instead:
http://stackoverflow.com/questions/tagged/spacy -->

Your Environment

  • Operating System: centos 6
  • Python Version Used: 3.6
  • spaCy Version Used: 1.8.2
  • Environment Information:
install

Most helpful comment

@psychobolt, I got a similar issue. As far as I can see, when installing spaCy with conda, there is a conflict with regex. Im in Ubuntu by the way.

I had just updated spaCy following the instructions in your website:

conda config --add channels conda-forge
conda install spacy
python -m spacy download en

When I run the latest command, I got the error:
ImportError: /home/user/anaconda3/lib/python3.6/site-packages/_regex.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_AdjustIndices
Then I followed the instructions in the previous message:

apt-get update
apt-get install -y build-essential  # Note that the package is called "essential" and not "essentials"!

and I run this command instead:
conda update regex

This asked:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    regex-2017.04.29           |           py36_0         659 KB  conda-forge
    spacy-1.7.3                |      np111py36_0         7.9 MB  conda-forge
    ------------------------------------------------------------
                                           Total:         8.6 MB

The following packages will be UPDATED:

    regex: 2017.04.05-py36_0 conda-forge --> 2017.04.29-py36_0 conda-forge

The following packages will be DOWNGRADED due to dependency conflicts:

    spacy: 1.8.2-np111py36_0 conda-forge --> 1.7.3-np111py36_0 conda-forge

Proceed ([y]/n)? y

After I accepted, I could finally run
python -m spacy download en

without an error.

All 7 comments

conda --version
conda 4.2.13

Try,

apt-get update
apt-get install -y build-essential
pip install --ignore-installed regex

@psychobolt, I got a similar issue. As far as I can see, when installing spaCy with conda, there is a conflict with regex. Im in Ubuntu by the way.

I had just updated spaCy following the instructions in your website:

conda config --add channels conda-forge
conda install spacy
python -m spacy download en

When I run the latest command, I got the error:
ImportError: /home/user/anaconda3/lib/python3.6/site-packages/_regex.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_AdjustIndices
Then I followed the instructions in the previous message:

apt-get update
apt-get install -y build-essential  # Note that the package is called "essential" and not "essentials"!

and I run this command instead:
conda update regex

This asked:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    regex-2017.04.29           |           py36_0         659 KB  conda-forge
    spacy-1.7.3                |      np111py36_0         7.9 MB  conda-forge
    ------------------------------------------------------------
                                           Total:         8.6 MB

The following packages will be UPDATED:

    regex: 2017.04.05-py36_0 conda-forge --> 2017.04.29-py36_0 conda-forge

The following packages will be DOWNGRADED due to dependency conflicts:

    spacy: 1.8.2-np111py36_0 conda-forge --> 1.7.3-np111py36_0 conda-forge

Proceed ([y]/n)? y

After I accepted, I could finally run
python -m spacy download en

without an error.

@alfonsomhc

Ah good catch, made an typo 'build-essentials' should be 'build-essential'

In my approach I used pip to upgrade regex, but conda would work as well.

Yes, but the problem is that I had to dowgrade spaCy for regex to work. So
it was not a real fix...
On Wed, 31 May 2017 at 17:56, psychobolt notifications@github.com wrote:

@alfonsomhc https://github.com/alfonsomhc

Ah good catch, made an typo 'essentials' should be 'essential'

In my approach I used pip to upgrade regex, but conda would work as well.

—
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/explosion/spaCy/issues/1062#issuecomment-305232685,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADglf4MOGLO3PlrBOnSF4cSu2sKY6WCqks5r_Y2sgaJpZM4NcWLl
.

Merging this with the general regex dependency issue #1184. Sorry this is so annoying – working on a fix!

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings