2013-08-14 11 views
4

J'utilise setuptools pour créer un script setup.py rapide pour installer les dépendances pour l'utilisateur. Le paquet nécessite seulement numpy et matlibplot. Ainsi, le code ressemble à ceci:Python setuptools erreur install_requires

from setuptools import setup 
setup(
    name = "somePackageName", 
    version = "1.0", 
    packages = ['doc', 'inputs', 'inputs', 'src'], 
    install_requires = ['distribute == 0.7.3', 'numpy', 'matplotlib'] 
    ) 

en cours d'exécution sudo python setup.py install me donne ce qui suit:

running install 
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/ 
/usr/bin/python -E -c pass 
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files 
running bdist_egg 
running egg_info 
creating fabSim.egg-info 
writing requirements to fabSim.egg-info/requires.txt 
writing fabSim.egg-info/PKG-INFO 
writing top-level names to fabSim.egg-info/top_level.txt 
writing dependency_links to fabSim.egg-info/dependency_links.txt 
writing manifest file 'fabSim.egg-info/SOURCES.txt' 
reading manifest file 'fabSim.egg-info/SOURCES.txt' 
writing manifest file 'fabSim.egg-info/SOURCES.txt' 
installing library code to build/bdist.linux-x86_64/egg 
running install_lib 
running build_py 
creating build 
creating build/lib.linux-x86_64-2.7 
creating build/lib.linux-x86_64-2.7/doc 
copying doc/__init__.py -> build/lib.linux-x86_64-2.7/doc 
creating build/lib.linux-x86_64-2.7/inputs 
copying inputs/__init__.py -> build/lib.linux-x86_64-2.7/inputs 
creating build/lib.linux-x86_64-2.7/src 
copying src/simulation.py -> build/lib.linux-x86_64-2.7/src 
copying src/good.py -> build/lib.linux-x86_64-2.7/src 
copying src/producer.py -> build/lib.linux-x86_64-2.7/src 
copying src/__init__.py -> build/lib.linux-x86_64-2.7/src 
copying src/validate.py -> build/lib.linux-x86_64-2.7/src 
creating build/bdist.linux-x86_64 
creating build/bdist.linux-x86_64/egg 
creating build/bdist.linux-x86_64/egg/doc 
copying build/lib.linux-x86_64-2.7/doc/__init__.py -> build/bdist.linux-x86_64/egg/doc 
creating build/bdist.linux-x86_64/egg/src 
copying build/lib.linux-x86_64-2.7/src/simulation.py -> build/bdist.linux-x86_64/egg/src 
copying build/lib.linux-x86_64-2.7/src/good.py -> build/bdist.linux-x86_64/egg/src 
copying build/lib.linux-x86_64-2.7/src/producer.py -> build/bdist.linux-x86_64/egg/src 
copying build/lib.linux-x86_64-2.7/src/__init__.py -> build/bdist.linux-x86_64/egg/src 
copying build/lib.linux-x86_64-2.7/src/validate.py -> build/bdist.linux-x86_64/egg/src 
creating build/bdist.linux-x86_64/egg/inputs 
copying build/lib.linux-x86_64-2.7/inputs/__init__.py -> build/bdist.linux-x86_64/egg/inputs 
byte-compiling build/bdist.linux-x86_64/egg/doc/__init__.py to __init__.pyc 
byte-compiling build/bdist.linux-x86_64/egg/src/simulation.py to simulation.pyc 
byte-compiling build/bdist.linux-x86_64/egg/src/good.py to good.pyc 
byte-compiling build/bdist.linux-x86_64/egg/src/producer.py to producer.pyc 
byte-compiling build/bdist.linux-x86_64/egg/src/__init__.py to __init__.pyc 
byte-compiling build/bdist.linux-x86_64/egg/src/validate.py to validate.pyc 
byte-compiling build/bdist.linux-x86_64/egg/inputs/__init__.py to __init__.pyc 
creating build/bdist.linux-x86_64/egg/EGG-INFO 
copying fabSim.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO 
copying fabSim.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO 
copying fabSim.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO 
copying fabSim.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO 
copying fabSim.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO 
zip_safe flag not set; analyzing archive contents... 
creating dist 
creating 'dist/fabSim-1.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it 
removing 'build/bdist.linux-x86_64/egg' (and everything under it) 
Processing fabSim-1.0-py2.7.egg 
removing '/usr/local/lib/python2.7/dist-packages/fabSim-1.0-py2.7.egg' (and everything under it) 
creating /usr/local/lib/python2.7/dist-packages/fabSim-1.0-py2.7.egg 
Extracting fabSim-1.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages 
fabSim 1.0 is already the active version in easy-install.pth 

Installed /usr/local/lib/python2.7/dist-packages/fabSim-1.0-py2.7.egg 
Processing dependencies for fabSim==1.0 
Searching for matplotlib 
Reading http://pypi.python.org/simple/matplotlib/ 
Reading http://matplotlib.sourceforge.net 
Reading http://sourceforge.net/project/showfiles.php?group_id=80706 
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 
Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194 
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/ 
Reading http://matplotlib.org 
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/ 
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0 
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/ 
Reading http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/ 
Reading http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.1/ 
Best match: matplotlib 1.3.0 
Downloading https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.3.0/matplotlib-1.3.0.tar.gz 
Processing matplotlib-1.3.0.tar.gz 
Writing /tmp/easy_install-xOXtid/matplotlib-1.3.0/setup.cfg 
Running matplotlib-1.3.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-xOXtid/matplotlib-1.3.0/egg-dist-tmp-JFeCc4 
The required version of distribute (>=0.6.28) is not available, 
and can't be installed while this script is running. Please 
install a more recent version first, using 
'easy_install -U distribute'. 

(Currently using distribute 0.6.28dev-r0 (/usr/lib/python2.7/dist-packages)) 
error: Setup script exited with 2 

Ma compréhension de setuptools est probablement hors que je pense à mettre à jour/installer disponible dépendances de PyPI. Quelqu'un pourrait-il donner un aperçu supplémentaire à ce sujet?

+1

Peut-être que vous devez désinstaller distribuer et mettre à niveau setuptools et essayez à nouveau puisque les deux ont fusionné (en setuptools). – Stan

+0

Pourquoi essayez-vous d'installer Distribute si votre paquet ne dépend que de numpy et de matplotlib? Aussi, ce que Stan a dit. – Christoph

+0

Je suis aussi tombé dedans. Comme il semble de déboguer ceci sur Python 2.7, la commande 'python setup.py install' n'honore pas la spécification' install_requires' (ou 'setup_requires'), mais la commande' pip install ... 'le fait. Cependant, 'python setup.py develop' installe les dépendances, en préparation d'un téléchargement PyPi. –

Répondre

0
pip install -U distribute 

ou

easy_install -U distribute 
Questions connexes