dattalab / moseq2-model

Python scripts for linking kinect-extraction to pybasicbayes
Other
1 stars 2 forks source link

error building autoregressive in moseq2-model when installing #57

Closed FancyBrush closed 4 years ago

FancyBrush commented 4 years ago

OS: windows 10

Sorry to open an issue about installation. I follow the steps in step_0 but failed to install miniconda3 in Debian WSL, because every time I try "curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o "$HOME/miniconda3_latest.sh"", comes up an unfinished installation. So I turned to windows anaconda and try create env "moseq2". I created a "moseq2" evironment with anaconda prompt, and succesfully pip install moseq2-extract and pca. However, when pip install moseq2-model, an error happens:

Building wheels for collected packages: moseq2-model, autoregressive Building wheel for moseq2-model (setup.py) ... done Created wheel for moseq2-model: filename=moseq2_model-0.1.3-py3-none-any.whl size=12304 sha256=b88a6df1732121eca8db75d74c17429a3f6cdbb56f6367c239d7d8ea9edf30e9 Stored in directory: C:\Users\WHR\AppData\Local\Temp\pip-ephem-wheel-cache-5ece5b76\wheels\72\49\af\73686df8a3e901f4b65d84f01c20cc70a50be9853825e6bcd0 Building wheel for autoregressive (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'd:\anaconda3\envs\moseq2\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\WHR\AppData\Local\Temp\pip-install-fpo_kz0s\autoregressive\setup.py'"'"'; file='"'"'C:\Users\WHR\AppData\Local\Temp\pip-install-fpo_kz0s\autoregressive\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\WHR\AppData\Local\Temp\pip-wheel-7if_nwj8' cwd: C:\Users\WHR\AppData\Local\Temp\pip-install-fpo_kz0s\autoregressive\ Complete output (62 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.6 creating build\lib.win-amd64-3.6\autoregressive copying autoregressive\distributions.py -> build\lib.win-amd64-3.6\autoregressive copying autoregressive\models.py -> build\lib.win-amd64-3.6\autoregressive copying autoregressive\util.py -> build\lib.win-amd64-3.6\autoregressive copying autoregressive__init.py -> build\lib.win-amd64-3.6\autoregressive running build_ext building 'autoregressive.messages' extension creating build\temp.win-amd64-3.6 creating build\temp.win-amd64-3.6\Release creating build\temp.win-amd64-3.6\Release\autoregressive C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iautoregressive -Id:\anaconda3\envs\moseq2\lib\site-packages\numpy\core\include -Ideps -Id:\anaconda3\envs\moseq2\include -Id:\anaconda3\envs\moseq2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" /EHsc /Tpautoregressive\messages.cpp /Fobuild\temp.win-amd64-3.6\Release\autoregressive\messages.obj -O2 -fopenmp -std=c++11 -DEIGEN_NO_MALLOC -DNDEBUG -w cl : Command line warning D9025 : overriding '/W3' with '/w' cl : Command line warning D9002 : ignoring unknown option '-fopenmp' cl : Command line warning D9002 : ignoring unknown option '-std=c++11' messages.cpp d:\anaconda3\envs\moseq2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(44): error C2131: expression did not evaluate to a constant c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(44): note: failure was caused by non-constant arguments or reference to a non-constant symbol c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(44): note: see usage of 'sz' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(31): note: while compiling class template member function 'double dummy::resample_arhmm(int,int,int,int,bool,Type ,Type ,Type ,Type ,Type ,Type ,int32_t ,int32_t ,int32_t ,Type ,Type )' with [ Type=double ] autoregressive\messages.cpp(5880): note: see reference to function template instantiation 'double dummy::resample_arhmm(int,int,int,int,bool,Type ,Type ,Type ,Type ,Type ,Type ,int32_t ,int32_t ,int32_t ,Type ,Type )' being compiled with [ Type=double ] autoregressive\messages.cpp(5042): note: see reference to class template instantiation 'dummy' being compiled c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(44): error C2146: syntax error: missing ';' before identifier 'attribute' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(44): error C3861: 'aligned': identifier not found c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(44): error C3861: 'attribute': identifier not found c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(46): error C2131: expression did not evaluate to a constant c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(46): note: failure was caused by non-constant arguments or reference to a non-constant symbol c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(46): note: see usage of 'sz' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(46): error C2146: syntax error: missing ';' before identifier 'attribute' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(46): error C3861: 'aligned': identifier not found c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(46): error C3861: 'attribute': identifier not found c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(48): error C2131: expression did not evaluate to a constant c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(48): note: failure was caused by non-constant arguments or reference to a non-constant symbol c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(48): note: see usage of 'M' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(48): error C2146: syntax error: missing ';' before identifier 'attribute' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(48): error C3861: 'aligned': identifier not found c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(48): error C3861: 'attribute': identifier not found c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(50): error C2131: expression did not evaluate to a constant c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(50): note: failure was caused by non-constant arguments or reference to a non-constant symbol c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(50): note: see usage of 'M' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(50): error C2146: syntax error: missing ';' before identifier 'attribute' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(50): error C3861: 'aligned': identifier not found c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(50): error C3861: 'attribute__': identifier not found c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(52): error C2131: expression did not evaluate to a constant c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(52): note: failure was caused by non-constant arguments or reference to a non-constant symbol c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(52): note: see usage of 'T' c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(55): error C3863: array type 'double [sz]' is not assignable c:\users\whr\appdata\local\temp\pip-install-fpo_kz0s\autoregressive\autoregressive\messages.h(60): error C3861: '__builtin_expect': identifier not found error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

ERROR: Failed building wheel for autoregressive

I googled the error message " error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2" and try many ways as followed, but none of them works, here is one of them. https://github.com/sammchardy/python-binance/issues/148

Thank you in advance!!!

jmarkow commented 4 years ago

See https://github.com/dattalab/moseq2-model/issues/37

Let us know if the proposed solution doesn't work for you.

FancyBrush commented 4 years ago

Thank you for your reply! @jmarkow

I'm using a windows 10 machine. It might be the problem of installing pyhsmm-autoregressive package, which involves compiler issues. Therefore I git clone https://github.com/mattjj/pyhsmm-autoregressive and "python setup.py install" the package. the error message arises again. So I followed the steps below to avoid the compiler issue, and the installation was accomplished but the package would not be fully used anymore. https://github.com/mattjj/pyhsmm-autoregressive/issues/4

With these knowledge, to solve moseq2-model installation in windows10 conda, some minor changes would be made in moseq2-model setup.py to avoid compiling pyhsmm-autoregressive package.

If I solve this issue on window10 conda, I would propose solution here.

Thank you for your effort in MoSeq !

FancyBrush commented 4 years ago

I think I have solved this installation issue on windows10 conda.

  1. Activate moseq2 environment in anaconda prompt;
  2. Install moseq2-extract, pca. You need to download MSVC v140 to make it install succesfully;
  3. Before pip install moseq2-model, you need to unistall and upgrade numpy, for sake of installing pyhsmm package. Then "pip install pyhsmm";
  4. clone "https://github.com/mattjj/pyhsmm-autoregressive.git", and find its setup.py: make a line of change: please comment "ext_modules=cythonize('*/.pyx')," and replace it with "ext_modules=[]," this step simply override compiler failure, as mentioned in https://github.com/mattjj/pyhsmm-autoregressive/issues/4 Then change directory to pyhsmm-autoregressive folder, and "python setup.py install". pyhsmm-autoregressive will be succesfully installed;
  5. Since you have finished installing pyhsmm and pyhsmm-autoregressive, it would be unnecessary to include them in moseq2-model install_require(). Just delete them from install_require() in moseq2-model setup.py;
  6. finish installing moseq2-viz;

That's how I install moseq2 in windows10 conda environment, but needs further check.

jmarkow commented 4 years ago

@FancyBrush If you're able to get it to work with the MSVC compiler that's great, though I don't know of anyone else that's gotten it to work, so we can't guarantee that everything will work as expected. In the issue I referred to that user also was using Windows 10 and they were able to install everything successfully in the Windows Subsystem for Linux following the Linux installation instructions in the Wiki.

Feel free to re-open if you're still having issues.