Skip to content

CodeIntel fails to install on both python 2 AND python 3 on macOS 10.13.5 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue Jul 6, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 6, 2018

See for python 2 error, issue #4

$ python --version
Python 2.7.15

$ pip install --upgrade --pre CodeIntel
Collecting CodeIntel
  Using cached https://files.pythonhosted.org/packages/b9/e1/e8de333336f3b9ff2d3efa3be1468d633f7a504ff4787c2159470ab7157c/CodeIntel-2.0.0-cp27-cp27m-macosx_10_12_x86_64.whl
Collecting inflector (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/c4/51/d3cc209c8a0471ef5a04ac750f203b5b486fc70e6cb51c96d99decd49bc4/Inflector-2.0.12.tar.gz
Collecting chardet (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting clang (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/b2/2a/5ab52ae9d9e7684b66062e953a0cbdf326a35657aaf59cd31a09b7b86504/clang-6.0.0.1.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/z_/q30gz8bs17g3p15d_2cv08w80000gn/T/pip-install-U1WyMp/clang/setup.py", line 6, in <module>
        with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

See for python 3 errors issue #5:

Error 1 has to do with breaking changes in python 3.7:

$ pip3 install --upgrade --pre CodeIntel
Collecting CodeIntel
  Downloading https://files.pythonhosted.org/packages/0a/24/141db0d6c64453e6848849979b9c527d3547ad1552674763000e9da2a648/CodeIntel-2.0.0.tar.gz (20.7MB)
    100% |████████████████████████████████| 20.7MB 1.0MB/s 
Collecting 3to2 (from CodeIntel)
  Downloading https://files.pythonhosted.org/packages/8f/ab/58a363eca982c40e9ee5a7ca439e8ffc5243dde2ae660ba1ffdd4868026b/3to2-1.1.1.zip (78kB)
    100% |████████████████████████████████| 81kB 10.1MB/s 
Collecting applib (from CodeIntel)
  Downloading https://files.pythonhosted.org/packages/d4/20/67c3c98b557cfa2aa95dc0a9281989e6ab740a5058ee1f8a5f8febba8aaf/applib-1.2.tar.gz
Collecting chardet (from CodeIntel)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 9.0MB/s 
Collecting cmdln (from CodeIntel)
  Downloading https://files.pythonhosted.org/packages/26/23/7654219ac89aa48190341b7c7114fea21e21889693def5f625ef2a218d5d/cmdln-2.0.0.zip (61kB)
    100% |████████████████████████████████| 61kB 12.1MB/s 
Collecting esprima (from CodeIntel)
  Downloading https://files.pythonhosted.org/packages/86/61/ff7a62bcf79cebb6faf42c0ff28756c152a9dcf7244019093ca4513d80ee/esprima-4.0.0.tar.gz (46kB)
    100% |████████████████████████████████| 51kB 10.9MB/s 
    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-kwyha1ca/esprima/setup.py", line 8, in <module>
        from esprima import version
      File "/private/var/folders/7n/wgzp5xg5643g24cjx93sqlq00000gn/T/pip-install-kwyha1ca/esprima/esprima/__init__.py", line 29, in <module>
        from .esprima import *  # NOQA
      File "/private/var/folders/7n/wgzp5xg5643g24cjx93sqlq00000gn/T/pip-install-kwyha1ca/esprima/esprima/esprima.py", line 26, in <module>
        from .comment_handler import CommentHandler
      File "/private/var/folders/7n/wgzp5xg5643g24cjx93sqlq00000gn/T/pip-install-kwyha1ca/esprima/esprima/comment_handler.py", line 27, in <module>
        from .nodes import Node
      File "/private/var/folders/7n/wgzp5xg5643g24cjx93sqlq00000gn/T/pip-install-kwyha1ca/esprima/esprima/nodes.py", line 61
        self.async = False
                 ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7n/wgzp5xg5643g24cjx93sqlq00000gn/T/pip-install-kwyha1ca/esprima/

This can be worked around by using python 3.6.5 either by using brew switch 3.6.5 or by using this pyenv workaround.

However installation still fails:

$ 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.

@ghost
Copy link
Author

ghost commented Jul 6, 2018

There is a workaround for python2 I found (see this comment):

Found a workaround: just tell pip to install version 5 of clang: pip install clang==5.0 then run pip install --upgrade --pre CodeIntel and it should work again.

@hongnguyenhuu96
Copy link

I have the same issue as you, but install clang==5.0 does not solve the problem

python
Python 2.7.10 (default, Oct  6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin

python3
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin

pip install clang==5.0
Requirement already satisfied: clang==5.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (5.0)

pip install --upgrade --pre CodeIntel
Collecting CodeIntel
  Using cached https://files.pythonhosted.org/packages/0a/24/141db0d6c64453e6848849979b9c527d3547ad1552674763000e9da2a648/CodeIntel-2.0.0.tar.gz
Collecting 3to2 (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/8f/ab/58a363eca982c40e9ee5a7ca439e8ffc5243dde2ae660ba1ffdd4868026b/3to2-1.1.1.zip
Collecting applib (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/d4/20/67c3c98b557cfa2aa95dc0a9281989e6ab740a5058ee1f8a5f8febba8aaf/applib-1.2.tar.gz
Collecting chardet (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting cmdln (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/26/23/7654219ac89aa48190341b7c7114fea21e21889693def5f625ef2a218d5d/cmdln-2.0.0.zip
Collecting esprima (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/86/61/ff7a62bcf79cebb6faf42c0ff28756c152a9dcf7244019093ca4513d80ee/esprima-4.0.0.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/xr/gk87r_kj0298gk7hzrm6tjt00000gn/T/pip-install-dcoz6imw/esprima/setup.py", line 8, in <module>
        from esprima import version
      File "/private/var/folders/xr/gk87r_kj0298gk7hzrm6tjt00000gn/T/pip-install-dcoz6imw/esprima/esprima/__init__.py", line 29, in <module>
        from .esprima import *  # NOQA
      File "/private/var/folders/xr/gk87r_kj0298gk7hzrm6tjt00000gn/T/pip-install-dcoz6imw/esprima/esprima/esprima.py", line 26, in <module>
        from .comment_handler import CommentHandler
      File "/private/var/folders/xr/gk87r_kj0298gk7hzrm6tjt00000gn/T/pip-install-dcoz6imw/esprima/esprima/comment_handler.py", line 27, in <module>
        from .nodes import Node
      File "/private/var/folders/xr/gk87r_kj0298gk7hzrm6tjt00000gn/T/pip-install-dcoz6imw/esprima/esprima/nodes.py", line 61
        self.async = False
                 ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/xr/gk87r_kj0298gk7hzrm6tjt00000gn/T/pip-install-dcoz6imw/esprima/

@ghost
Copy link
Author

ghost commented Aug 9, 2018

Your install fails because of esprima, not because of clang. This time the error is probably because async became a protected keyword. See #5.

@BB-000
Copy link

BB-000 commented Sep 9, 2019

Get same error with install clang==5.0

Collecting CodeIntel
  Using cached https://files.pythonhosted.org/packages/b9/e1/e8de333336f3b9ff2d3efa3be1468d633f7a504ff4787c2159470ab7157c/CodeIntel-2.0.0-cp27-cp27m-macosx_10_12_x86_64.whl
Collecting inflector (from CodeIntel)
  Using cached https://files.pythonhosted.org/packages/c5/d3/7825dfa48460fead643dc88db9884a247124bebcd3ffa050037b56f82819/Inflector-3.0.0.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/5y/1djp_v516y17kqnjkdwjjhpm0000gn/T/pip-install-HpWip2/inflector/setup.py", line 6, in <module>
        README = open(os.path.join(here, 'README.md'), 'r', encoding='utf-8').read()
    TypeError: 'encoding' is an invalid keyword argument for this function
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/5y/1djp_v516y17kqnjkdwjjhpm0000gn/T/pip-install-HpWip2/inflector/

@ghost
Copy link

ghost commented Oct 28, 2019

Inflector-3.0.0.tar.gz could not be installed via the pip2 due to python2's built-in open does not have the encoding argument.
try:
pip2 install inflector==2.0.12
pip2 install --upgrade --pre CodeIntel==2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants