python setuptools安装程序,已安装模块,文件结构似乎正常,但无法正常工作

时间:2020-03-26 08:36:30

标签: python installation setuptools setup.py

我想在社区中分享此工具。我希望将其添加到路径,以便他们从终端运行它。我不明白为什么会收到此错误。我浏览了所有可以找到的示例,但它对我没有用。与实际程序相比,我在执行安装文件上花费的时间更多。那么应该是什么结构?脚本的结构很简单

.
|____databases
| |____GER.json
| |______init__.py
| |____ENG.json
|____sameWidther.py
|____getKern
| |______init__.py
| |____flatten_gpos_kerntable.py
|______init__.py
from setuptools import setup

setup(name='sameWidther',
    version='0.1',
    description='The funniest joke in the world',
    url='http://github.com/storborg/funniest',
    author='Jan Šindler',
    author_email='jansindl3r@gmail.com',
    license='MIT',
    packages=['sameWidther', 'sameWidther.databases', 'sameWidther.getKern'],
    package_data={
        "sameWidther.databases": ["*.json"],
    },
    entry_points={
        "console_scripts": [
            "sameWidther = sameWidther.sameWidther:main",
        ]
    },
    zip_safe=False)

Traceback (most recent call last):
  File "/Users/jansindler/.pyenv/versions/3.8.1/bin/sameWidther", line 11, in <module>
    load_entry_point('sameWidther==0.1', 'console_scripts', 'sameWidther')()
  File "/Users/jansindler/.pyenv/versions/3.8.1/lib/python3.8/site-packages/sameWidther-0.1-py3.8.egg/sameWidther/sameWidther.py", line 148, in main
    run(args.parser)
  File "/Users/jansindler/.pyenv/versions/3.8.1/lib/python3.8/site-packages/sameWidther-0.1-py3.8.egg/sameWidther/sameWidther.py", line 130, in run
    with open(
FileNotFoundError: [Errno 2] No such file or directory: 'databases/ENG.json'
站点软件包中的

模块,有趣的是数据库和getKern文件夹是重复的。虽然该结构仍然可以正常工作

.
|____databases
| |____GER.json
| |______init__.py
| |____ENG.json
|____sameWidther.py
|____getKern
| |______init__.py
| |____flatten_gpos_kerntable.py
|______init__.py

0 个答案:

没有答案
相关问题