Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Failed to build line-profiler #168

Open
zouyj0921 opened this issue Oct 24, 2019 · 1 comment
Open

Failed to build line-profiler #168

zouyj0921 opened this issue Oct 24, 2019 · 1 comment

Comments

@zouyj0921
Copy link

pip install line-profiler --user failed . I've tried the solution #132 but not work.
environment : ubuntu, python36, error details:

Requirement already satisfied: IPython>=0.13 in /home/zouyj/.local/lib/python3.6/site-packages (from line-profiler==2.1.1) (7.5.0)
Requirement already satisfied: backcall in /home/zouyj/.local/lib/python3.6/site-packages (from IPython>=0.13->line-profiler==2.1.1) (0.1.0)
Requirement already satisfied: traitlets>=4.2 in /home/zouyj/.local/lib/python3.6/site-packages (from IPython>=0.13->line-profiler==2.1.1) (4.3.2)
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/lib/python3/dist-packages (from IPython>=0.13->line-profiler==2.1.1) (4.0.1)
Requirement already satisfied: decorator in /usr/local/lib/python3.6/dist-packages (from IPython>=0.13->line-profiler==2.1.1) (4.4.0)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /home/zouyj/.local/lib/python3.6/site-packages (from IPython>=0.13->line-profiler==2.1.1) (2.0.9)
Requirement already satisfied: jedi>=0.10 in /home/zouyj/.local/lib/python3.6/site-packages (from IPython>=0.13->line-profiler==2.1.1) (0.13.3)
Requirement already satisfied: pygments in /home/zouyj/.local/lib/python3.6/site-packages (from IPython>=0.13->line-profiler==2.1.1) (2.4.2)
Requirement already satisfied: pickleshare in /home/zouyj/.local/lib/python3.6/site-packages (from IPython>=0.13->line-profiler==2.1.1) (0.7.5)
Requirement already satisfied: setuptools>=18.5 in /home/zouyj/.local/lib/python3.6/site-packages (from IPython>=0.13->line-profiler==2.1.1) (41.4.0)
Requirement already satisfied: six in /home/zouyj/.local/lib/python3.6/site-packages (from traitlets>=4.2->IPython>=0.13->line-profiler==2.1.1) (1.12.0)
Requirement already satisfied: ipython-genutils in /home/zouyj/.local/lib/python3.6/site-packages (from traitlets>=4.2->IPython>=0.13->line-profiler==2.1.1) (0.2.0)
Requirement already satisfied: wcwidth in /home/zouyj/.local/lib/python3.6/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->IPython>=0.13->line-profiler==2.1.1) (0.1.7)
Requirement already satisfied: parso>=0.3.0 in /home/zouyj/.local/lib/python3.6/site-packages (from jedi>=0.10->IPython>=0.13->line-profiler==2.1.1) (0.4.0)
Building wheels for collected packages: line-profiler
Building wheel for line-profiler (setup.py) ... error
ERROR: Complete output from command /usr/bin/python3.6 -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-req-build-p1b24f_m/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-m38tdyar --python-tag cp36:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying line_profiler.py -> build/lib.linux-x86_64-3.6
copying kernprof.py -> build/lib.linux-x86_64-3.6
copying line_profiler_py35.py -> build/lib.linux-x86_64-3.6
running build_ext
skipping '_line_profiler.c' Cython extension (up-to-date)
building '_line_profiler' extension
creating build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c _line_profiler.c -o build/temp.linux-x86_64-3.6/_line_profiler.o
_line_profiler.c:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

ERROR: Failed building wheel for line-profiler
Running setup.py clean for line-profiler
Failed to build line-profiler
Installing collected packages: line-profiler
Running setup.py install for line-profiler ... error
ERROR: Complete output from command /usr/bin/python3.6 -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-req-build-p1b24f_m/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-7znj2mng/install-record.txt --single-version-externally-managed --compile --user --prefix=:
ERROR: running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying line_profiler.py -> build/lib.linux-x86_64-3.6
copying kernprof.py -> build/lib.linux-x86_64-3.6
copying line_profiler_py35.py -> build/lib.linux-x86_64-3.6
running build_ext
skipping '_line_profiler.c' Cython extension (up-to-date)
building '_line_profiler' extension
creating build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c _line_profiler.c -o build/temp.linux-x86_64-3.6/_line_profiler.o
_line_profiler.c:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/bin/python3.6 -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-req-build-p1b24f_m/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-7znj2mng/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-req-build-p1b24f_m/

@codeslord
Copy link

Try this

git clone https://github.com/rkern/line_profiler.git
cd line_profiler
cython _line_profiler.pyx
pip install . --user

You might get a FutureWarning, ignore that as of now.

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

No branches or pull requests

2 participants