Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Install on Python 3.11 fails with " fatal error: longintrepr.h: No such file or directory" #111

Closed
@cirosantilli

Description

@cirosantilli

Related issue: https://stackoverflow.com/questions/74979674/gensim-install-in-python-3-11-fails-because-of-missing-longintrepr-h-file

Reproduction on Ubuntu 23.10, Python 3.11.6:

git clone https://github.com/alecalve/python-bitcoin-blockchain-parser
cd python-bitcoin-blockchain-parser
virtualenv -p python3 .venv
. .venv/bin/activate
pip install -r requirements.txt

Output:

Collecting python-bitcoinlib==0.11.0 (from -r requirements.txt (line 1))
  Using cached python_bitcoinlib-0.11.0-py3-none-any.whl (103 kB)
Collecting plyvel==1.2.0 (from -r requirements.txt (line 2))
  Using cached plyvel-1.2.0.tar.gz (145 kB)
  Preparing metadata (setup.py) ... done
Collecting coverage==4.0.2 (from -r requirements.txt (line 3))
  Downloading coverage-4.0.2.zip (477 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 477.8/477.8 kB 7.1 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: plyvel, coverage
  Building wheel for plyvel (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/plyvel
      copying plyvel/_version.py -> build/lib.linux-x86_64-cpython-311/plyvel
      copying plyvel/__init__.py -> build/lib.linux-x86_64-cpython-311/plyvel
      running build_ext
      building 'plyvel._plyvel' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/plyvel
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -fwrapv -O2 -fPIC -I/home/ciro/git/python-bitcoin-blockchain-parser/.venv/include -I/usr/include/python3.11 -c plyvel/_plyvel.cpp -o build/temp.linux-x86_64-cpython-311/plyvel/_plyvel.o -Wall -g -x c++ -std=c++11
      x86_64-linux-gnu-gcc: warning: ‘-x c++’ after last input file has no effect
      plyvel/_plyvel.cpp:196:12: fatal error: longintrepr.h: No such file or directory
        196 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for plyvel
  Running setup.py clean for plyvel
  Building wheel for coverage (setup.py) ... done
  Created wheel for coverage: filename=coverage-4.0.2-py3-none-any.whl size=154552 sha256=d74e43ee4490679e48d65d07f5a343a17f3124a19a26563905b09225c932a7a8
  Stored in directory: /home/ciro/.cache/pip/wheels/23/3c/a3/ac008d08a5d68b569be4845d73bb72b4013145f569f946eccd
Successfully built coverage
Failed to build plyvel
ERROR: Could not build wheels for plyvel, which is required to install pyproject.toml-based projects

Upgrading to latest plyvel solves it:

diff --git a/requirements.txt b/requirements.txt
index bb6ec2b..da34f73 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
 python-bitcoinlib==0.11.0
-plyvel==1.2.0
+plyvel==1.5.1
 coverage==4.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions