1

After wasting a couple of days with this, I'm asking for help. I'm trying to specify Python 2.7 in setup.py:

from setuptools import setup, find_packages

setup(
name = 'MyPackageName',
version = '1.0.0',
url = 'https://github.com/mypackage.git',
author = 'Author Name',
author_email = '[email protected]',
description = 'Description of my package',
packages = find_packages(),    
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
)

My pip version is 9.0.1 (in Python 27)

My setuptools verion is 38.4.0 (in Python 27)

I have 3 Pythons installed: 2.5, 2.7, 3.6

I'm building an exe with (Python 27):

python setup.py bdist_wininst

which creates nice MyPackageName-1.0.0.win32.exe

This is what I'm trying to achieve(numpy example with Py 2.5): enter image description here

This is what I have: enter image description here

I would greatly appreciate any hints.

1 Answer 1

2

Use --target-version to restrict the interpreter version:

$ python setup.py bdist_wininst --target-version 2.7

will build the installer MyPackageName-1.0.0.win32-py2.7.exe. When installing, it will restrict the list of found versions to match the target one, or show an error dialog in there are none. Passing the option multiple times will generate multiple installers for each version, e.g.

$ python setup.py bdist_wininst --target-version 2.5 --target-version 2.7

will generate two installers, MyPackageName-1.0.0.win32-py2.5.exe and MyPackageName-1.0.0.win32-py2.7.exe.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you sooo much, sir. I knew, awesome people are out there.... Looks like, I missed this somewhere in the documentation... :(
Glad I could help! I guess it's not documented as I can't find any mentions of it in the docs, but check out the output of python setup.py bdist_wininst --help for the list of available options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.