-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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 error ModuleNotFoundError: No module named 'pystan' #401
Comments
That's odd. Did pystan actually install?
If not could you try
and see if it works? and then same for fbprophet? |
I encountered the same issue upon install |
@maartenmennes Can you check the pystan info from my previous post? and is there Anaconda or something like that involved? |
everything seemed to have installed fine, despite the error message regarding pystan. It was a clean environment created on centos7.2 with: conda create --name py36 python=3.6 anaconda |
Including fbprophet is working? |
Yep, |
Interesting, I'm not sure what is going on with that error, I haven't seen this myself with pip installs. As for ds and y, yes that definitely should give better error messages, #433. |
It seems this error only occurs when package wheel is already installed. If wheel is not installed, setup.py bdist_wheel will not be invoked. If wheel is installed, wheel building fails because it happens before pystan has been installed. Perhaps pystan should be listed in both install_requires and setup_requires? |
I have seen this issue too: +1 for including |
Just recently came across this and found that removing pystan and re-installing it, I was able to build/install fbprophet. |
@k6ef Yes, simply retrying the installation will usually work because PyStan is installed after fbprophet fails the first time. Be nice if it worked first time though. |
So, adding pystan to setup_requires does indeed make sure that it is in place before trying to build fbprophet, and thus avoids this confusing error message. However, it seems (TIL) that pip does not directly interact with setup_requires. Rather, during the build it uses easy_install to install everything from setup_requires. easy_install does not support wheels, and so it means that pystan has to be built from source. This takes forever and uses a ton of RAM. It is thus not a good option here. I think the best fix we can get for this is just to update the install instructions to say to install pystan with pip before installing fbprophet with pip. |
This is on the release notes for pip 10:
I did a quick check and adding Should I send a merge request? It's a very simple change:
|
Struggled with this issue too today while installing fbprophet on Ubuntu 16.04. Only thing that helped me to solve this issue: upgrade pip to version 10 and later After that |
Here are some commands to repro this issue:
@rogeriomgatto that seems to do the trick, do you want to make a PR? I'll merge it ASAP if you do. That will only fix the issue for pip >= 10, but that is a reasonable requirement. The issue can also be fixed by |
#685 just got merged which fixes this for pip >=10 by using a pyproject.toml file. |
This has been pushed to PyPI and should be fixed now for pip >=10. |
We reverted the addition of the pyproject.toml file in 34af9ef. Here's the deal: fbprophet requires pystan to build. If pystan is not already installed, this is a problem: Pystan is needed to build the wheel in (1), but is not installed until (2). Thus building the wheel fails with the error at the start of this issue. The issue is not super serious, because when the wheel fails to build, step (3) is replaced with installing the package from source, which then succeeds because it happens after pystan is installed in (2). But having an error message during install is obviously not ideal and can be confusing to users. Note also that if pystan is already installed, the wheel will successfully build. Hence we tried to solve the problem in the recommended way, which is to specify build dependencies in a pyproject.toml file. This changes the This solves the problem because pytsan is installed in the build environment prior to building the wheel. However, it introduces another significant issue: The build environment is no longer the same as the run environment. Pystan is installed from scratch in the build environment, and is not necessarily the same version or configured in the same way as in the run environment, which is really problematic because Pystan can require some special configuration to get it to build correctly. We ran into a specific issue with this in OSX where building the wheel would fail in the build environment, but work fine outside the build environment. The issue is that Pystan is not hooked up correctly to the C++ compiler in the build environment - we haven't figured out why yet, but if we ran into this issue on one of our machines certainly other users will too. Another issue is that the build environment does not necessarily have the same version of Pystan as the system. For instance, I have Pystan 2.18.0 installed in my system python, but the build environment pulled the latest version of Pystan (2.18.1) and built the wheel using that. This can be a serious issue for users that already have pystan installed and are upgrading fbprophet, because changes in Stan can make it so that models compiled under one version of Pystan cannot be loaded in another. For instance, if I have Pystan 2.14 installed, the models will be compiled under Pystan 2.18.1, but my local 2.14 will not be upgraded. When I try to load the models in my 2.14, it will fail. We need to be sure that the Pystan used in the build environment is the same version and hooked up the same way as in the system py, and so have removed pyproject.toml until we figure out how that can be done. In the meantime: If you get this error, you can ignore it. If you don't want to avoid it, just install pystan before installing fbprophet. |
I had this issue with Python 3.9, miniconda debian docker image If you are currently having issues with importing pystan in fbprophet, this is most likely caused by pystan 3.0.
I recommend to downgrade pystan to Installation worked for me to install pystan using conda, and fbprophet using pip If you would like to use 3.9 - check that g++, gcc is installed. |
I can't seem to find any |
According to the installation page of FbProphet: Install pystan with pip before using pip to install prophetpystan>=3.0 is currently not supported$ pip install pystan==2.19.1.1 |
As @z4yed said, this works for me. $ python3 -m pip install "pystan==2.19.1.1" You saved my day! Thank you. |
… (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
… (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
just change version of pystan and install this power full library |
@johnnyheineken Could you make pystan(2.19.1.1) work with Python 3.9? I am still getting the same error:
|
… (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
… (comment) Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
I'm still facing this issue. Can you tell me what to do exactly so this error won't be there? So much confused right now, been stuck on this for so long. |
@shraddhajadhav7 , Prophet 1.1 has been released and has simplified the install workflow and removed the Pystan requirement You can now |
I just went through the same problem and resolved it using this issues (which was replied by a meta employee):
|
As of May 15, 2023, this approach does not work. |
Closing due to PyStan no longer being a dependency of |
However with the second run it showed no error
The text was updated successfully, but these errors were encountered: