python rpm包没有名为main的模块

时间:2017-04-20 11:52:16

标签: python rpm

我无法创建我的python模块的rpm,我使用setuptools,我创建并安装我的rpm但是当我启动我的程序时出现此错误:

ImportError: No module named main

我的档案/root/myprog/setup.py

#!/usr/bin/python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
from myprog import __version__


def read(path):
    with open(path) as fd:
        return fd.read().splitlines()
setup(
  name="myprog",
    version=__version__,

# ...the rest of our setup.py here....

  entry_points={
        'console_scripts': [
            'myprog=myprog:main',
        ],
    },
)

我的档案/root/myrpog/myprog/__init__.py:

#!/usr/bin/python
# -*- coding: utf-8 -*-
__program__ = 'myprog'
__version__ = '1.0'
__description__ = 'myprog is new program for linux'

我的档案/root/myprog/myprog/main.py:

def main():
    main=main()

class main():
    def __init__(self):
        print("toto")
main=main()

0 个答案:

没有答案