Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install netgraph gives errors with Microsoft Visuals and wheels for rectangle-packer #98

Closed
Renske27 opened this issue Aug 13, 2024 · 3 comments

Comments

@Renske27
Copy link

Hi, I tried to install Netgraph, but there is a problem with Microsoft Visuals and wheels for the rectangle-packer. Does somebody know how to resolve this issue?

I get the following error message (I just put everything, so it is quite long):
pip install netgraph
Collecting netgraph
Using cached netgraph-4.13.2-py3-none-any.whl.metadata (12 kB)
Requirement already satisfied: numpy in c:\users\rensk\anaconda3\lib\site-packages (from netgraph) (1.19.5)
Requirement already satisfied: scipy in c:\users\rensk\anaconda3\lib\site-packages (from netgraph) (1.7.0)
Requirement already satisfied: matplotlib>=1.5 in c:\users\rensk\anaconda3\lib\site-packages (from netgraph) (3.1.3)
Collecting rectangle-packer (from netgraph)
Using cached rectangle-packer-2.0.2.tar.gz (99 kB)
Preparing metadata (setup.py) ... done
Collecting grandalf (from netgraph)
Using cached grandalf-0.8-py3-none-any.whl.metadata (1.7 kB)
Requirement already satisfied: cycler>=0.10 in c:\users\rensk\anaconda3\lib\site-packages (from matplotlib>=1.5->netgraph) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\rensk\anaconda3\lib\site-packages (from matplotlib>=1.5->netgraph) (1.1.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\users\rensk\anaconda3\lib\site-packages (from matplotlib>=1.5->netgraph) (2.4.6)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\rensk\anaconda3\lib\site-packages (from matplotlib>=1.5->netgraph) (2.8.1)
Requirement already satisfied: six in c:\users\rensk\anaconda3\lib\site-packages (from cycler>=0.10->matplotlib>=1.5->netgraph) (1.14.0)
Requirement already satisfied: setuptools in c:\users\rensk\anaconda3\lib\site-packages (from kiwisolver>=1.0.1->matplotlib>=1.5->netgraph) (45.2.0.post20200210)
Using cached netgraph-4.13.2-py3-none-any.whl (96 kB)
Using cached grandalf-0.8-py3-none-any.whl (41 kB)
Building wheels for collected packages: rectangle-packer
Building wheel for rectangle-packer (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [41 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\rpack
copying rpack_init_.py -> build\lib.win-amd64-3.7\rpack
running egg_info
writing rectangle_packer.egg-info\PKG-INFO
writing dependency_links to rectangle_packer.egg-info\dependency_links.txt
writing top-level names to rectangle_packer.egg-info\top_level.txt
reading manifest file 'rectangle_packer.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'rectangle_packer.egg-info\SOURCES.txt'
copying rpack_core.pxd -> build\lib.win-amd64-3.7\rpack
copying rpack_core.pyx -> build\lib.win-amd64-3.7\rpack
running build_ext
cythoning rpack/_core.pyx to rpack_core.c

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      """

  # The following four functions are used as compare-functions for
  # sorting `Rectangle` structs by index, width, height and area.

  cdef int rectangle_index_cmp(const void *a, const void *b) noexcept nogil:
                                                            ^
  ------------------------------------------------------------

  rpack\_core.pyx:37:59: Syntax error in C variable declaration
  building 'rpack._core' extension
  creating build\temp.win-amd64-3.7
  creating build\temp.win-amd64-3.7\Release
  creating build\temp.win-amd64-3.7\Release\rpack
  creating build\temp.win-amd64-3.7\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iinclude -IC:\Users\rensk\anaconda3\include -IC:\Users\rensk\anaconda3\in

clude "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Wind
ows Kits\10\include\10.0.26100.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\cppwinrt" /Tcrpack_core.c /Fobuild\temp.win-amd64-3.7\Release\rpack_core.obj
_core.c
rpack_core.c(1): fatal error C1189: #error: Do not use this file, it is the result of a failed Cython compilation.
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe' failed with exit status 2
[end of output]

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

@paulbrodersen
Copy link
Owner

I am not the maintainer of rectangle-packer, so there isn't anything I can do to address this issue. I would suggest to raise the issue on their github instead. After a very brief scroll through their open issues, this one seems related.

Until the issue gets resolved on rectangle-packers end, I would try the following:

  1. Install netgraph with conda, not pip, in a clean virtual environment.
  2. First install rectangle-packer in a clean virtual environment, then netgraph.
  3. Repeat step 2 with different cython versions, if necessary.

@Renske27
Copy link
Author

Thanks for the advice. It is now working.

@paulbrodersen
Copy link
Owner

What bit worked, if you don't mind me asking? Then the next person will know what to do.

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

No branches or pull requests

2 participants