简体   繁体   English

在Bitnami Odoo Stack中安装依赖项

[英]install dependency in Bitnami Odoo Stack

Hi I am having problem with a python Module installation. 嗨,我在安装python模块时遇到问题。 I want to install a python module pycups in bitnami odoo stack v8. 我想在bitnami odoo堆栈v8中安装python模块pycups。 but when i try to install it, It is installed in ubuntu's own python directory. 但是当我尝试安装它时,它安装在ubuntu自己的python目录中。 How to direct the bitnami's python to look for default python's library? 如何引导bitnami的python查找默认的python库? Also if there is another way to install pycups in bitnami's own stack. 同样,如果还有另一种方法可以在bitnami自己的堆栈中安装pycup。 Will it work if i copy and paste the directory of pycups from ubuntu's python directory to bitnami's python directory? 如果我将pycups目录从ubuntu的python目录复制并粘贴到bitnami的python目录中,它将起作用吗?

You can find how to install plugins on Odoo at wiki page: 您可以在Wiki页面上找到如何在Odoo上安装插件:

https://wiki.bitnami.com/Applications/Bitnami_Odoo#How_to_install_a_plugin_on_Odoo https://wiki.bitnami.com/Applications/Bitnami_Odoo#How_to_install_a_plugin_on_Odoo

In addition, you can take a look at this other page for knowing how to load the Bitnami console to use the shipped components, for example Python: 此外,您可以在另一页上查看有关如何加载Bitnami控制台以使用随附组件(例如Python)的信息:

https://wiki.bitnami.com/Components/BitNami_console https://wiki.bitnami.com/Components/BitNami_console

The file cups.h is needed to install pycups. 需要文件cups.h来安装pycups。 If you are using Ubuntu you can install the package libcups2-dev with: 如果使用的是Ubuntu,则可以使用以下命令安装软件包libcups2-dev:

sudo apt-get install libcups2-dev

Then install pycups using pip: 然后使用pip安装pycups:

sudo pip install pycups

To install an internal dependency in bitnami Odoo stack: 在bitnami Odoo堆栈中安装内部依赖项:

Go to /../odoo-8.0-6/python/bin/ Run from there the executable "python2.7" (Do not run native python shell. ie from command prompt or terminal.). 转到/../odoo-8.0-6/python/bin/从那里运行可执行文件“ python2.7”(不要运行本机python shell。即从命令提示符或终端运行。)。 Instead run python shell from above directory. 而是从上面的目录运行python shell。

In Python type: 在Python中输入:

from subprocess import call
call("pip install your_dependency_name",shell=True)

eg 例如

call("pip install psycopg2",shell=True)

It will install package psycopg2 within the do stack. 它将在do堆栈中安装软件包psycopg2。

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

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