I have pure python package that relies on 3 other python packages: I'm using distutils.core.setup to do the installation.
This is my code from setup.py:
from distutils.core import setup
setup(
name='mypackage',
version='0.2',
scripts=['myscript'],
packages=['mypackage'],
install_requires=[
'netifaces > 0.5',
'IPy > 0.75',
'yaml > 3.10'])
I specified the modules I need with install_requires, but it seems to have no effect when I run
python ./setup.py install
How can I ensure that the modules that mypackage depends on are installed?
distutils
has no functionality for downloading, or even verifying, prerequisites; its install_requires
is only there for documentation.
If you want that, you need the third-party library setuptools
.
Most people already have setuptools
, and hopefully pip
, and will be using them to install your package anyway (assuming you plan to distribute over PyPI), but if you include the setuptools
bootstrap, it will take care of installing setuptools
if needed to install those dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With