How to control which python-specific version of mingwpy is installed by pip from anaconda

88 views
Skip to first unread message

vitaly.kru...@gmail.com

unread,
Mar 17, 2016, 5:16:42 PM3/17/16
to mingwpy
The installation instructions at https://anaconda.org/carlkl/mingwpy are:

  pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy


However, when I click onthe Files tab in this anaconda projects, I see all sorts of wheels containing affiliated with different versions of python (cp27, cp33, cp34, etc.), as well as different windows architectures (32 vs. 64 bits), and different versions of mingwpy itself (0.1.0b3, 0.1.0b1, etc.). E.g., mingwpy-0.1.0b3-cp27-none-win32.whl, mingwpy-0.1.0b3-cp27-none-win_amd64.whl, etc.

So, what do I get when I install using the pip command: pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy? Do I get support for cp27 or cp33, Win32 or Win64, etc.

I am going to be using the mingwpy toolchain on AppVeyor (its build slaves run on Win64) to build both Win32 and Win64 versions of my python extension DLLs for Python 2.7.x. So, I am wondering what my `pip install . . .` command should be for this build scenario.

Many thanks,
Vitaly

Carl Kleffner

unread,
Mar 17, 2016, 5:21:37 PM3/17/16
to min...@googlegroups.com
Hi Vitaly,

pip always ensures that the right bitness and python version is chosen during install. Also the most recent version is used by default. To manually choose older version take a look at the pip documentation: https://pip.pypa.io/en/stable

Carl



--
You received this message because you are subscribed to the Google Groups "mingwpy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mingwpy+u...@googlegroups.com.
To post to this group, send email to min...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mingwpy/a454a6ba-7e9a-4f40-87e8-0ad7a6988c72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vitaly.kru...@gmail.com

unread,
Mar 17, 2016, 6:08:26 PM3/17/16
to mingwpy
HI Carl,

thank you for the reply and your excellent work on mingwpy (and elsewhere). 

Since AppVeyor's build slaves always run on Win64 virtual machines, and I need to build both Win32 and Win64 versions of my extension DLL on that Win64 virtual machine, I am guessing that letting pip choose the bitness and python version will always install the 64-bit mingwpy toolchain. 

Will I be able to build a 32-bit version of my DLL using the 64-bit version of the mingwpy toolchain?  Are there specific flags that I need to pass to mingwpy to force the 64-bit mingwpy toolchain executing on Win64 to build a 32-bit DLL target?

Thank you,
Vitaly

Nathaniel Smith

unread,
Mar 17, 2016, 6:31:15 PM3/17/16
to mingwpy
The crucial thing is that you need a 32-bit version of Python. pip
selects wheels to match whatever version of python you're using to run
pip. E.g., my32bitvenv/bin/pip will install 32-bit wheels, even if
running on a 64-bit machine. And this is something you'll need to take
care of anyway -- you can't use a 64-bit python + a 32-bit mingwpy to
build 32-bit python extensions, you need a 32-bit python *and* a
32-bit mingwpy. So figure out the python situation first, and
everything else will follow :-).

-n

--
Nathaniel J. Smith -- https://vorpus.org

Carl Kleffner

unread,
Mar 17, 2016, 6:38:03 PM3/17/16
to min...@googlegroups.com
In principle a mingw-w64 based toolchain can be build with a so called multi-target. That is some kind of bitness cross compiler. This approach however will not be used with mingwpy because the chosen exception handling code for C++ is (and will be) incompatible for the 32bit and 64bit world. Another problem is, that the size of the toolchain will be much bigger as it is right now.

Carl


--
You received this message because you are subscribed to the Google Groups "mingwpy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mingwpy+u...@googlegroups.com.
To post to this group, send email to min...@googlegroups.com.

vitaly.kru...@gmail.com

unread,
Mar 17, 2016, 7:55:17 PM3/17/16
to mingwpy
Thank you Carl and Nathaniel. To summarize, my approach should be:

1. Install python of the desired version (e.g. 2.7) and bitness (e.g., 32-bit)
2. Use pip from the installed python to install mingwpy. This will install a build of MINGWPY that will be COMPATIBLE WITH THE INSTALLED PYTHON VERSION (e.g., 2.7) and WILL GENERATE TARGETS (e.g., DLL) OF THE SAME BITNESS AS THE INSTALLED PYTHON (e.g., 32-bit)

Nathaniel Smith

unread,
Mar 17, 2016, 7:57:19 PM3/17/16
to mingwpy
yes :-)
> --
> You received this message because you are subscribed to the Google Groups
> "mingwpy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mingwpy+u...@googlegroups.com.
> To post to this group, send email to min...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mingwpy/a06636a1-cbe8-4284-96be-b3c1de6a785a%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



Reply all
Reply to author
Forward
0 new messages