Python Forum

Full Version: error in installing Pystan
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!
Please, help: I want to install Pystan (I need it to install fbprophet) I have Windows 10, Python2.7, Microsofr Visual C++ Compiler Package for Python 2.7, wheel

When I try "pip install pystan" there is an error:

running build_ext
building 'pystan._api' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\pystan
creating build\temp.win-amd64-2.7\Release\pystan\stan
creating build\temp.win-amd64-2.7\Release\pystan\stan\src
creating build\temp.win-amd64-2.7\Release\pystan\stan\src\stan
creating build\temp.win-amd64-2.7\Release\pystan\stan\src\stan\lang
creating build\temp.win-amd64-2.7\Release\pystan\stan\src\stan\lang\grammars
C:\Users\User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_NO_DECLTYPE -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_RESULT_OF_USE_TR1 -DFUSION_MAX_VECTOR_SIZE=12 -I.\pystan -Ipystan/stan/src -Ipystan/stan/lib/stan_math/ -Ipystan/stan/lib/stan_math/lib/eigen_3.3.3 -Ipystan/stan/lib/stan_math/lib/boost_1.69.0 -Ipystan/stan/lib/stan_math/lib/sundials_4.1.0/include -Ic:\python27\include -Ic:\python27\PC /Tppystan/_api.cpp /Fobuild\temp.win-amd64-2.7\Release\pystan/_api.obj /EHsc -DBOOST_DATE_TIME_NO_LIB /std:c++14
cl : Command line warning D9002 : ignoring unknown option '/std:c++14'
_api.cpp
pystan/stan/src\stan/lang/generator/write_begin_all_dims_col_maj_loop.hpp(77) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/write_begin_param_elements_loop.hpp(81) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/write_var_decl_arg.hpp(65) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/statement_visgen.hpp(262) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/statement_visgen.hpp(266) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/statement_visgen.hpp(321) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/statement_visgen.hpp(332) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/statement_visgen.hpp(350) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/statement_visgen.hpp(360) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/statement_visgen.hpp(379) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/statement_visgen.hpp(385) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/generate_param_names_array.hpp(32) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/generate_param_names_array.hpp(54) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/generate_set_param_ranges.hpp(53) : warning C4258: 'i' : definition from the for loop is ignored; the definition from the enclosing scope is used
pystan/stan/src\stan/lang/generator/generate_set_param_ranges.hpp(48) : definition of 'i' ignored
pystan/stan/src\stan/lang/generator/generate_set_param_ranges.hpp(36) : definition of 'i' used
pystan/stan/src\stan/lang/generator/generate_register_mpi.hpp(15) : error C2143: syntax error : missing ',' before ':'
pystan/stan/src\stan/lang/generator/generate_register_mpi.hpp(15) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
pystan/stan/src\stan/lang/generator/generate_register_mpi.hpp(15) : error C2143: syntax error : missing ';' before '{'
pystan/stan/src\stan/lang/generator/generate_register_mpi.hpp(16) : error C2228: left of '.first' must have class/struct/union
type is 'int'
pystan/stan/src\stan/lang/generator/generate_register_mpi.hpp(17) : error C2228: left of '.second' must have class/struct/union
type is 'int'
pystan/stan/src\stan/lang/generator/generate_unconstrained_param_names_array.hpp(37) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/src\stan/lang/generator/generate_unconstrained_param_names_array.hpp(57) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
pystan/stan/lib/stan_math/lib/boost_1.69.0\boost/phoenix/core/limits.hpp(44) : warning C4005: 'BOOST_PHOENIX_NO_VARIADIC_EXPRESSION' : macro redefinition
command-line arguments : see previous definition of 'BOOST_PHOENIX_NO_VARIADIC_EXPRESSION'
pystan/_api.cpp(1305) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
error: Command "C:\Users\User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_NO_DECLTYPE -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_RESULT_OF_USE_TR1 -DFUSION_MAX_VECTOR_SIZE=12 -I.\pystan -Ipystan/stan/src -Ipystan/stan/lib/stan_math/ -Ipystan/stan/lib/stan_math/lib/eigen_3.3.3 -Ipystan/stan/lib/stan_math/lib/boost_1.69.0 -Ipystan/stan/lib/stan_math/lib/sundials_4.1.0/include -Ic:\python27\include -Ic:\python27\PC /Tppystan/_api.cpp /Fobuild\temp.win-amd64-2.7\Release\pystan/_api.obj /EHsc -DBOOST_DATE_TIME_NO_LIB /std:c++14" failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\user\\appdata\\local\\temp\\pip-install-89oiaz\\pystan\\setup.py'"'"'; __file__='"'"'c:\\users\\user\\appdata\\local\\temp\\pip-install-89oiaz\\pystan\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'c:\users\user\appdata\local\temp\pip-record-efhvw3\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
try:
pip install pystan
(Oct-04-2019, 07:42 PM)Larz60+ Wrote: [ -> ]I have Windows 10, Python2.7, Microsofr Visual C++ Compiler Package for Python 2.7, wheel
Its' not tester against Visual C++ compiler.
PyStan on Windows
Quote:PyStan is tested against the mingw-w64 compiler which works on both Python versions (2.7, 3.x) and supports x86 and x64.

As you should not use Python 2.7,someone has make wheel for Python 3.
Eg if have Python 3.7 in 64-bit version.
pip install pystan-2.18.0.0-cp37-cp37m-win_amd64.whl
All is inside wheel no compiler is needed.
Python 3.6/3.7 and pip installation under Windows
Snippsat, thank you very much for your answer!

So what should I do is to install mingw-w64 compiler? And to uninstall Microsofr Visual C++ Compiler Package for Python 2.7?

When I didn`t have Microsofr Visual C++ Compiler Package for Python 2.7 and tried "pip install pystan", there was an error with recommendation to install "Microsofr Visual C++ Compiler Package for Python 2.7" with link where I can get it.

I want to use python 2.7, as I don`t have much experience in python and what I already learned I did with python 2.7. Is there an answer for my proplem with python 2.7?
(Oct-05-2019, 09:16 AM)sveto4ka Wrote: [ -> ]I want to use python 2.7, as I don`t have much experience in python and what I already learned I did with python 2.7.
still better move to python3 as python2 support ends on January 1 2020
https://pythonclock.org/
Buran,
Yes, I know. I will change to Python 3 when I`ll get more experience in Python.
Now I want to use Python 2.7
I solved the problem by installing Anaconda