rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.6k stars 254 forks source link

Build from pypi fails for Python3.7 #127

Open zefciu opened 6 years ago

zefciu commented 6 years ago

While it is possible to install line_profiler from source, installing it from PyPI fails. Probably a separate distribution for this version should be created. Message from pip:


    _line_profiler.c: In function ‘__Pyx__ExceptionSave’:
    _line_profiler.c:7890:19: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
         *type = tstate->exc_type;
                       ^
    _line_profiler.c:7891:20: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
         *value = tstate->exc_value;
                        ^
    _line_profiler.c:7892:17: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
         *tb = tstate->exc_traceback;
                     ^
    _line_profiler.c: In function ‘__Pyx__ExceptionReset’:
    _line_profiler.c:7899:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
         tmp_type = tstate->exc_type;
                          ^
    _line_profiler.c:7900:23: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
         tmp_value = tstate->exc_value;
                           ^
    _line_profiler.c:7901:20: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
         tmp_tb = tstate->exc_traceback;
                        ^
    _line_profiler.c:7902:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
         tstate->exc_type = type;
               ^
    _line_profiler.c:7903:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
         tstate->exc_value = value;
               ^
    _line_profiler.c:7904:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
         tstate->exc_traceback = tb;
               ^
    _line_profiler.c: In function ‘__Pyx__GetException’:
    _line_profiler.c:7959:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
         tmp_type = tstate->exc_type;
                          ^
    _line_profiler.c:7960:23: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
         tmp_value = tstate->exc_value;
                           ^
    _line_profiler.c:7961:20: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
         tmp_tb = tstate->exc_traceback;
                        ^
    _line_profiler.c:7962:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
         tstate->exc_type = local_type;
               ^
    _line_profiler.c:7963:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
         tstate->exc_value = local_value;
               ^
    _line_profiler.c:7964:11: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
         tstate->exc_traceback = local_tb;
               ^
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
  Rolling back uninstall of line-profiler
Command "/home/zefciu/.virtualenvs/lp/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-2y3fjp4e/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-1x7yigjj/install-record.txt --single-version-externally-managed --compile --install-headers /home/zefciu/.virtualenvs/lp/include/site/python3.7/line-profiler" failed with error code 1 in /tmp/pip-install-2y3fjp4e/line-profiler/```
tuky commented 6 years ago

I can confirm this issue and many others out there seem to have been fixed, e.g. https://github.com/numpy/numpy/issues/10500

beaugunderson commented 6 years ago

also confirming that PyPi installation fails but

pip install Cython git+https://github.com/rkern/line_profiler.git

succeeds

scoder commented 6 years ago

@rkern, would be nice to rebuild the existing sources with a recent Cython version and deploy it as a fix release to pypi. Also see the test fix in #129.

kawing-chiu commented 6 years ago

Same issue here. Cannot install line_profiler for python 3.7.

meownoid commented 5 years ago

Same issue.

phewdry commented 5 years ago

is cython required for line profiler? seems memory profiler is fine w/o afaik. Context: using in jupyter notebook/ipython environment (Mac OS Mojave)

Note: Doesn't seem ipython is even compatible w/ 3.7 yet. How are you guys using lineprofiler?

Update: pip3 install line_profiler returns this error (Is this related to Cython or solely from lineprofiler?):

screen shot 2018-11-30 at 1 55 57 pm

sudo pip3 install Cython git+https://github.com/rkern/line_profiler.git returns this error:

screen shot 2018-11-30 at 1 58 04 pm
holmrenser commented 5 years ago

This still happens

simonpercivall commented 5 years ago

A bad solution, I know, but I've published a package lp37 on PyPI to solve this issue.

ngoldbaum commented 5 years ago

Please do a release on pypi pretty please

caethan commented 5 years ago

Sorry folks, new baby has been limiting my time. Going to try to get these major fixes in but no guarantees on timing.

miozus commented 5 years ago

I have met this question tonight and cried until now, but it resolved by: pip install cython then sudo pip3 install Cython git+https://github.com/rkern/line_profiler.git lets have a look pip install line_profiler

Requirement already satisfied: line_profiler in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (2.1.1) Requirement already satisfied: IPython>=0.13 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from line_profiler) (7.2.0) Requirement already satisfied: appnope; sys_platform == "darwin" in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (0.1.0) Requirement already satisfied: jedi>=0.10 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (0.13.1) Requirement already satisfied: pickleshare in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (0.7.4) Requirement already satisfied: pexpect; sys_platform != "win32" in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (4.6.0) Requirement already satisfied: traitlets>=4.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (4.3.2) Requirement already satisfied: setuptools>=18.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (40.6.2) Requirement already satisfied: pygments in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (2.2.0) Requirement already satisfied: backcall in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (0.1.0) Requirement already satisfied: decorator in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (4.3.0) Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from IPython>=0.13->line_profiler) (2.0.7) Requirement already satisfied: parso>=0.3.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from jedi>=0.10->IPython>=0.13->line_profiler) (0.3.1) Requirement already satisfied: ptyprocess>=0.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pexpect; sys_platform != "win32"->IPython>=0.13->line_profiler) (0.6.0) Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from traitlets>=4.2->IPython>=0.13->line_profiler) (1.11.0) Requirement already satisfied: ipython-genutils in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from traitlets>=4.2->IPython>=0.13->line_profiler) (0.2.0) Requirement already satisfied: wcwidth in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->IPython>=0.13->line_profiler) (0.1.7)

thx @beaugunderson @ChanForPres

psteinb commented 5 years ago

I can confirm, from fc29 and python3.7.2, I did:

$ pip3 install --user Cython git+https://github.com/rkern/line_profiler.git

And that works flawlessly so far.