Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upPyStan 2.18.0.0 compilation failure on macOS in Anaconda environment. #521
Comments
This comment has been minimized.
This comment has been minimized.
PyStan doesn't yet support Python 3.7. We're working on it. |
This comment has been minimized.
This comment has been minimized.
I get exactly the same failure with Python 3.6. |
This comment has been minimized.
This comment has been minimized.
Hi, can you try on a new conda environment? Anaconda might have it's own libc++ / libstdc++ files that are not compatible with osx clang. |
This comment has been minimized.
This comment has been minimized.
Yes, creating a new conda environment works, both for new environments with Python 3.6.6 and Python 3.7.0, created, respectively with
I had previously gotten that to work. I do think something changed between PyStan 2.17.1.0 and PyStan 2.18.0.0, because with the former, I do not need to create a new environment; it just works with Anaconda. Sorry if I was not clear, but this is the issue I am reporting. |
This comment has been minimized.
This comment has been minimized.
Hi, Thanks for the info. It really seems a bit bizarre. In your example you use 2.18 must have a compiler with C++11 support, and osx-clang might have a problem with that. What I mean is that even if vanilla clang version x.yz has support for it macosx clang x.yz is not. Maybe we can try to find out if this is the problem? |
This comment has been minimized.
This comment has been minimized.
I confirm that pystan=2.18.0.0 fails to compile models under a conda environment on macOS, whereas pystan=2.17.1.0 succeeds. The error messages for 2.18.0.0 are different for me than for @justinbois, but possibly related to the same underlying issues, e.g.:
and
|
This comment has been minimized.
This comment has been minimized.
This is a compiler problem with C++11. For the conda environment does There is some incompatibility between libc and libstd. Could you try on a fresh env? |
This comment has been minimized.
This comment has been minimized.
But I assume those are generic deprecation warnings that you are already aware of. This conda problem might be avoidable by including |
This comment has been minimized.
This comment has been minimized.
@justinbois Well, I face this warning when I run the Eight school problem :
|
This comment has been minimized.
This comment has been minimized.
It comes from Cython and it is already fixed. The current release is |
This comment has been minimized.
This comment has been minimized.
I tried
followed by
on OS X Mojave 10.14.2, and I'm still getting
|
This comment has been minimized.
This comment has been minimized.
Hi, I think there is some bug with Can you first create environment and activate it, and then, |
This comment has been minimized.
This comment has been minimized.
I did
I still get |
This comment has been minimized.
This comment has been minimized.
That CompileError is coming when you try to install pystan or when you try to compile model? Have you installed xcode/xcode command line tools + opened xcode to accept all the needed acceptions. |
This comment has been minimized.
This comment has been minimized.
The CompileError is when I try to compile a model. I have the xcode command line tools. I don't see xcode so I guess I'll fight with the app store to download that. I had pystan working on this computer before Mojave though?! |
This comment has been minimized.
This comment has been minimized.
Yeah, the command-line-tools should be enough. Can you uninstall gcc from conda and then try to compile model. There is some problems with headers/stdlibc++/libc++ etc with Mojave xcode (Mojave moved to libc++ only and some stuff is breaking with this, also I'm not sure about the C++11 thing with default compiler on mojave). Also Can you search for the error message (if you use Jupyter, error message is in the terminal) what it says. Is it missing ios without conda gcc? |
This comment has been minimized.
This comment has been minimized.
I ran into this a while ago, and I got this tip from @gchure: Apple moved where the headers live (i.e.
It fixed my problem. |
This comment has been minimized.
This comment has been minimized.
This is the error message in the terminal:
I uninstalled conda gcc, and scipy and seaborn no longer import. The terminal told me to run So I installed conda gcc again and tried |
This comment has been minimized.
This comment has been minimized.
So I think there are multiple things going on. So if you can, remove the conda env and create a new one. Don't install gcc from conda. Make sure Run the following Install pystan with pip. |
This comment has been minimized.
This comment has been minimized.
Going forward, I think support for conda's gcc should be part of testing. More and more people are using Anaconda, especially on non-Linux machines, and many conda packages will install conda's gcc. For that matter, conda's gcc is superior along many dimensions to the native or brew (etc.) gcc on OSX. It is usually just a matter of adding one include or library flag to the gcc call. |
This comment has been minimized.
This comment has been minimized.
@rgerkin I think testing using conda's gcc is a good idea. Do you know of a Python package with a compiled extension module that uses conda's gcc? |
This comment has been minimized.
This comment has been minimized.
See updated toolchain instructions (docs) Closing due to inactivity. Can be reopened if needed. |
This comment has been minimized.
This comment has been minimized.
still pystan don't support python 3.7? i am having the same problem and i am using python 3.7 on ubuntu |
This comment has been minimized.
This comment has been minimized.
PyStan 2.19.1 has python 3.7 wheel for Linux |
This comment has been minimized.
This comment has been minimized.
I wanted to add my experience after having the same initial problem. It turned out the problem was that I used a conda environment and installed PyStan using
also installs all dependencies so everything works fine. I am using python 3.7 so that also works. |
Summary:
PyStan 2.18.0.0 installed in Anaconda with Python 3.7 on macOS has a compiler error.
Description:
I have tested this on multiple Macs, running 10.12, 10.13, and 10.14, with Anaconda installations using Python 3.6 and Python 3.7. Compilation of any Stan model (a simple one shown below) fails with the error show below. This is not an issue with PyStan 2.17.1.0.
Reproducible Steps:
Upon a fresh installation of Anaconda with Python 3.7, I ran the following code.
Current Output:
The current output. Knowing what is the current behavior is useful.
Expected Output:
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_8b588fdcf67e45da3e1122393e447758 NOW.
PyStan Version:
2.18.0.0. The expected output above was produced with PyStan version 2.17.1.0, which has no problems.
Python Version:
3.7.0. Also fails with 3.6.x.
Here are the dependencies:
Operating System:
Above example produced with macOS 10.13.6.