thriftpy2 icon indicating copy to clipboard operation
thriftpy2 copied to clipboard

pip install thriftpy2 Error

Open WanXinTao opened this issue 4 years ago • 13 comments

ERROR: Command errored out with exit status 1: command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yTiVHp/thriftpy2/setup.py'"'"'; file='"'"'/tmp/pip-install-yTiVHp/thriftpy2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-_HKYAq cwd: /tmp/pip-install-yTiVHp/thriftpy2/ Complete output (39 lines):

Error compiling Cython file:
------------------------------------------------------------
...
        char *buf
        int cur, buf_size, data_size

        void move_to_start(self)
        void clean(self)
        int write(self, int sz, const char *value)
                                          ^
------------------------------------------------------------

thriftpy2/transport/cybase.pxd:12:43: Expected ')', found '*'

Error compiling Cython file:
------------------------------------------------------------
...

    cdef void clean(self):
        self.cur = 0
        self.data_size = 0

    cdef int write(self, int sz, const char *value):
                                           ^
------------------------------------------------------------

thriftpy2/transport/cybase.pyx:25:44: Expected ')', found '*'
Compiling thriftpy2/transport/cybase.pyx because it depends on /opt/tiger/ss_lib/python_package/lib/python2.7/site-packages/Cython/Includes/libc/string.pxd.
Cythonizing thriftpy2/transport/cybase.pyx
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-yTiVHp/thriftpy2/setup.py", line 59, in <module>
    cythonize("thriftpy2/transport/cybase.pyx")
  File "/opt/tiger/ss_lib/python_package/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 667, in cythonize
    cythonize_one(*args[1:])
  File "/opt/tiger/ss_lib/python_package/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 731, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: thriftpy2/transport/cybase.pyx
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

How to solve this problem?

WanXinTao avatar Feb 27 '21 03:02 WanXinTao

which version of cython you use

ethe avatar Feb 27 '21 04:02 ethe

Python 2.7.13

which version of cython you use

WanXinTao avatar Feb 27 '21 04:02 WanXinTao

cython

Name: Cython Version: 0.17.4

WanXinTao avatar Feb 27 '21 04:02 WanXinTao

I think you are using GCC4. Please upgrade GCC version.

aisk avatar Feb 27 '21 07:02 aisk

@WanXinTao @ethe @aisk I have the same problem with you, same python version, the cython version is 0.29.23。Did you solve this problem?

lionel-xie avatar Jul 14 '21 12:07 lionel-xie

@xxd819240366 upgrade GCC to higher version should resolve this issue.

aisk avatar Jul 15 '21 08:07 aisk

@aisk OK, thanks. I'll try it.

lionel-xie avatar Jul 15 '21 09:07 lionel-xie

I think it's because cython version. I encounter the same problem using cython==0.17.4. Upgrading the cython version solved the problem @aisk @xxd819240366

chenyanlann avatar Jan 17 '22 13:01 chenyanlann

Cool @chenyanlann , I think we should add a pyproject.toml file to specify the third party dependencies' versions which been used when building, like cython.

aisk avatar Jan 17 '22 13:01 aisk

thanks for reply More information can be found here: https://github.com/cython/cython/pull/203 0.18 change log

chenyanlann avatar Jan 17 '22 13:01 chenyanlann

I meet the same problem with python2.7.18, cython 3.0.10, GCC 8.3.0

DCSong avatar Apr 23 '24 07:04 DCSong

您好,感谢您给我来信,您的邮件我已收到。Thanks

WanXinTao avatar Apr 23 '24 07:04 WanXinTao

I meet the same problem with python2.7.18, cython 3.0.10, GCC 8.3.0

Please paste you error log. If it's not exactly same as the issue shows, please open a new issue.

aisk avatar Apr 23 '24 14:04 aisk