51

To make a python package, in setup.py, I have the following:

setup(
    name='TowelStuff',
    version='0.1.0',
    author='J. Random Hacker',
    author_email='[email protected]',
    packages=['towelstuff', 'towelstuff.test'],
    scripts=['bin/stowe-towels.py','bin/wash-towels.py'],
    url='http://pypi.python.org/pypi/TowelStuff/',
    license='LICENSE.txt',
    description='Useful towel-related stuff.',
    long_description=open('README.txt').read(),
    install_requires=[
        "Django >= 1.1.1",
        "caldav == 0.1.4",
    ],
)

So I remade that with my own package description and information. When I build it though I get the following warning:

distutils/dist.py:267: UserWarning: Unknown distribution option:

Does install_requires work only on certain versions?

1

2 Answers 2

72

You need to be using setuptools instead of distutils.

Near the top of your script, try replacing

from distutils.core import setup

with

from setuptools import setup
Sign up to request clarification or add additional context in comments.

1 Comment

Even better, you can import from setuptools, and if that raises an ImportError import from distutils.core instead.
33
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

1 Comment

I tried this when installing jip for jython and found that it doesn't work. This piece of code you mention is exactly the code at the top of the setup.py and I get the warning message method by Niek.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.