Open lx-s opened 6 years ago
Same on Mac 10.13.5 with homebrew-installed Python 3.7. There seem to have been some syntax/api changes in Python 3.7, and it breaks multiple packages, including the esprima package used by codeintel.
A temporary workaround is to install pyenv
and switch to a version of Python where esprima
doesn't freak out during install.
Here's what I did:
brew install pyenv
pyenv install 3.6.5
pyenv global 3.6.5
eval "$(pyenv init -)"
pip install --upgrade --pre CodeIntel
Don't forget to switch back to your default brew/system Python with pyenv global system
afterwards, unless you want to sit on 3.6.5.
This might or might not be related: But switching back to 3.6.5 via @peterkos workaround or by doing a brew switch 3.6.5
if available still yields a different problem for me on macos 10.13.5:
$ pip3 install --upgrade --pre CodeIntel
Collecting CodeIntel
Using cached https://files.pythonhosted.org/packages/85/58/8e708906b4a2f4c811691f791f8f409f703c3ea1bd2a55373eb45077324e/CodeIntel-2.0.0-cp36-cp36m-macosx_10_12_x86_64.whl
Collecting 3to2 (from CodeIntel)
Using cached https://files.pythonhosted.org/packages/8f/ab/58a363eca982c40e9ee5a7ca439e8ffc5243dde2ae660ba1ffdd4868026b/3to2-1.1.1.zip
Collecting libclang-py3 (from CodeIntel)
Using cached https://files.pythonhosted.org/packages/aa/73/d0cc2b5e896bf6ea152b2324d00963ec6b0b116bb5ed672018c0bacd97c0/libclang-py3-3.9.0.tar.gz
Collecting esprima (from CodeIntel)
Using cached https://files.pythonhosted.org/packages/86/61/ff7a62bcf79cebb6faf42c0ff28756c152a9dcf7244019093ca4513d80ee/esprima-4.0.0.tar.gz
Collecting zope.cachedescriptors (from CodeIntel)
Using cached https://files.pythonhosted.org/packages/81/6f/d668102e1bd4fba6cfb160e178477b4e5ade20ccac0b2b390d4f64d0bb9d/zope.cachedescriptors-4.3.1-py2.py3-none-any.whl
Collecting inflector (from CodeIntel)
Using cached https://files.pythonhosted.org/packages/c4/51/d3cc209c8a0471ef5a04ac750f203b5b486fc70e6cb51c96d99decd49bc4/Inflector-2.0.12.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/7n/wgzp5xg5643g24cjx93sqlq00000gn/T/pip-install-i8xj2h72/inflector/setup.py", line 6, in <module>
README = open(os.path.join(here, 'README.md')).read()
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 375: ordinal not in range(128)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7n/wgzp5xg5643g24cjx93sqlq00000gn/T/pip-install-i8xj2h72/inflector/
Looking at the repo for inflector I found an issue about python3 compatibility.
I ran python setup.py egg_info
on 3.6.5 in Inflector standalone and it worked just fine, as well as build & install on Inflector using 3.6.5. (I'm also on macOS 10.13.5).
❯ python setup.py egg_info
running egg_info
writing Inflector.egg-info/PKG-INFO
writing dependency_links to Inflector.egg-info/dependency_links.txt
writing top-level names to Inflector.egg-info/top_level.txt
reading manifest file 'Inflector.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Inflector.egg-info/SOURCES.txt'
Yeah it seems that async
and await
are now reserved keywords in Python 3.7 so unless those keywords are renamed in the esprima-python package it's not gonna work.
https://docs.python.org/3/whatsnew/3.7.html
Got it! Thank you! Could you help me with a a pull requests in https://github.com/Kronuz/esprima-python ?
Using Windows 10 and Python 3.7: