创建pip包。安装时出错

时间:2014-04-03 17:47:27

标签: python pip packaging

安装我自己的软件包时无法解决错误。

我正在创建包:

Mapp/
   CHANGES.txt
   LICENSE.txt
   MANIFEST.in
   README.txt
   setup.py
   mapp/
      __init__.py
      core/
          __init__.py
          ...
      utils/
          __init__.py
          ...

然后我跑:

python setup.py sdist

输出结果为:

running sdist
running egg_info
creating Mapp-0.1.0 (and lots of creatin) ...
making hard links in Mapp-0.1.0...
'' not a regular file -- skipping
hard linking CHANGES.txt -> Mapp-0.1.0 (and lots of linking) ...
Writing Mapp-0.1.0/setup.cfg
creating dist
Creating tar archive
removing 'Mapp-0.1.0' (and everything under it)

然后我会执行:

sudo python setup.py 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
writing Mapp.egg-info/PKG-INFO
writing top-level names to Mapp.egg-info/top_level.txt
writing dependency_links to Mapp.egg-info/dependency_links.txt
reading manifest template 'MANIFEST.in'
writing manifest file 'Mapp.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_py
creating build
creating build/lib.linux-i686-2.7
creating build/lib.linux-i686-2.7/mapp
copying mapp/__init__.py -> build/lib.linux-i686-2.7/mapp (and lots of copying)
byte-compiling build/bdist.linux-i686/egg/mapp/dataset/files.py to files.pyc (and lots of compiling)
creating build/bdist.linux-i686/egg/EGG-INFO
installing scripts to build/bdist.linux-i686/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-2.7
error: file '/home/user/workspace/Mapp' does not exist

但奇怪的是/ home / user / workspace / Mapp存在,但它是FOLDER而不是FILE。

请我今天尝试解决,现在我不知道该怎么办。谢谢。

setup.py

from setuptools import setup, find_packages

setup(
    name='Mapp',
    version='0.1.0',
    author='Ondrej Pelikan',
    author_email='onpelikan@gmail.com',
    packages=find_packages(exclude=['tests*']),
    scripts=[''],
    url='http://pypi.python.org/pypi/Mapp/',
    license='LICENSE.txt',
    description='Package for simplify MAPP prediction analysis workflow.',
    long_description=open('README.txt').read(),
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)

MANIFEST.IN

include *.txt
recursive-include mapp *.py

1 个答案:

答案 0 :(得分:0)

我刚想通了!问题原因:

scripts=[''],

不能有空列表。这条线必须删除!然后它有效!