GithubHelp home page GithubHelp logo

Comments (53)

xiemeilong avatar xiemeilong commented on July 27, 2024 11

I also can not use 'pip install fbprophet' to install prophet on windows 10 with python 2.7.0 of Anaconda2-4.3.0.1-Windows-x86_64.

Collecting fbprophet
  Downloading fbprophet-0.1.post1.tar.gz
    Complete output from command python setup.py egg_info:
    no previously-included directories found matching 'doc\_build'
    warning: no previously-included files matching '*.so' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.png' found anywhere in distribution
    no previously-included directories found matching 'pystan\stan\make'
    no previously-included directories found matching 'pystan\stan\src\docs'
    no previously-included directories found matching 'pystan\stan\src\doxygen'
    no previously-included directories found matching 'pystan\stan\src\python'
    no previously-included directories found matching 'pystan\stan\src\test'
    no previously-included directories found matching 'pystan\stan\lib\stan_math\doxygen'
    no previously-included directories found matching 'pystan\stan\lib\stan_math\make'
    no previously-included directories found matching 'pystan\stan\lib\stan_math\test'
    no previously-included directories found matching 'pystan\stan\lib\stan_math\lib\cpplint_4.45'
    no previously-included directories found matching 'pystan\stan\lib\stan_math\lib\gtest_1.7.0'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\xiemei~1\appdata\local\temp\pip-build-smdjae\fbprophet\setup.py", line 96, in <module>
        """
      File "D:\Anaconda2\lib\distutils\core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\dist.py", line 315, in __init__
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\dist.py", line 361, in fetch_build_eggs
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\pkg_resources\__init__.py", line 851, in resolve
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\pkg_resources\__init__.py", line 1123, in best_match
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\pkg_resources\__init__.py", line 1135, in obtain
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\dist.py", line 428, in fetch_build_egg
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\command\easy_install.py", line 664, in easy_install
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\command\easy_install.py", line 694, in install_item
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\command\easy_install.py", line 875, in install_eggs
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\command\easy_install.py", line 1114, in build_and_install
      File "D:\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\command\easy_install.py", line 1102, in run_setup
    distutils.errors.DistutilsError: Setup script exited with error: SandboxViolation: open('build\\lib.win-amd64-2.7\\pystan\\stan\\lib\\stan_math_2.14.0\\doc\\api\\html\\d0\\d0f\\structstan_1_1is__vector__like_3_01_eigen_1_1_matrix_3_01_t_00_01_eigen_1_1_dynamic_00_01_eigen_1_1_dynamic_01_4_01_4-members.html', 'wb') {}

    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.

    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\xiemei~1\appdata\local\temp\pip-build-smdjae\fbprophet\

from prophet.

rmax avatar rmax commented on July 27, 2024 6

FYI, latest release is available via conda too: conda install -c conda-forge fbprophet

from prophet.

seanjtaylor avatar seanjtaylor commented on July 27, 2024 4

Yes installation on Windows is a known problem. Are you able to install the pystan package? We think it's an upstream pystan problem.

from prophet.

siehienp20 avatar siehienp20 commented on July 27, 2024 4

Wow same issue still present nearly 3 years later. fbprophet will not install whether pystan is installed correctly or not. i can import pystan and run a simple model, but fbprophet will not go through even when manual installed

from prophet.

seanjtaylor avatar seanjtaylor commented on July 27, 2024 2

I'll get a Windows machine and try to replicate soon. Another thing to test if you have pystan installed is compiling one of the models in the package:

import pystan
sm = pystan.StanModel(model_code=open('stan/prophet_linear_growth.stan').read())

from prophet.

Netherdrake avatar Netherdrake commented on July 27, 2024 2

I had the same issue on Linux with Python 3.6.

Installing pystan manually fixed the issue (otherwise it would just hang forever).

~/GitHub % git clone https://github.com/facebookincubator/prophet
Cloning into 'prophet'...
remote: Counting objects: 358, done.
remote: Compressing objects: 100% (109/109), done.
remote: Total 358 (delta 46), reused 0 (delta 0), pack-reused 245
Receiving objects: 100% (358/358), 6.28 MiB | 3.87 MiB/s, done.
Resolving deltas: 100% (67/67), done.
~/GitHub % cd prophet/python/
~/G/p/python % pip install -e .
Obtaining file:///home/user/GitHub/prophet/python
^COperation cancelled by user
~/G/p/python % pip install pystan
Collecting pystan
  Downloading pystan-2.14.0.0-cp36-cp36m-manylinux1_x86_64.whl (62.2MB)
    100% |████████████████████████████████| 62.2MB 29kB/s 
Requirement already satisfied: numpy>=1.7 in /home/user/anaconda3/lib/python3.6/site-packages (from pystan)
Requirement already satisfied: Cython!=0.25.1,>=0.22 in /home/user/anaconda3/lib/python3.6/site-packages (from pystan)
Installing collected packages: pystan
Successfully installed pystan-2.14.0.0
~/G/p/python % pip install -e .
Obtaining file:///home/user/GitHub/prophet/python
Requirement already satisfied: matplotlib in /home/user/anaconda3/lib/python3.6/site-packages (from fbprophet==0.1.post1)
Requirement already satisfied: numpy in /home/user/anaconda3/lib/python3.6/site-packages (from fbprophet==0.1.post1)
Requirement already satisfied: pandas in /home/user/anaconda3/lib/python3.6/site-packages (from fbprophet==0.1.post1)
Requirement already satisfied: pystan>=2.8 in /home/user/anaconda3/lib/python3.6/site-packages (from fbprophet==0.1.post1)
Requirement already satisfied: six>=1.10 in /home/user/anaconda3/lib/python3.6/site-packages (from matplotlib->fbprophet==0.1.post1)
Requirement already satisfied: python-dateutil in /home/user/anaconda3/lib/python3.6/site-packages (from matplotlib->fbprophet==0.1.post1)
Requirement already satisfied: pytz in /home/user/anaconda3/lib/python3.6/site-packages (from matplotlib->fbprophet==0.1.post1)
Requirement already satisfied: cycler>=0.10 in /home/user/anaconda3/lib/python3.6/site-packages (from matplotlib->fbprophet==0.1.post1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in /home/user/anaconda3/lib/python3.6/site-packages (from matplotlib->fbprophet==0.1.post1)
Requirement already satisfied: Cython!=0.25.1,>=0.22 in /home/user/anaconda3/lib/python3.6/site-packages (from pystan>=2.8->fbprophet==0.1.post1)
Installing collected packages: fbprophet
  Running setup.py develop for fbprophet
Successfully installed fbprophet
~/G/p/python % 

from prophet.

bletham avatar bletham commented on July 27, 2024 2

There seem to be two separate issues.

(1) Sometimes the PyStan installation is failing. @ritviksahajpal reported that pip install pystan did not work, but installing from source did. You should use the following code to check if PyStan is working:

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)  # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean()  # should be close to 0

If pip install pystan doesn't work, then I'd suggest opening an issue with PyStan so they can be aware of the issue and possibly find a solution (https://github.com/stan-dev/pystan/issues).

(2) Once you do have a functioning PyStan installation, Prophet will not install. The issue here seems to be that PyStan in windows does not support matrix multiplication. @rjtavares reports that the following test case errors even with a functioning PyStan install:

import pystan
model_code = """
data {
  int n;                                
  int m;                                
  matrix[n, m] A;
  vector[n] y;
}

