lucasb-eyer / pydensecrf

Python wrapper to Philipp Krähenbühl's dense (fully connected) CRFs with gaussian edge potentials.
MIT License
1.94k stars 413 forks source link

Windows Visual Studio error with Eigen #69

Closed resonance20 closed 6 years ago

resonance20 commented 6 years ago

I get the following error with python 3.6.4 on windows 10 while using pip install:

Collecting pydensecrf
  Using cached https://files.pythonhosted.org/packages/31/5a/1c2ab48e8019d282c128bc5c621332267bb954d32eecdda3ba57306b1551/pydensecrf-1.0rc3.tar.gz
Building wheels for collected packages: pydensecrf
  Running setup.py bdist_wheel for pydensecrf ... error
  Complete output from command c:\users\brain\miniconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\brain\\AppData\\Local\\Temp\\pip-install-wj25x65h\\pydensecrf\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\brain\AppData\Local\Temp\pip-wheel-r3h92lnu --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\pydensecrf
  copying pydensecrf\utils.py -> build\lib.win-amd64-3.6\pydensecrf
  copying pydensecrf\__init__.py -> build\lib.win-amd64-3.6\pydensecrf
  running build_ext
  building 'pydensecrf.eigen' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\pydensecrf
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ipydensecrf/densecrf/include -Ipydensecrf -Ic:\users\brain\miniconda3\include -Ic:\users\brain\miniconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /EHsc /Tppydensecrf/eigen.cpp /Fobuild\temp.win-amd64-3.6\Release\pydensecrf/eigen.obj
  eigen.cpp
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/VectorBlock.h(120): error C2373: 'Eigen::DenseBase<Derived>::segment': redefinition; different type modifiers
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/DenseBase.h(291): note: see declaration of 'Eigen::DenseBase<Derived>::segment'
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/VectorBlock.h(121): error C2447: '{': missing function header (old-style formal list?)
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/VectorBlock.h(152): error C2373: 'Eigen::DenseBase<Derived>::head': redefinition; different type modifiers
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/DenseBase.h(294): note: see declaration of 'Eigen::DenseBase<Derived>::head'
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/VectorBlock.h(153): error C2447: '{': missing function header (old-style formal list?)
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/VectorBlock.h(184): error C2373: 'Eigen::DenseBase<Derived>::tail': redefinition; different type modifiers
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/DenseBase.h(297): note: see declaration of 'Eigen::DenseBase<Derived>::tail'
  c:\users\brain\appdata\local\temp\pip-install-wj25x65h\pydensecrf\pydensecrf\densecrf\include\eigen\src/Core/VectorBlock.h(185): error C2447: '{': missing function header (old-style formal list?)
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
lucasb-eyer commented 6 years ago

We regularly get reports about difficulties on Windows. I personally can't help unfortunately, as I don't have access to windows anymore, but any PRs are welcome.

resonance20 commented 6 years ago

Do you use a custom version of the eigen library here or is it a standard release? If standard, which version?

resonance20 commented 6 years ago

Okay I found that using conda to install this library worked. Go figure.

lucasb-eyer commented 6 years ago

Thank you for getting back, I have added a note to the README.

Tyllis commented 5 years ago

I had the exact same issue on Window 10. Resolved by running conda install -c conda-forge pydensecrf https://anaconda.org/conda-forge/pydensecrf

yzaretskiy commented 5 years ago

In case folks don't want to use conda, I was able to resolve this particular issue by cloning the master branch, replacing the included Eigen library with its most recent version (3.3.5 as of today), and then installing pydensecrf with python setup.py install.

tansyl commented 5 years ago

Hi @lucasb-eyer , after looking through all the related threads, updating Eigen library to a newer version solved my case (I used 3.3.5). would you please update the package included or add a note to the README? I feel that it might eliminate the remaining windows installation issues. Thanks!

mohammadreza-sheykhmousa commented 4 years ago

I had the exact same issue on Window 10. Resolved by running conda install -c conda-forge pydensecrf https://anaconda.org/conda-forge/pydensecrf

Thanks @Tyllis this solved my problem as well.

daddydrac commented 4 years ago

Conda install fails ->

Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
ElonGaties commented 2 years ago

@salinaaaaaa did you fix that?