简体   繁体   English

Python external_dependencies:“ google-cloud-pubsub”无效

[英]Python external_dependencies: 'google-cloud-pubsub' not working

Environment details Google cloud pubsub window 10 Python version: 3.6.3 google-cloud-pubsub version: 0.39.1 Steps to reproduce I used google-cloud-pubsub in Odoo module. 环境详细信息Google cloud pubsub窗口10 Python版本:3.6.3 google-cloud-pubsub版本:0.39.1重现步骤我在Odoo模块中使用了google-cloud-pubsub。 I tried to explain the issue in step by step. 我试图逐步解释这个问题。

Added 'google-cloud-pubsub' in external_dependencies in python manifest file: 在python清单文件的external_dependencies中添加了“ google-cloud-pubsub”:

"external_dependencies": { 'python': ['google-cloud-pubsub'] },

Expected result: Actually, I don't know why this error occurs. 预期结果:实际上,我不知道为什么会发生此错误。 Normally it will be work. 通常它会工作。

Actual result: When I published python module to Odoo server its threw below error: 实际结果:当我向Odoo服务器发布python模块时,它抛出以下错误:

odoo.exceptions.UserError: ('Unable to install module "caliva_wsp" because an 
   external dependency is not met: No module named google-cloud-pubsub', '')

How to solve this issue? 如何解决这个问题? I already stuck at this point around 3 days. 我已经在这三天左右停留了。 Thanks! 谢谢!

This error message is the expected result if you have not installed the dependency. 如果您尚未安装依赖项,则此错误消息是预期的结果。 Odoo module manifest external dependencies only check that the external module is available from Odoo code. Odoo模块清单外部依赖项仅检查Odoo代码中的外部模块是否可用。 It does not install the module. 它不安装模块。

Install google pubsub pip module on your Odoo server with command pip3 install google-cloud-pubsub before installing your own Odoo module. 在安装自己的Odoo模块之前,请使用命令pip3 install google-cloud-pubsub在您的Odoo服务器上安装google pubsub pip模块pip3 install google-cloud-pubsub After that your module should be installable. 之后,您的模块应该是可安装的。

You can also automate the installation of dependency by putting it in module requirements.txt file. 您还可以通过将依赖项放入模块requirements.txt文件中来自动执行依赖项的安装。 More information on this can be found at https://www.odoo.com/documentation/user/12.0/odoo_sh/getting_started/first_module.html#use-an-external-python-library . 有关此的更多信息,请访问https://www.odoo.com/documentation/user/12.0/odoo_sh/getting_started/first_module.html#use-an-external-python-library

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM