创建pip包。安装时出现错误

2024-04-26 04:29:14 发布

您现在位置:Python中文网/ 问答频道 /正文

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

我正在从以下位置创建包:

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

然后我运行:

^{pr2}$

输出为:

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

但是wierd是/home/user/workspace/Mapp存在,但它是文件夹而不是文件。在

求你了,我正试着解决这个问题,现在我不知道该怎么办。非常感谢。在

设置.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',
    ],
)

清单.IN

include *.txt
recursive-include mapp *.py

Tags: topybuildinfocreatingtxtegglinux