parameters {
  vector[m] delta;
}

model {y ~ normal(A * delta,1);}
"""
model = pystan.StanModel(model_code=model_code)

If this is the issue, then it is an upstream issue with PyStan-in-Windows and Prophet will not work until it is fixed. An issue needs to be raised with PyStan (https://github.com/stan-dev/pystan/issues). I do not currently have access to a Windows machine to run these test cases myself, and so can't open the issue myself. If someone who has the code in (1) functioning but (2) not is willing to open an issue with PyStan that would be extremely helpful.

from prophet.

rmax avatar rmax commented on July 27, 2024 2

@monkeydust try this:

from prophet.

erikcong80 avatar erikcong80 commented on July 27, 2024 1

Hi, fbprophet cannot be compiled with windows default compiler msvc. In my case, I use anaconda and try to install prophet in a conda environment. I install mingw-64 as the compiler for pystan and prophet using "conda install libpython m2w64-toolchain -c msys2", solved the issue

from prophet.

ritviksahajpal avatar ritviksahajpal commented on July 27, 2024

Thanks for an excellent and exciting package!

I can second this install error error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2 I am on Windows 10 and using python 3.6 as well

from prophet.

ritviksahajpal avatar ritviksahajpal commented on July 27, 2024

@seanjtaylor , thanks for your reply. I was able to install pystan but only through python setup.py install and not through pip install pystan. Doing python setup.py install for fbprophet does not work. Really looking forward to trying it out.

from prophet.

ritviksahajpal avatar ritviksahajpal commented on July 27, 2024

thanks @seanjtaylor , I tried your code with a couple of .stan files here: https://github.com/stan-dev/example-models/tree/master/basic_estimators

I am able to import pystan ok.

However on the .read() line, I get an error: UnicodeEncodeError: 'ascii' code can't encode characters in position 698-699: ordinal not in range(128). Not sure why this error is arising since I am using python 3.6 which is unicode compliant. Will look more into this

from prophet.

wangyifan1004 avatar wangyifan1004 commented on July 27, 2024

@seanjtaylor thks a lot ,I have troble when pip install fbprophet,then I test the pystan using your code suggested abolve and find something wrong.
Already installed python 3.53, pystan,Visual C++ 2015 Build Tools-win7
when I test the pystan :

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)
y = model.sampling(n_jobs=1).extract()['y']
y.mean() # with luck the result will be near 0
the output:
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_5944b02c79788fa0db5b3a93728ca2bf NOW.

-0.016311821652416087
This may means that stan work well on this test.
But when I test pystan in this way :

import pystan
sm = pystan.StanModel(model_code=open('prophet_linear_growth.stan').read())
output:
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_35bf14a7f93814266f16b4cf48b40a5a NOW.

DistutilsExecError Traceback (most recent call last)
F:\Anaconda2\envs\py33\lib\distutils_msvccompiler.py in compile(self, sources, output_dir, macros, include_dirs, debug, extra_preargs, extra_postargs, depends)
381 try:
--> 382 self.spawn(args)
383 except DistutilsExecError as msg:

F:\Anaconda2\envs\py33\lib\distutils_msvccompiler.py in spawn(self, cmd)
500 os.environ['path'] = self._paths
--> 501 return super().spawn(cmd)
502 finally:

F:\Anaconda2\envs\py33\lib\distutils\ccompiler.py in spawn(self, cmd)
908 def spawn(self, cmd):
--> 909 spawn(cmd, dry_run=self.dry_run)
910

F:\Anaconda2\envs\py33\lib\distutils\spawn.py in spawn(cmd, search_path, verbose, dry_run)
37 elif os.name == 'nt':
---> 38 _spawn_nt(cmd, search_path, dry_run=dry_run)
39 else:

F:\Anaconda2\envs\py33\lib\distutils\spawn.py in _spawn_nt(cmd, search_path, verbose, dry_run)
80 raise DistutilsExecError(
---> 81 "command %r failed with exit status %d" % (cmd, rc))
82

DistutilsExecError: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

During handling of the above exception, another exception occurred:

CompileError Traceback (most recent call last)
in ()
1 import pystan
----> 2 sm = pystan.StanModel(model_code=open('prophet_linear_growth.stan').read())

F:\Anaconda2\envs\py33\lib\site-packages\pystan\model.py in init(self, file, charset, model_name, model_code, stanc_ret, boost_lib, eigen_lib, verbose, obfuscate_model_name, extra_compile_args)
307
308 try:
--> 309 build_extension.run()
310 finally:
311 if redirect_stderr:

F:\Anaconda2\envs\py33\lib\distutils\command\build_ext.py in run(self)
337
338 # Now actually compile and link everything.
--> 339 self.build_extensions()
340
341 def check_extensions_list(self, extensions):

F:\Anaconda2\envs\py33\lib\distutils\command\build_ext.py in build_extensions(self)
446 self._build_extensions_parallel()
447 else:
--> 448 self._build_extensions_serial()
449
450 def _build_extensions_parallel(self):

F:\Anaconda2\envs\py33\lib\distutils\command\build_ext.py in _build_extensions_serial(self)
471 for ext in self.extensions:
472 with self._filter_build_errors(ext):
--> 473 self.build_extension(ext)
474
475 @contextlib.contextmanager

F:\Anaconda2\envs\py33\lib\distutils\command\build_ext.py in build_extension(self, ext)
531 debug=self.debug,
532 extra_postargs=extra_args,
--> 533 depends=ext.depends)
534
535 # XXX outdated variable, kept here in case third-part code

F:\Anaconda2\envs\py33\lib\distutils_msvccompiler.py in compile(self, sources, output_dir, macros, include_dirs, debug, extra_preargs, extra_postargs, depends)
382 self.spawn(args)
383 except DistutilsExecError as msg:
--> 384 raise CompileError(msg)
385
386 return objects

CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

I don't know the reason . could you help me fix this problem? thks a lot!

from prophet.

jbargayo avatar jbargayo commented on July 27, 2024

I'm also having issues with installing pystan on Windows 10, and therefore cannot get fbprophet running either.

With that said, on my mac OS 10.12.3, I was able to install both pystan and fbprophet using pip install, however I cannot get anaconda to recognize them and it says the modules do not exist. I also tried using anaconda/bin/pip install, to ensure pip installed them to the right directory, but it said they were both already installed. Any ideas?

Edit:
Like I assumed, I wasn't using user/anaconda/bin/pip install, but the pip install on root. I have now got it working on my mac. Still not working on Windows 10.

from prophet.

bletham avatar bletham commented on July 27, 2024

@wangyifan1004 if

import pystan
sm = pystan.StanModel(model_code=open('prophet_linear_growth.stan').read())

is failing then I think the issue must be with pystan for Windows, since this same command works in pystan for Linux/OSX. The next step for fixing this I think should be to strip our stan model down to isolate which component is making it fail in Windows, and then ask the pystan team for help. I don't have access to a windows machine at the moment so any help here would be great, otherwise I'll try to get to this soon.

from prophet.

176coding avatar 176coding commented on July 27, 2024

hi @seanjtaylor, I also have this kind of prob, and I have installed pystan and run the pystan demo code successfully, here is the screenshot

qq 20170301004802

but when I run 'pip install fbprophet' or download fbprophet zip file then run 'python setup.py install', I failed, here is the screenshot,
qq 20170301005154

and I am using win10+anaconda+python3.6
thank you in advance.

from prophet.

rjtavares avatar rjtavares commented on July 27, 2024

@bletham I also ran the pystan demo code with no errors but can't pip install fbprophet. I'm on Windows 10.

As you've suggested, I tried to change the prophet_linear_growth model, and I get no errors when I remove the formulas from the line: y ~ normal((k + A * delta) .* t + (m + A * gamma) + X * beta, sigma_obs);

So y ~ normal(delta, sigma_obs); works, y ~ normal(beta, sigma_obs); works, etc... For some reason, y ~ normal(k+m, sigma_obs); also works, but that's the only formula I got to run successfully.

I hope this helps.

from prophet.

bletham avatar bletham commented on July 27, 2024

@rjtavares thanks for your help. Can you check if this code runs?

>>> import pystan
>>> model_code = """
data {
  int n;                                
  int m;                                
  matrix[n, m] A;
  vector[n] y;
}

