[英]Python packages not building properly
我正在嘗試創建一個看起來像這樣的目錄的 python package。
我的setup.py
看起來像這樣
from setuptools import setup, find_packages
setup(
name='incr-consumer',
version='0.0.1',
description="BBB",
packages=find_packages(),
package_data={x: ['*.csv', '*.json', '*.txt', '*.sql', '*.yml', '*.cfg'] for x in find_packages()},
include_package_data=True,
install_requires=[line for line in open('requirements.txt')],
options={"bdist_wheel": {"universal": True}},
entry_points={
'console_scripts': [
'archiver=incr_consumer.src.kkk:main',
'produce=incr_consumer.util.ppp:main'
]
}
)
我已經通過python install -e.
當我嘗試查看 package 是否有效時,我沒有看到可用的模塊。
[注意:我在 src 中有一個__init__.py
。 請讓我知道為什么會發生這種情況,以及我能做些什么來解決這個問題。
您可能還需要在incr_consumer
中有一個__init__.py
以將其標記為 package。
如果您在安裝腳本中執行print(find_packages())
,則可能當前未正確枚舉所有包。
您可以指定package_dir={'incr_consumer': 'src'}
(另請參見此處),然后指定與src
目錄相關的所有其他內容(包括控制台腳本)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.