Closed fangq closed 2 years ago
For issues with pip install, I would suggest to always attempting the install with more verbose output, e.g. pip install -vU --no-cache-dir bjdata
, which might show you either why compilation failed or why the pre-compiled (if there is one) binary was not installed in the right location.
If I run this myself in a fresh Python 3.8 venv, I see:
error: invalid command 'bdist_wheel' [..] ERROR: Failed building wheel for bjdata
Once I've installed the wheel
package, and I run pip install -vU --no-cache-dir bjdata
again, I can see:
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/fish/blah/include -I/usr/include/python3.8 -c src/_bjdata.c -o build/temp.linux-x86_64-3.8/src/_bjdata.o -std=c99 -DUSE__BJDATA
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/fish/blah/include -I/usr/include/python3.8 -c src/decoder.c -o build/temp.linux-x86_64-3.8/src/decoder.o -std=c99 -DUSE__BJDATA
src/decoder.c:22:10: fatal error: numpy/arrayobject.h: No such file or directory
22 | #include <numpy/arrayobject.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
command 'x86_64-linux-gnu-gcc' failed with exit status 1
/tmp/pip-install-z781ok7q/bjdata/setup.py:62: UserWarning: Extension module _bjdata: The output above this warning shows how the compilation failed.
warnings.warn("Extension module %s: The output above this warning shows how the compilation failed."
Whether the above issue (lack of numpy headers / development package installation) is the same one you're having, I obviously can't tell. Hope this give you enough pointer to investigate your installation issue further.
this is not a bug report, rather a question.
As I mentioned in a previous PR (#14), I've been working on a binary format derived from UBJSON, called BJData. BJData is designed to be an improved version of UBJSON with several notable changes (summarized here: https://github.com/nlohmann/json/pull/3336#issue-1140817315).
Most of the project files, including
setup.py
, were derived from your project, and I have been making releases via pypi at https://pypi.org/project/bjdata/.One thing I noticed recently is that
pip install py-ubjson
can properly build/install the binary extension on both python3.8 and 3.6, butpip install bjdata
only installs the binary extension on python 3.6. I don't know what was missing.I want to get some suggestions on where to look. My setup.py can be found here. I previously blamed a pyproject.toml file that I added, but removing it does not change anything,
is this related to how the package was uploaded to pypi?
Here is the log for Python 3.8 on Ubuntu 20.04 (where ubjson module has binary but bjdata does not)
Here is the log for Python 3.6 on Ubuntu 18.04 (both have binaries)