question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 2.7 support issues

See original GitHub issue

I am need to use Spacy in a python 2 environment, and installed it in a virtual environment. I have been using Mac for development. For a quick test, it reports the following error:

# -*- coding: utf-8 -*-

import spacy

nlp = spacy.load("en_core_web_sm")
doc = nlp("Autonomous cars shift insurance liability toward manufacturers")
for token in doc:
    print(token.text, token.dep_, token.head.text, token.head.pos_,
          [child for child in token.children])

The error messages:

Traceback (most recent call last):
  File "/Users/congminmin/nlp/wb2/spaCy/test.py", line 3, in <module>
    import spacy
  File "/Users/congminmin/nlp/wb2/spaCy/spacy/__init__.py", line 12, in <module>
    from . import pipeline
  File "/Users/congminmin/nlp/wb2/spaCy/spacy/pipeline/__init__.py", line 4, in <module>
    from .pipes import Tagger, DependencyParser, EntityRecognizer, EntityLinker
  File "pipes.pyx", line 25, in init spacy.pipeline.pipes
  File "/Users/congminmin/nlp/wb2/spaCy/spacy/pipeline/functions.py", line 4, in <module>
    from ..language import component
  File "/Users/congminmin/nlp/wb2/spaCy/spacy/language.py", line 31, in <module>
    from .lang.tokenizer_exceptions import TOKEN_MATCH, URL_MATCH
  File "/Users/congminmin/nlp/wb2/spaCy/spacy/lang/tokenizer_exceptions.py", line 62, in <module>
    URL_MATCH = re.compile("(?u)" + URL_PATTERN).match
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 194, in compile
    return _compile(pattern, flags)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 251, in _compile
    raise error, v # invalid expression
sre_constants.error: bad character range

The Spacy is compatible with python 2.7. Right?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lingvisacommented, Sep 24, 2020

Yes, I can close.

0reactions
github-actions[bot]commented, Nov 1, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sunsetting Python 2
As of January 1st, 2020 no new bug reports, fixes, or changes will be made to Python 2, and Python 2 is no...
Read more >
Extended Support Past Python 2 EOL - ActiveState
Without support, Python 2 codebases will continue to become less reliable and more vulnerable as security issues emerge over time. ActiveState's extended ...
Read more >
How to Secure Python 2 Past End of Life (EOL) with ActiveState
Answer: Official support and maintenance for Python 2 ended on January 1, 2020. The Python Software Foundation no longer offers bug fixes and ......
Read more >
Azure SDK Python packages support for Python 2.7 is ending ...
The Python Software Foundation (PSF) community announced the end of support of Python 2 "as of 01 January 2020, no new bug reports,...
Read more >
How is Python 2 supported in RHEL after 2020?
The PSF have announced that their "official" support of version 2 of the Python language ends on January 1st 2020 as described at:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found