parameters {
  vector[m] delta;
}

model {y ~ normal(A * delta,1);}
"""
>>> model = pystan.StanModel(model_code=model_code)

from prophet.

sflicht avatar sflicht commented on July 27, 2024

@bletham I'm also having trouble geting fbprophet to install (linux, python 2.7), and the code you just posted does NOT run correctly for me. It raises a CompileError with an unhelpful message (just says gcc failed with exit code 1). Is this a pystan bug? I'm using pystan 2.14.0.0.

Note that I am on linux, so I don't think this is a Windows-specific problem.

from prophet.

ruimgoncalves avatar ruimgoncalves commented on July 27, 2024

I also am facing this problem Win10+Anaconda 3.6+VS2015 but in an virtualenv with python 3.5

    pip:            9.0.1-py35_1
    python:         3.5.3-0
    setuptools:     27.2.0-py35_1
    vs2015_runtime: 14.0.25123-0
    wheel:          0.29.0-py35_0

Here is the full dump

from prophet.

rjtavares avatar rjtavares commented on July 27, 2024

@bletham I get an error with that model. Again, with y ~ normal(delta,1), the model compiles fine.

I don't think the error msg helps, but the console output may help. These are the last lines before it throws the exception:

C:\Users\_\Anaconda3\lib\site-packages\pystan\stan\src\stan/variational/advi.hpp(403): note: see reference to function template instantiation 'double stan::variational::advi<Model,stan::variational::normal_meanfield,RNG_t>::calc_ELBO(const Q &,stan::interface_callbacks::writer::base_writer &) const' being compiled
        with
        [
            Model=anon_model_3b30fd09063e3f75d25ac608ea03998b_namespace::anon_model_3b30fd09063e3f75d25ac608ea03998b,
            RNG_t=boost::random::ecuyer1988,
            Q=stan::variational::normal_meanfield
        ]
c:\users\_\appdata\local\temp\tmp_ieee5xz\anon_model_3b30fd09063e3f75d25ac608ea03998b.hpp(197): error C2784: 'void stan::math::accumulator<double>::add(const std::vector<S,std::allocator<_Other>> &)': could not deduce template argument for 'const std::vector<S,std::allocator<_Other>> &' from 'stan::math::var'
C:\Users\_\Anaconda3\lib\site-packages\pystan\stan\lib\stan_math_2.14.0\stan/math/prim/mat/fun/accumulator.hpp(103): note: see declaration of 'stan::math::accumulator<double>::add'
c:\users\_\appdata\local\temp\tmp_ieee5xz\anon_model_3b30fd09063e3f75d25ac608ea03998b.hpp(197): error C2784: 'void stan::math::accumulator<double>::add(const Eigen::Matrix<S,R,C,|_Rows==&&_Cols!=?:_Cols==&&_Rows!=?:,_Rows,_Cols> &)': could not deduce template argument for 'const Eigen::Matrix<S,R,C,|_Rows==&&_Cols!=?:_Cols==&&_Rows!=?:,_Rows,_Cols> &' from 'stan::math::var'
C:\Users\_\Anaconda3\lib\site-packages\pystan\stan\lib\stan_math_2.14.0\stan/math/prim/mat/fun/accumulator.hpp(88): note: see declaration of 'stan::math::accumulator<double>::add'
c:\users\_\appdata\local\temp\tmp_ieee5xz\anon_model_3b30fd09063e3f75d25ac608ea03998b.hpp(197): error C2893: Failed to specialize function template 'boost::disable_if<boost::is_arithmetic<S>,boost::enable_if<boost::is_same<S,T>,void>::type>::type stan::math::accumulator<T>::add(const S &)'
        with
        [
            T=double
        ]
c:\users\_\appdata\local\temp\tmp_ieee5xz\anon_model_3b30fd09063e3f75d25ac608ea03998b.hpp(197): note: With the following template arguments:
c:\users\_\appdata\local\temp\tmp_ieee5xz\anon_model_3b30fd09063e3f75d25ac608ea03998b.hpp(197): note: 'S=stan::math::var'
c:\users\_\appdata\local\temp\tmp_ieee5xz\anon_model_3b30fd09063e3f75d25ac608ea03998b.hpp(197): error C2893: Failed to specialize function template 'boost::enable_if<boost::is_arithmetic<S>,void>::type stan::math::accumulator<double>::add(S)'
c:\users\_\appdata\local\temp\tmp_ieee5xz\anon_model_3b30fd09063e3f75d25ac608ea03998b.hpp(197): note: With the following template arguments:
c:\users\_\appdata\local\temp\tmp_ieee5xz\anon_model_3b30fd09063e3f75d25ac608ea03998b.hpp(197): note: 'S=stan::math::var'

It stops here every time.

from prophet.

bletham avatar bletham commented on July 27, 2024

Great, the issue seems to be that pystan in Windows will not compile models with matrix multiplication. @rjtavares would you be willing to post an issue with pystan (https://github.com/stan-dev/pystan) where you could include include the minimal failing example from above along with the full traceback? Hopefully it's something they can fix.

from prophet.

monkeydust avatar monkeydust commented on July 27, 2024

Similar issue in R. Any help appreciated.

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! bash.exe: warning: could not find /tmp, please create!
/usr/bin/sh: C:/Users/Rav/ANACON1/R/../Library/mingw-w64/bin/g++: No such file or directory
make: *** [file229841b71210.o] Error 127
Warning message:
running command 'make -f "C:/Users/Rav/ANACON
1/R/etc/x64/Makeconf" -f "C:/Users/Rav/ANACON1/R/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file229841b71210.dll" WIN=64 TCLBIN=64 OBJECTS="file229841b71210.o"' had status 2
In addition: Warning message:
running command 'C:/Users/Rav/ANACON
1/R/bin/x64/R CMD SHLIB file229841b71210.cpp 2> file229841b71210.cpp.err.txt' had status 1

from prophet.

bletham avatar bletham commented on July 27, 2024

@monkeydust in R the source of the issue would be different than here. Check that rstan is working:

library(rstan)
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
fit <- stan(model_code=model_code)  # this will take a minute
mean(extract(fit)$y)  # should be close to 0

and if that runs without errors but Prophet isn't working, go ahead and open a new issue so we can debug there. (If rstan errors above, try re-installing RTools).

from prophet.

monkeydust avatar monkeydust commented on July 27, 2024

Hi bletham - I reinstalled RTools, resarted machine, ran Rstudio and did what you suggested. I get errors - so rstan isnt working - trace here ( http://pastebin.com/dhNP2cNr ) - if you can quickly see whats wrong would appreciate your help. Rav

from prophet.

bletham avatar bletham commented on July 27, 2024

@monkeydust It seems that it can't find the c++ compiler; the rstan instructions here have some tips on what to check, in particular make sure you check the box to edit the system path while installing Rtools: https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Windows#toolchain

from prophet.

bilalmahmood1 avatar bilalmahmood1 commented on July 27, 2024

Hey bletham,
When I try your suggestion:

import pystan
model_code = """
data {
int n;
int m;
matrix[n, m] A;
vector[n] y;
}

