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

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Feb 23, 2016

No description provided.

@jreback jreback added Build Library building on various platforms Docs labels Feb 23, 2016
@jreback jreback added this to the 0.18.0 milestone Feb 23, 2016
@jreback
Copy link
Contributor Author

jreback commented Feb 23, 2016

cc @jorisvandenbossche
cc @Dr-Irv

@jreback
Copy link
Contributor Author

jreback commented Feb 23, 2016

@jorisvandenbossche can you give a try with 3.5 when you have a chance, then update this as to steps that are needed. I don't think you actually need to do any pathing with VS2012. It should just work.

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, and VS2012 for Python 3.5.

Choose a reason for hiding this comment

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

VS 2010 for Python 3.2-3.4, VS 2015 for Python 3.5+

For VS2008, users may install either mingw, or the MS VC++ compiler for Python: https://www.microsoft.com/en-us/download/details.aspx?id=44266

For VS2010, users may install the Windows 7.1 SDK.

@gfyoung
Copy link
Member

gfyoung commented Feb 23, 2016

+1 for this. I am trying to do similar documentation for numpy and scipy actually, so it's great to see all the libraries coming together at once to improve building for Windows!


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 VS2008::
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to specify the mingw-w64 project explicitly? I imagine that the old mingw should work so long as you install pre-built versions of numpy and scipy, but it seems reasonable to encourage people to use the more recent project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you have a pointer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, what would be a minimal example to use mingw-64 to compile on windows?

Copy link
Member

Choose a reason for hiding this comment

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

If you mean a link to the project, yes, here

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean by minimal example? Unfortunately, I myself have had issues downloading mingw-64 because my machine already has mingw installed, but from what I have seen in the numpy discussions, that seems to be the way to go now. If we want more feedback on this, perhaps we could grab someone from there to provide input?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is very new and I haven't tried it
if it's simple and just works then great

that can be a follow up to this

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Feb 23, 2016

Maybe have instructions for different versions of Visual Studio?? In my case, I need VS2012 for another project (and have a valid license), so I don't want to install VS2015 so that things don't get messed up on my laptop.

@jreback
Copy link
Contributor Author

jreback commented Feb 23, 2016

@Dr-Irv once these are installed (and they can all be installed separately), they are independent. You shouldn't need any addtl after these installations. On a VM I did exactly that.

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Feb 23, 2016

@jreback My colleagues have had issues in other projects (.NET, C++, etc.) where having multiple versions caused issues. So I followed their advice. You have to be really careful with the PATH.

- 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.

@msarahan
Copy link

@Dr-Irv that's a very bad idea. You should have all compiled software in a single process (e.g. Python, pandas) running with the same MSVC runtime. Bad things can happen if you mix MSVC versions (and thus, runtimes). Longer explanation here: http://siomsystems.com/mixing-visual-studio-versions/

The versions suggested above adhere to community standards. If you build your package with VS 2012, your packages are questionably compatible. If you want to build your package with VS2012, you really should rebuild your whole Python stack with VS 2012.

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Feb 23, 2016

@msarahan Thanks for the pointer.

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>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Windows (2nd one)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@jreback jreback force-pushed the windows branch 2 times, most recently from 9790dc6 to 21b4c6f Compare February 23, 2016 18:46

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://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/winsdk_web.exe)
Copy link
Contributor

Choose a reason for hiding this comment

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

for the SDK, maybe link to https://www.microsoft.com/en-us/download/details.aspx?id=8279 instead of the executable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@jorisvandenbossche
Copy link
Member

Is there an alternative to installing the full Visual Studio 2015 for python 3.5 (as that takes 4 Gb)
@gfyoung in your PR for numpy/scipy (scipy/scipy.org#146), you point to the url https://support.microsoft.com/en-gb/kb/2977003 for Visual C++. These are downloads for "Visual C++ Redistributable Packages", which is much smaller to install, but are these enough to build a library? As I understand they are for running an application that is already built?

@jreback
Copy link
Contributor Author

jreback commented Feb 24, 2016

no u have to install everything

@msarahan
Copy link

There is https://www.microsoft.com/en-us/download/details.aspx?id=48159 which claims to include the latest compiler from VS 2015, without VS itself. I haven't tried it, and can't speak for its functionality or content.

@jorisvandenbossche
Copy link
Member

@gfyoung Is it possible that you then link to the wrong page in the numpy/scipy PR?

@msarahan Thanks. That still needs the full .NET framework to be installed (which is also 2 GB), but still it's a bit smaller

@gfyoung
Copy link
Member

gfyoung commented Feb 24, 2016

@jorisvandenbossche : So it seems. If you could put a comment in my PR to change the link(s), that would be great! Thanks!

@jreback
Copy link
Contributor Author

jreback commented Feb 24, 2016

so are the doc links right?
(i am going to fix the markdown links -> rst links) shortly

http://pandas-docs.github.io/pandas-docs-travis/contributing.html#creating-a-windows-development-environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants