dify-plugin-repackaging icon indicating copy to clipboard operation
dify-plugin-repackaging copied to clipboard

重新打包时报错,找不到依赖包

Open tjlys781231 opened this issue 8 months ago • 5 comments

Please confirm before submission 在提交之前,请确认

Is this request related to a challenge you're experiencing? Tell me about your story. 这个请求与你正在经历的挑战有关吗?给我讲讲你的故事。

重新打包的过程中会提示找不到指定的依赖包 Could not find a version that satisfies the requirement dify_plugin==0.0.1b65 (from -r langgenius-echarts_0.0.1/requirements.txt (line 4)) (from versions: ) No matching distribution found for dify_plugin==0.0.1b65 (from -r langgenius-echarts_0.0.1/requirements.txt (line 4))

Can you help us with this feature? 你能帮我们实现这个功能吗?

  • [x] I am interested in contributing to this feature. 我有兴趣为这个特性做贡献。

tjlys781231 avatar Apr 28 '25 05:04 tjlys781231

看下你的python版本是否是3.12+

junjiem avatar Apr 28 '25 06:04 junjiem

跟python版本关系不大,你的那个原始包在解压后,应该可以在requirements.txt中看到依赖项 dify_plugin==0.0.1b65,把这个版本号去掉。然后在plugin_repackaging.sh注释掉解压那部分脚本,最后再执行打包。这样可以绕过去

leiwuhen92 avatar Jul 06 '25 04:07 leiwuhen92

跟python版本关系不大,你的那个原始包在解压后,应该可以在requirements.txt中看到依赖项 dify_plugin==0.0.1b65,把这个版本号去掉。然后在plugin_repackaging.sh注释掉解压那部分脚本,最后再执行打包。这样可以绕过去

大佬,我的requirements.txt里面指定dify_plugin==0.2.4,但是也报类似的错误

3099749306 avatar Jul 22 '25 09:07 3099749306

跟python版本关系不大,你的那个原始包在解压后,应该可以在requirements.txt中看到依赖项 dify_plugin==0.0.1b65,把这个版本号去掉。然后在plugin_repackaging.sh注释掉解压那部分脚本,最后再执行打包。这样可以绕过去

这个办法针对一部分插件好用的,但是有一些其他的插件包离线打包,还会报找不到其他的依赖项,总不能一个一个去下载

Kevin-Glaser avatar Aug 11 '25 09:08 Kevin-Glaser

这个我用uv venv创建了个虚拟环境,在虚拟环境里执行步骤:注释掉了

	# unzip -o ${PACKAGE_PATH} -d ${CURR_DIR}/${PACKAGE_NAME}
	# if [[ $? -ne 0 ]]; then
	# 	echo "Unzip failed."
	# 	exit 1
	# fi

这一段。

在虚拟环境下执行uv pip install --upgrade pip setuptools,然后执行./plugin_repackaging.sh local /home/kevinglaser/Downloads/langgenius-tongyi_0.0.37.difypkg可以成功打包。

对比不执行uv pip install --upgrade pip setuptools时候会报错

ERROR: Could not find a version that satisfies the requirement dify_plugin<0.5.0,>=0.3.0 (from -r requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for dify_plugin<0.5.0,>=0.3.0 (from -r requirements.txt (line 1))

这里的依赖最好能不删除还是不删除,我这个tongyi插件如果删除dify_plugin能打包过但上传后执行不了

Kevin-Glaser avatar Aug 11 '25 10:08 Kevin-Glaser