Skip to content

DOC: improve documentation for building extensions on windows #12428

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@ For a python 3 environment::

conda create -n pandas_dev python=3 --file ci/requirements_dev.txt

.. warning::

If you are on Windows, then you will also need to install the compiler linkages::

conda install -n pandas_dev libpython
If you are on Windows, see :ref:`here for a fully compliant Windows environment <contributing.windows>`.

This will create the new environment, and not touch any of your existing environments,
nor any existing python installation. It will install all of the basic dependencies of
Expand Down Expand Up @@ -207,6 +206,29 @@ See the full conda docs `here <http://conda.pydata.org/docs>`__.

At this point you can easily do an *in-place* install, as detailed in the next section.

.. _contributing.windows:

Creating a Windows development environment
------------------------------------------

To build on Windows, you need to have compilers installed to build the extensions. You will need to install the appropriate Visual Studio compilers, VS 2008 for Python 2.7, VS 2010 for 3.4, and VS 2015 for Python 3.5.

For Python 2.7, you can install the ``mingw`` compiler which will work equivalently to VS 2008::

conda install -n pandas_dev libpython

or use the [Microsoft Visual Studio VC++ compiler for Python](https://www.microsoft.com/en-us/download/details.aspx?id=44266). Note that you have to check the ``x64`` box to install the ``x64`` extension building capability as this is not installed by default.

For Python 3.4, you can download and install the [Windows 7.1 SDK](https://www.microsoft.com/en-us/download/details.aspx?id=8279)
For Python 3.5, you can download and install the [Visual Studio 2015 Community Edition](https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx).

Here are some references:

- https://github.com/conda/conda-recipes/wiki/Building-from-Source-on-Windows-32-bit-and-64-bit
- https://cowboyprogrammer.org/building-python-wheels-for-windows/
- https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/
- https://support.enthought.com/hc/en-us/articles/204469260-Building-Python-extensions-with-Canopy

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they're going to support it in numpy and scipy, I suppose pandas can do the same: I can install pandas on Cygwin as well using its gcc compiler. That would be worth mentioning in case someone already has numpy installed on Cygwin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem with adding this at some point. but AFAICT this is a bit non-trivial ATM. There are straightforwad ways to build extensions now that have been long in practice and are fully compatible. Let's have numpy/scipy use and abuse then can build off of that. You can create another issue (with some links) and I will mark similarly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a link, but I just did it about ten minutes ago. All you need are the gcc packages and Cygwin's Python. pandas is fully capable at this point AFAICT to allow this. In fact, it's even simpler with pandas relative to numpy/scipy because you don't need additional libraries (e.g. BLAS) to build pandas.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gfyoung I agree, but I would like to see this actually used (and try myself). Further AFAICT no-one distributes cygwin python. is this compat with conda?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I don't believe conda is compatible with Cygwin (at least I haven't been able to do so).

  2. I don't quite follow your comment about no one distributing Cygwin Python. It comes as an optional package during Cygwin installation.

  3. When you say "actually used," are you referring to seeing other people using / testing with it outside of just myself?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gfyoung yes, we basically recommend using a conda install now as its the most straightforward / easiest way of doing this (on windows). my impression was that mingw-64 just became available / stable. I'd like to see this in common use before we recommend its use to build.

In any event, simply create another issue and can discuss there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. It's not absolutely necessary to add mention of Cygwin since conda should work just fine in this case given the fewer constraints vs. numpy or scipy. I'll create another issue for it.

.. _contributing.getting_source:

Making changes
Expand All @@ -231,6 +253,7 @@ just checked out. There are two primary methods of doing this.
from your development directory. Thus, you can always be using the development
version on your system without being inside the clone directory.


.. _contributing.documentation:

Contributing to the documentation
Expand Down