bitstream icon indicating copy to clipboard operation
bitstream copied to clipboard

Installation fails: Cannot open include file: 'numpy/arrayobject.h'

Open pHiney opened this issue 1 year ago • 6 comments

Not sure if this extra information will help or hinder.

Is there a way to tell it where the arrayobject.h can be found ? Same error if I install inside the virtualEnv or outside of it.

Win11

the header file exists

(.venv) c:\Users\Peter\PycharmProjects\ggpk> dir c:\Users\Peter\PycharmProjects\ggpk\.venv\Lib\site-packages\numpy\core\include\numpy\arrayobject.h
 Volume in drive C is Windows
 Volume Serial Number is ECC8-23DB

 Directory of c:\Users\Peter\PycharmProjects\ggpk\.venv\Lib\site-packages\numpy\core\include\numpy

16/09/23  16:34               294 arrayobject.h
               1 File(s)            294 bytes
(.venv) c:\Users\Peter\PycharmProjects\ggpk> pip list
Package    Version
---------- -------
numpy      1.25.2
pip        23.2.1
setuptools 65.6.3
wheel      0.38.4

(.venv) c:\Users\Peter\PycharmProjects\ggpk> python --version
Python 3.11.1
(.venv) c:\Users\Peter\PycharmProjects\ggpk> pip install bitstream
Collecting bitstream
  Using cached bitstream-3.0.1.tar.gz (210 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: bitstream
  Building wheel for bitstream (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      C:\Users\Peter\PycharmProjects\ggpk\.venv\Lib\site-packages\setuptools\_distutils\extension.py:134: UserWarning: Unknown Extension options: 'include_path'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_ext
      building 'bitstream' extension
      creating build
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\src
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Peter\PycharmProjects\ggpk\.venv\include -IC:\Python311\include -IC:\Python311\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.20348.0\\cppwinrt" /Tcsrc/bitstream.c /Fobuild\temp.win-amd64-cpython-311\Release\src/bitstream.obj
      bitstream.c
      src/bitstream.c(1189): **fatal error** C1083: Cannot open include file: 'numpy/arrayobject.h': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bitstream
  Running setup.py clean for bitstream
Failed to build bitstream
ERROR: Could not build wheels for bitstream, which is required to install pyproject.toml-based projects

pHiney avatar Sep 16 '23 06:09 pHiney

Tried running it from (just shotgunning) (.venv) c:\Users\Peter\PycharmProjects\ggpk.venv\Lib\site-packages\numpy\core\include

same error, so pip moves to a different directory for install

pH

pHiney avatar Sep 16 '23 06:09 pHiney

Same error with Python 3.6.15 on openSUSE 15.4

pHiney avatar Sep 16 '23 08:09 pHiney

Thanks a lot for the report !

I have just started to port the old travis CI and appveyor automated builds and tests to github actions. Hopefully that will help us to see more clearly what's going on. At this stage I can reproduce the missing numpy/arrayobject.h file during the build from (Cython) sources on macos (but strangely enough, not on Windows and not on Linux!). I will keep investigating.

boisgera avatar Sep 24 '23 14:09 boisgera

Hi @pHiney,

Could you have a look and see if the latest beta version works for you?

pip install --pre bitstream

(The automated install from github actions now pass on Ubuntu, Windows and MacOS.)

Cheers

Sébastien

boisgera avatar Sep 24 '23 17:09 boisgera

Yes it has thanks

pip install --pre bitstream
Collecting bitstream
  Downloading bitstream-3.1b1.tar.gz (203 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 203.1/203.1 kB 3.1 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in c:\git\pathofbuilding-python\.venv\lib\site-packages (from bitstream) (1.26.0)
Building wheels for collected packages: bitstream
  Building wheel for bitstream (pyproject.toml) ... done
  Created wheel for bitstream: filename=bitstream-3.1b1-cp311-cp311-win_amd64.whl size=127233 sha256=da623b97385f4c624f23db61eb20a898f8b1c360a98193f69b9498ccf3e770e7
  Stored in directory: c:\users\peter\appdata\local\pip\cache\wheels\0c\11\ab\ccce1df367287bc24a810d15506019d254ae841007f9b41baf
Successfully built bitstream
Installing collected packages: bitstream
Successfully installed bitstream-3.1b1

pHiney avatar Sep 24 '23 20:09 pHiney

Great, thanks for the feedback!

boisgera avatar Sep 24 '23 21:09 boisgera