pip install line-profiler
若遇到如下错误:
_line_profiler.c: In function ‘__Pyx__ExceptionSave’:
_line_profiler.c:7890:21: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
*type = tstate->exc_type;
^~~~~~~~
curexc_type
_line_profiler.c:7964:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
tstate->exc_traceback = local_tb;
^~~~~~~~~~~~~
curexc_traceback
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/user/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-a20b3hu6/line-profiler/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-bmeew5ig/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-a20b3hu6/line-profiler/
参考Build from pypi fails for Python3.7 #127
执行:pip install Cython git+https://github.com/rkern/line_profiler.git
网友评论