parameters {
vector[m] delta;
}

model {y ~ normal(A * delta,1);}
"""

model = pystan.StanModel(model_code=model_code)

I get the following error:
distutils.errors.CompileError: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

Can you please suggest what I should do to make pip install fbprophet to work.
Thanks

from prophet.

agiani99 avatar agiani99 commented on July 27, 2024

@bletham Hi, thanks forall support.
I suspect that issue #2 and #85 could be merged, eventually. I managed to have pystan running on W10 with conda (python3.6): your code 1) is working while code 2) with matrix operation does not. I cannot pip install fbprophet in this situation,too.

PS Error got is however on cl.exe from VS14 in my case.

from prophet.

rmax avatar rmax commented on July 27, 2024

@agiani99 here is a potential fix #96

Could you try installing from this source? https://github.com/rolando-contrib/prophet/archive/windows-stan-compat.zip Update: changes merged, use latest git version

from prophet.

agiani99 avatar agiani99 commented on July 27, 2024

@rolando
Thx Rolando. I have already installed fbprophet in R. Rstan works. I have only problem in installing fbprophet in python 3.6 (conda). I will try to look into #96

from prophet.

bletham avatar bletham commented on July 27, 2024

A huge thanks to @rolando who fixed this in #96. Please install the latest version from github and see if it is working for you or if you have any additional issues.

from prophet.

dobbmeep avatar dobbmeep commented on July 27, 2024

Excellent, works fine for me now. Thank you very much!

from prophet.

monkeydust avatar monkeydust commented on July 27, 2024

still struggling to get this installed on windows, step-by-step instructions would be appreciated if this finally works. thanks

from prophet.

agiani99 avatar agiani99 commented on July 27, 2024

from prophet.

monkeydust avatar monkeydust commented on July 27, 2024

@rolando thanks. I did that but get this error on Pystan. Any idea?

C:\Users>pip install pystan
Collecting pystan
Using cached pystan-2.14.0.0.tar.gz
Requirement already satisfied: Cython!=0.25.1,>=0.22 in c:\users\rav\miniconda3\lib\site-packages (from pystan)
Requirement already satisfied: numpy>=1.7 in c:\users\rav\miniconda3\lib\site-packages (from pystan)
Building wheels for collected packages: pystan
Running setup.py bdist_wheel for pystan ... error
Complete output from command C:\Users\Rav\Miniconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Rav\AppData\Local\Temp\pip-build-b2ikcydb\pystan\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\Rav\AppData\Local\Temp\tmpz_ufxr24pip-wheel- --python-tag cp36:
Compiling pystan/api.pyx because it depends on C:\Users\Rav\Miniconda3\lib\site-packages\Cython\Includes\libcpp_init.pxd.
Compiling pystan/_chains.pyx because it depends on C:\Users\Rav\Miniconda3\lib\site-packages\Cython\Includes\libcpp\vector.pxd.
[1/2] Cythonizing pystan/_chains.pyx
[2/2] Cythonizing pystan/_api.pyx
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\pystan
copying pystan\api.py -> build\lib.win-amd64-3.6\pystan
copying pystan\chains.py -> build\lib.win-amd64-3.6\pystan
copying pystan\constants.py -> build\lib.win-amd64-3.6\pystan
copying pystan\misc.py -> build\lib.win-amd64-3.6\pystan
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\dir_148120812de7344119b120632cfcec74.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\dir_1dcd98e7c4f45b41e0c83c911c6e550e.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html

...

copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\dir_20b155cb57d7a56b3d8d0cc440c20c67.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\dir_218f7c98404744c2444933b45636fd56.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_vars_p.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_vars_r.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_vars_s.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_vars_t.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_vars_v.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_vars_x.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_vars_y.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_w.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_x.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\functions_y.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\globals.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\globals_defs.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\globals_vars.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\hierarchy.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\index.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\jquery.js -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\menu.js -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\menudata.js -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\modules.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\namespacemembers.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\namespacemembers_func.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\namespacemembers_type.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\namespacemembers_vars.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\namespaces.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\tabs.css -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html
creating build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0
creating build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d00
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d00\structstan_1_1math_1_1store__type_3_01int_01_4-members.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d00
creating build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d02
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d02\rev_2core_2operator__greater__than__or__equal_8hpp.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d02
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d02\rev_2core_2operator__greater__than__or__equal_8hpp_source.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d02
creating build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d05
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d05\classstan_1_1math_1_1op__vector__vari.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d05
creating build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d06
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d06\vvd__vari_8hpp.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d06
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d06\vvd__vari_8hpp_source.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d06
creating build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d0d
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d0d\structstan_1_1math_1_1sinh__fun-members.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d0d
creating build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d0f
copying pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d0f\structstan_1_1is__vector__like_3_01_eigen_1_1_matrix_3_01_t_00_01_eigen_1_1_dynamic_00_01_eigen_1_1_dynamic_01_4_01_4-members.html -> build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d0f
error: could not create 'build\lib.win-amd64-3.6\pystan\stan\lib\stan_math_2.14.0\doc\api\html\d0\d0f\structstan_1_1is__vector__like_3_01_eigen_1_1_matrix_3_01_t_00_01_eigen_1_1_dynamic_00_01_eigen_1_1_dynamic_01_4_01_4-members.html': No such file or directory

----------------------------------------

Command "C:\Users\Rav\Miniconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Rav\AppData\Local\Temp\pip-build-b2ikcydb\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\Rav\AppData\Local\Temp\pip-k994v6n5-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Rav\AppData\Local\Temp\pip-build-b2ikcydb\pystan\

from prophet.

rmax avatar rmax commented on July 27, 2024

@monkeydust oh, you are using python 3.6 and there are no windows pystan's wheels for that version: https://pypi.org/project/pystan/#files

However, conda-forge recently released win packages for pystan. Try: conda install -c conda-forge pystan

from prophet.

vincentyzzh avatar vincentyzzh commented on July 27, 2024

@rolando I followed your instructions:

Follow this instructions to install pystan: https://pystan.readthedocs.io/en/latest/windows.html
Download the latest development version: https://github.com/facebookincubator/prophet/archive/master.zip
Run python setup.py install inside the python directory.

and I got this error:
runfile('C:/Users/vince/Desktop/Individual Research Project/prophet-master/prophet-master/python/setup.py', wdir='C:/Users/vince/Desktop/Individual Research Project/prophet-master/prophet-master/python')
C:\Apps\Anaconda\lib\site-packages\IPython\core\interactiveshell.py:2889: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
An exception has occurred, use %tb to see the full traceback.

SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: no commands supplied

Do you have any idea about this? I'm using win10 and Python 3.5.2 |Anaconda 4.3.1 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]. Thank you!

from prophet.

rmax avatar rmax commented on July 27, 2024

@vincentyzzh It's odd that it mentions IPython there. How are you running the command? You should write either python setup.py install or pip install . in the command console.

Just in case, when you install pystan it should install as well Cython, if not make sure to run either conda install cython or pip install cython before installing fbprophet from the github source.

from prophet.

vincentyzzh avatar vincentyzzh commented on July 27, 2024

@rolando thanks for your reply.
I'm using spyder to run the setup.py file. I realised that I was using the Ipython console to run the file, I guess that's why it went wrong. Now I switched it to python console and re-run the setup.py, it shows this:

Python 3.5.2 |Anaconda 4.3.1 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "l
runfile('C:/Users/vince/Desktop/Individual Research Project/prophet-master/prophet-master/python/setup.py', wdir='C:/Users/vince/Desktop/Individual Research Project/prophet-master/prophet-master/python')
it just get stuck here for a very long time with no responds, so I tried to import fbprophet and I got this:
import fbprophet
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: no commands supplied
Do you know what should I do?

from prophet.

tommybutler avatar tommybutler commented on July 27, 2024

If folks are willing to consider using Prophet on windows under cygwin (my preference), as long as the underlying pystan issues are fixed, prophet installs and works fine.

The underlying pystan issues are outlined here --> #92

I patched my own pystan installation to fix the problems it causes, but I think its maintainers should be the ones to decide on how to fix their problems with windows, because they could have security implications. See above link for details.

from prophet.

bletham avatar bletham commented on July 27, 2024

This should now be fixed in the pip version (0.1.1). Can someone try to install from pip in Windows and see if it works?

from prophet.

tyokota avatar tyokota commented on July 27, 2024

@bletham: I was able to use pip to install fbprophet on Windows with Anaconda Python 3.6.

  • Checked pip was the latest version: python -m pip install -U pip
  • Installed pystan via conda-forge: conda install -c conda-forge pystan
  • Installed fbprohet via pip: pip install fbprophet

from prophet.

bletham avatar bletham commented on July 27, 2024

Great, thanks @tyokota . And thanks again to @rolando for actually fixing the issue!

I'm going to close this issue, any further install issues in Windows will have a different cause so we'll handle them in a new issue.

from prophet.

Alvaron06 avatar Alvaron06 commented on July 27, 2024

I am also facing the same Issue. I have installed pystan and Facebook prophet but still jupiter doesn't recognize it.

from prophet.

bletham avatar bletham commented on July 27, 2024

Could you try these steps to install both from conda-forge?

conda install -c conda-forge pystan
conda install -c conda-forge fbprophet

from prophet.

chervov avatar chervov commented on July 27, 2024

I have trouble installing fbprophet on windows.
pip install fbprophet
generates error:
io.h: No such file or directory

See details at:
https://stackoverflow.com/questions/51463548/pip-install-fbprophet-error-io-h-no-such-file-or-directory-error-command

After some modifcations now I am getting another error:
" ImportError: cannot import name 'StanModel' "

If I am trying to use "conda install"
I get:

Executing transaction: failed
ERROR conda.core.link:_execute(502): An error occurred while installing package
'conda-forge::pystan-2.17.1.0-py36_vc14_0'.
PermissionError(13, 'Permission denied')
Attempting to roll back.

Rolling back transaction: done

PermissionError(13, 'Permission denied')

from prophet.

bletham avatar bletham commented on July 27, 2024

The issue here is that pystan is not installing correctly.

Could you try conda clean --all followed by conda update pystan?

See also https://stackoverflow.com/questions/49181799/conda-update-conda-permission-error which might have some things to try for this PermissionError, which I'm not sure the source of.

Ultimately you can check that pystan is working by running

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)  # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean()  # should be close to 0

Once that runs without error, fbprophet should install fine.

from prophet.

Duttabhi avatar Duttabhi commented on July 27, 2024

I am also on Windows 10. pip install fbprophet exits with status 1 every time. Pls, reopen this chat it doesn't seem anyone has solved the problem.

from prophet.

bletham avatar bletham commented on July 27, 2024

@Duttabhi can you check if pystan is working by running this code?

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)  # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean()  # should be close to 0

It sounds to me like PyStan is not working, probably because the C++ compiler has not be configured as needed. PyStan is a bit of a pain to install in Windows from scratch, I highly recommend using Anaconda as described at the bottom of https://facebook.github.io/prophet/docs/installation.html#python . I have personally not been successful in attempts to configure PyStan outside of Anaconda.

from prophet.

Duttabhi avatar Duttabhi commented on July 27, 2024

@Duttabhi can you check if pystan is working by running this code?

import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)  # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean()  # should be close to 0

It sounds to me like PyStan is not working, probably because the C++ compiler has not be configured as needed. PyStan is a bit of a pain to install in Windows from scratch, I highly recommend using Anaconda as described at the bottom of https://facebook.github.io/prophet/docs/installation.html#python . I have personally not been successful in attempts to configure PyStan outside of Anaconda.

Yup, it's working. Thank you! I wasn't getting the build tools correctly. I installed it from visual studio. Then I followed: https://pystan.readthedocs.io/en/latest/windows.html

from prophet.

connor-jones avatar connor-jones commented on July 27, 2024

Has this still not been resolved? Been waiting so long for this.

from prophet.

ErikRobinson94 avatar ErikRobinson94 commented on July 27, 2024

Has this been resolved, I can't get prophet to work either :( i keep getting the error that hat fbprophet is not a model which i suspect is due to stan.

from prophet.

siehienp20 avatar siehienp20 commented on July 27, 2024

Has to be some weird quirk. On a fresh comp, anaconda install will configure c++ fine, but deleting everything on current comp, and reinstalling w anaconda still does not fix the issue. I think certain programs (like Unity) install c++ and change how it interacts with python. PyStan is “working” on the reinstall, but I still get same error message for pystan.

Solution seems to be remove any language/language packs from other programs, make sure the path isn’t messed up, and reinstall via anaconda. Not verified, but working on it now..

from prophet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.