Pyinstaller on a setuptools package

前端 未结 5 1667
既然无缘
既然无缘 2021-01-11 09:33

I\'m attempting to run PyInstaller on a CLI app I am building in Python using the Click library. I\'m having trouble building the project using PyInstaller. PyInstaller has

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-11 10:28

    This error:

    pkg_resources.DistributionNotFound: The 'myapp' distribution was not found and is required by the application

    indicates that this package is not on PYTHONPATH. I fixed it on Windows with:

    set PYTHONPATH=.
    

    adjust to your OS of choice.


    In addition to the path problem, there is:

    In setup.py:

    setup(
        entry_points = '''
            [console_scripts]
            myapp=myapp.main:entry_point
        ''',
    

    In main.spec:

    a = Entrypoint('myapp', 'console_scripts', 'myapp')
    

    According to setup.py, it looks like your entry point is myapp.main not myapp. So you may need:

    a = Entrypoint('myapp', 'console_scripts', 'myapp.main')
    

提交回复
热议问题