Thriftpy / thriftpy2

Pure python approach of Apache Thrift.
MIT License
561 stars 89 forks source link

pip install thriftpy2 Error #165

Open WanXinTao opened 3 years ago

WanXinTao commented 3 years ago

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?

ethe commented 3 years ago

which version of cython you use

WanXinTao commented 3 years ago

Python 2.7.13

which version of cython you use

WanXinTao commented 3 years ago

cython

Name: Cython Version: 0.17.4

aisk commented 3 years ago

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

xxd819240366 commented 2 years ago

@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?

aisk commented 2 years ago

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

xxd819240366 commented 2 years ago

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

chenyanlann commented 2 years ago

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

aisk commented 2 years ago

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.

chenyanlann commented 2 years ago

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

DCSong commented 2 months ago

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

WanXinTao commented 2 months ago

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

aisk commented 2 months ago

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.