-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
cc @jorisvandenbossche |
@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. |
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.
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.
+1 for this. I am trying to do similar documentation for |
|
||
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:: |
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.
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.
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.
do you have a pointer?
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.
actually, what would be a minimal example to use mingw-64
to compile on windows?
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.
If you mean a link to the project, yes, here
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.
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?
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 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
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. |
@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. |
@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 | ||
|
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.
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.
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.
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.
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 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
.
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.
@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
?
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 don't believe
conda
is compatible with Cygwin (at least I haven't been able to do so). -
I don't quite follow your comment about no one distributing Cygwin Python. It comes as an optional package during Cygwin installation.
-
When you say "actually used," are you referring to seeing other people using / testing with it outside of just myself?
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.
@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.
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.
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.
@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. |
@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>`. |
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.
Windows (2nd one)
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.
fixed
9790dc6
to
21b4c6f
Compare
|
||
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) |
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 the SDK, maybe link to https://www.microsoft.com/en-us/download/details.aspx?id=8279 instead of the executable?
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.
fixed
Is there an alternative to installing the full Visual Studio 2015 for python 3.5 (as that takes 4 Gb) |
no u have to install everything |
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 : So it seems. If you could put a comment in my PR to change the link(s), that would be great! Thanks! |
so are the doc links right? |
No description provided.