-
-
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,9 +135,67 @@ 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 | ||
* Unix: https://devguide.python.org/setup/#unix-compiling | ||
**Windows** | ||
|
||
The building command depends on the architecture of the Python interpreter, | ||
32-bit or 64-bit. You can check the architecture by running the following in | ||
``cmd`` or ``powershell`` console:: | ||
|
||
python -c "import struct; print(struct.calcsize('P') * 8)" | ||
|
||
The above commands assume that you have the Python installation folder in your | ||
PATH environment variable. | ||
|
||
You will need `Build Tools for Visual Studio 2017 | ||
<https://visualstudio.microsoft.com/downloads/>`_. | ||
|
||
.. warning:: | ||
You DO NOT need to install Visual Studio 2019. | ||
You only need "Build Tools for Visual Studio 2019" found by | ||
scrolling down to "All downloads" -> "Tools for Visual Studio 2019". | ||
|
||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. cc @chris-b1 |
||
|
||
Please be aware that the path above might be different from user to user. | ||
The aim is to point to the "vcvarsall.bat" file. | ||
|
||
And build pandas from this environment:: | ||
|
||
python setup.py install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Oh yes, that was silly of me. |
||
|
||
Replace ``x64`` with ``x86`` to build for 32-bit Python. | ||
|
||
**Mac OS** | ||
|
||
Information about compiler installation can be found here: | ||
https://devguide.python.org/setup/#macos | ||
|
||
**Unix** | ||
|
||
Some Linux distributions will come with a pre-installed C compiler. To find out | ||
which compilers (and versions) are installed on your system:: | ||
|
||
# for Debian/Ubuntu: | ||
dpkg --list | grep compiler | ||
# for Red Hat/RHEL/CentOS/Fedora: | ||
yum list installed | grep -i --color compiler | ||
|
||
`GCC (GNU Compiler Collection) <https://gcc.gnu.org/>`_, is a widely used | ||
compiler, which supports C and a number of other languages. If GCC is listed | ||
as an installed compiler nothing more is required. If no C compiler is | ||
installed (or you wish to install a newer version) you can install a compiler | ||
(GCC in the example code below) with:: | ||
|
||
# for recent Debian/Ubuntu: | ||
sudo apt install build-essential | ||
# for Red Had/RHEL/CentOS/Fedora | ||
yum groupinstall "Development Tools" | ||
|
||
For other Linux distributions, consult your favourite search engine for | ||
commpiler installation instructions. | ||
|
||
Let us know if you have any difficulties by opening an issue or reaching out on | ||
`Gitter`_. | ||
|
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!