-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Improve compiler installation instructions #28316
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
Conversation
Thanks for the PR. I'm indifferent as to whether or not some of this should be included. Good to have but main concern will be keeping relevant (ex: Xcode 4.2 mentioned was released 8 years ago) Just out of curiosity have you tried using a conda installed compiler? Wondering if that wouldn't make configuration and installation easier for newcomers: https://www.anaconda.com/utilizing-the-new-compilers-in-anaconda-distribution-5/ |
Main concern was that the links in the current documentation direct to pages that do not actually talk about how to install a C compiler. This is confusing and I think this is a barrier for new contributors. Happy to change doc to just link to conda and state that there are alternative ways of installing compilers and they can use if they wish? |
Maybe - haven't tried personally so don't know of any limitations that would have w.r.t. pandas. Interested in trying it out on your end? |
I'm not sure if a conda installed compiler is a good option as it is designed for building conda packages. However, installing a compiler from conda forge may be a good option for Mac. I believe @ogrisel and @jeremiedbb are looking into compiler installation for Mac and then updating the sklearn contributing docs. I think I will link/copy theirs once they are done. Meanwhile I might copy the windows section from sklearn instead of just linking to it. |
@WillAyd the link about the conda compilers you give is a link about using those compilers when building packages, but not about installing those in a user (contributor) environment. However, conda-forge wrapped those in a meta-package that can be installed: https://anaconda.org/conda-forge/compilers. But, we first need to have more testing of this I think to be sure to recommend this. In the meantime, this PR is already a big improvement over the current useless links (except for the mac part which is incorrect, maybe we should just leave that out for now). |
@@ -135,9 +135,35 @@ operations. To install pandas from source, you need to compile these C | |||
extensions, which means you need a C compiler. This process depends on which | |||
platform you're using. | |||
|
|||
* Windows: https://devguide.python.org/setup/#windows-compiling | |||
* Mac: https://devguide.python.org/setup/#macos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Mac, the https://devguide.python.org/setup/#macos link actually has some explanation about installing XCode, so maybe for this one we can keep the link until we have better instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have replaced my Mac instructions with just the link above.
I've also changed formatting - happy to change back as well @jorisvandenbossche
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting looks good!
|
||
And build pandas from this environment:: | ||
|
||
python setup.py install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed here, as we first still need to install all dependencies which is only mentioned below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, that was silly of me.
For 64-bit Python, configure the build environment with:: | ||
|
||
SET DISTUTILS_USE_SDK=1 | ||
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this step is not needed for pandas, as we use setuptools and not distutils as scikit-learn does (based on https://wiki.python.org/moin/WindowsCompilers#Distutils_notes, at least the env variables is not needed for setuptools)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @chris-b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm @jorisvandenbossche
Thanks @lucyleeow ! We can always further try to improve it (eg if we know the conda-forge compilers can help), but merging this as it is a good improvement over the current links. |
Note:
sudo apt-get install build-essential
andyum groupinstall "Development Tools"
whereas in the sklearn installation page have recommended to install GCC withsudo apt-get install build-essential
but to install individually for Fedora etc: `sudo yum -y install gcc gcc-c++``Which would be better?