I think the documents is poor or makefile is poor or bug.
ingyeoking13 opened this issue · 5 comments
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
On AWS EC2(t2 family), I followed your documents.
and in Readme.md file there is no build section.
so I type make to use makefile to build.
I got following errors.
-> no pkgconfig
-> ok, pip install pkconfig
-> no Cython
-> ok, pip install cython
-> then Python.h No such file directory.
(pystack-env) ubuntu@ip-172-31-14-29:~/utils/pystack$ make
python setup.py build_ext --inplace
Traceback (most recent call last):
File "/home/ubuntu/utils/pystack/setup.py", line 6, in <module>
import pkgconfig
ModuleNotFoundError: No module named 'pkgconfig'
make: *** [Makefile:16: build] Error 1
(pystack-env) ubuntu@ip-172-31-14-29:~/utils/pystack$ vi Makefile
(pystack-env) ubuntu@ip-172-31-14-29:~/utils/pystack$ vi setup.py
(pystack-env) ubuntu@ip-172-31-14-29:~/utils/pystack$ pip install pkgconfig
Collecting pkgconfig
Using cached pkgconfig-1.5.5-py3-none-any.whl (6.7 kB)
Installing collected packages: pkgconfig
Successfully installed pkgconfig-1.5.5
(pystack-env) ubuntu@ip-172-31-14-29:~/utils/pystack$ make
python setup.py build_ext --inplace
Traceback (most recent call last):
File "/home/ubuntu/utils/pystack/setup.py", line 8, in <module>
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
make: *** [Makefile:16: build] Error 1
(pystack-env) ubuntu@ip-172-31-14-29:~/utils/pystack$ pip install Cython
Collecting Cython
Using cached Cython-3.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)
Using cached Cython-3.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)
Installing collected packages: Cython
Successfully installed Cython-3.0.5
(pystack-env) ubuntu@ip-172-31-14-29:~/utils/pystack$ make
python setup.py build_ext --inplace
pkg-config not found. pkg-config probably not installed: FileNotFoundError(2, 'No such file or directory')
Falling back to static flags.
Compiling src/pystack/_pystack.pyx because it depends on /home/ubuntu/utils/pystack-env/lib/python3.11/site-packages/Cython/Includes/libcpp/vector.pxd.
[1/1] Cythonizing src/pystack/_pystack.pyx
running build_ext
building 'pystack._pystack' extension
creating build
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/src
creating build/temp.linux-x86_64-cpython-311/src/pystack
creating build/temp.linux-x86_64-cpython-311/src/pystack/_pystack
x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Isrc/pystack/_pystack -I/home/ubuntu/utils/pystack-env/include -I/usr/include/python3.11 -c src/pystack/_pystack.cpp -o build/temp.linux-x86_64-cpython-311/src/pystack/_pystack.o -std=c++17
src/pystack/_pystack.cpp:66:10: fatal error: Python.h: No such file or directory
66 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
make: *** [Makefile:16: build] Error 1
Expected Behavior
make should be done.
Steps To Reproduce
- AWS EC2(t2-micro)
- I install python with deadsnakes ppa
- git clone this
- just follow documents.
Pystack Version
from source code ( Always run required CI check commit 772a0bc)
Python Version
3.11
Linux distribution
Ubuntu
Anything else?
No response
To call make
you need to have the build dependencies installed. The correct way is to use an editable install (pip install -e .
or pip install .
, which will install the dependencies for you) or to ensure that the dependencies are there (pkgconfig, cython, wheel, setuptools
)
Also, to build the extension you need the Python headers which you need to install with your package manager. This will fix this error:
Python.h: No such file or directory
For Debian-based systems you need apt-get install python3-dev
.
Closing this as not a bug
Also, remember that unless you want to build from source for some reason pip install pystack
will give you a pre-compiled binary so you don't need to build it yourself.
and in Readme.md file there is no build section.
There is: https://github.com/bloomberg/pystack/blob/main/README.md#building-from-source