简体   繁体   English

无法在Mac OS X中正确运行odoo

[英]Unable to run odoo properly in Mac OS X

I have installed Odoo 9 Community version from Git in my Mac OS X El Capitan 10.11.2, all my steps: 我在我的Mac OS X El Capitan 10.11.2中安装了Git的Odoo 9社区版,我的所有步骤:

python --version
Python 2.7.10

git clone https://github.com/odoo/odoo.git
Checking out files: 100% (20501/20501), done.

Installed PostgresApp into Applications and added path in ~/.bash_profile , executed the same. PostgresApp安装到Applications并在~/.bash_profile添加路径,执行相同的操作。

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin

Installed pip 安装点子

sudo easy_install pip
Finished processing dependencies for pip

I have nodejs installed in my system, 我在我的系统中安装了nodejs

node -v
v5.0.0
npm -v
3.3.9

Installed less and less-plugin-clean-css 安装less less-plugin-clean-css

sudo npm install -g less less-plugin-clean-css

I have latest xcode installed, 我安装了最新的xcode,

xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

I have homebrew installed, 我安装了自制软件,

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin Cellar CODEOFCONDUCT.md CONTRIBUTING.md etc include lib Library LICENSE.txt opt README.md sbin share SUPPORTERS.md var .git .gitignore

Installed other libs 安装其他库

brew install autoconf automake libtool
brew install libxml2 libxslt libevent

Installed Python dependencies 已安装的Python依赖项

sudo easy_install -U setuptools
Finished processing dependencies for setuptools

cd odoo/
sudo pip install --user -r requirements.txt

Successfully installed Mako-1.0.1 Pillow-2.7.0 Werkzeug-0.9.6 argparse-1.2.1 lxml-3.4.1 psutil-2.2.0 psycopg2-2.5.4 pyparsing-2.0.1 python-dateutil-1.5 python-ldap-2.4.19 pytz-2013.7 pyusb-1.0.0b2 qrcode-5.1 six-1.4.1

Running odoo 运行odoo

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

./odoo.py --addons-path=addons --db-filter=mydb

It says 它说

2016-02-10 16:51:42,351 3389 INFO ? openerp: OpenERP version 9.0c
2016-02-10 16:51:42,351 3389 INFO ? openerp: addons paths: ['/Users/anshad/Library/Application Support/Odoo/addons/9.0', u'/Users/anshad/odoo/addons', '/Users/anshad/odoo/openerp/addons']
2016-02-10 16:51:42,352 3389 INFO ? openerp: database: default@default:default
2016-02-10 16:51:42,444 3389 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069

And the browser says 500 500 Internal Server Error and in terminal, 浏览器说500 500 Internal Server Error并在终端,

conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Started PostgresApp to solve this issue. 启动PostgresApp来解决这个问题。

Now I got the database setup window appears without CSS as in the below screen-shot. 现在我得到的数据库设置窗口没有CSS,如下面的屏幕截图所示。

Created database mydbodoo with password admin and navigated to main page http://localhost:8069/web/ It shows a blank page with black header and odoo logo, some error in terminal as well. 用密码admin创建数据库mydbodoo并导航到主页面http://localhost:8069/web/它显示一个带有黑色标题和odoo标识的空白页面,终端也有一些错误。

ImportError: No module named pyPdf

./odoo.py --addons-path=addons --db-filter=mydb
2016-02-10 17:02:12,220 3589 INFO ? openerp: OpenERP version 9.0c
2016-02-10 17:02:12,220 3589 INFO ? openerp: addons paths: ['/Users/anshad/Library/Application Support/Odoo/addons/9.0', u'/Users/anshad/odoo/addons', '/Users/anshad/odoo/openerp/addons']
2016-02-10 17:02:12,221 3589 INFO ? openerp: database: default@default:default
2016-02-10 17:02:12,314 3589 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2016-02-10 17:02:16,855 3589 INFO ? openerp.addons.bus.models.bus: Bus.loop listen imbus on db postgres
2016-02-10 17:02:16,888 3589 INFO ? werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:16] "GET /web/ HTTP/1.1" 500 -
2016-02-10 17:02:16,895 3589 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/werkzeug/serving.py", line 177, in run_wsgi
    execute(self.server.app)
  File "/Library/Python/2.7/site-packages/werkzeug/serving.py", line 165, in execute
    application_iter = app(environ, start_response)
  File "/Users/anshad/odoo/openerp/service/server.py", line 245, in app
    return self.app(e, s)
  File "/Users/anshad/odoo/openerp/service/wsgi_server.py", line 184, in application
    return application_unproxied(environ, start_response)
  File "/Users/anshad/odoo/openerp/service/wsgi_server.py", line 170, in application_unproxied
    result = handler(environ, start_response)
  File "/Users/anshad/odoo/openerp/http.py", line 1487, in __call__
    self.load_addons()
  File "/Users/anshad/odoo/openerp/http.py", line 1508, in load_addons
    m = __import__('openerp.addons.' + module)
  File "/Users/anshad/odoo/openerp/modules/module.py", line 61, in load_module
    mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
  File "/Users/anshad/odoo/addons/document/__init__.py", line 4, in <module>
    import models
  File "/Users/anshad/odoo/addons/document/models/__init__.py", line 4, in <module>
    import ir_attachment
  File "/Users/anshad/odoo/addons/document/models/ir_attachment.py", line 8, in <module>
    import pyPdf
ImportError: No module named pyPdf
2016-02-10 17:02:17,708 3589 INFO mydbodoo openerp.modules.loading: loading 1 modules...
2016-02-10 17:02:17,716 3589 INFO mydbodoo openerp.modules.loading: 1 modules loaded in 0.01s, 0 queries
2016-02-10 17:02:17,719 3589 INFO mydbodoo openerp.modules.loading: loading 4 modules...
2016-02-10 17:02:17,727 3589 INFO mydbodoo openerp.modules.loading: 4 modules loaded in 0.01s, 0 queries
2016-02-10 17:02:17,899 3589 INFO mydbodoo openerp.modules.loading: Modules loaded.
2016-02-10 17:02:17,900 3589 INFO mydbodoo openerp.addons.base.ir.ir_http: Generating routing map
2016-02-10 17:02:18,249 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "GET /web/ HTTP/1.1" 200 -
2016-02-10 17:02:18,308 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "GET /web/content/341-42af255/web.assets_common.0.css HTTP/1.1" 304 -
2016-02-10 17:02:18,350 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "GET /web/static/src/css/full.css HTTP/1.1" 404 -
2016-02-10 17:02:18,367 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "GET /web/content/343-4d5beef/web.assets_backend.0.css HTTP/1.1" 304 -
2016-02-10 17:02:18,411 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "GET /web/content/344-4d5beef/web.assets_backend.js HTTP/1.1" 304 -
2016-02-10 17:02:18,428 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "GET /web/content/342-42af255/web.assets_common.js HTTP/1.1" 304 -
2016-02-10 17:02:18,663 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "GET /web/binary/company_logo HTTP/1.1" 304 -
2016-02-10 17:02:18,838 3589 INFO mydbodoo openerp.service.common: successful login from 'admin' using database 'mydbodoo'
2016-02-10 17:02:18,859 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "POST /web/session/get_session_info HTTP/1.1" 200 -
2016-02-10 17:02:18,893 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "POST /web/proxy/load HTTP/1.1" 200 -
2016-02-10 17:02:18,915 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "POST /web/session/modules HTTP/1.1" 200 -
2016-02-10 17:02:18,945 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "POST /web/dataset/search_read HTTP/1.1" 200 -
2016-02-10 17:02:18,945 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "POST /web/webclient/translations HTTP/1.1" 200 -
2016-02-10 17:02:18,991 3589 INFO mydbodoo werkzeug: 127.0.0.1 - - [10/Feb/2016 17:02:18] "GET /web/webclient/locale/en_US HTTP/1.1" 500 -
2016-02-10 17:02:18,998 3589 ERROR mydbodoo werkzeug: Error on request:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/werkzeug/serving.py", line 177, in run_wsgi
    execute(self.server.app)
  File "/Library/Python/2.7/site-packages/werkzeug/serving.py", line 165, in execute
    application_iter = app(environ, start_response)
  File "/Users/anshad/odoo/openerp/service/server.py", line 245, in app
    return self.app(e, s)
  File "/Users/anshad/odoo/openerp/service/wsgi_server.py", line 184, in application
    return application_unproxied(environ, start_response)
  File "/Users/anshad/odoo/openerp/service/wsgi_server.py", line 170, in application_unproxied
    result = handler(environ, start_response)
  File "/Users/anshad/odoo/openerp/http.py", line 1488, in __call__
    return self.dispatch(environ, start_response)
  File "/Users/anshad/odoo/openerp/http.py", line 1652, in dispatch
    result = ir_http._dispatch()
  File "/Users/anshad/odoo/openerp/addons/base/ir/ir_http.py", line 186, in _dispatch
    return self._handle_exception(e)
  File "/Users/anshad/odoo/openerp/addons/base/ir/ir_http.py", line 157, in _handle_exception
    return request._handle_exception(exception)
  File "/Users/anshad/odoo/openerp/http.py", line 781, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/Users/anshad/odoo/openerp/addons/base/ir/ir_http.py", line 182, in _dispatch
    result = request.dispatch()
  File "/Users/anshad/odoo/openerp/http.py", line 840, in dispatch
    r = self._call_function(**self.params)
  File "/Users/anshad/odoo/openerp/http.py", line 316, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/Users/anshad/odoo/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/Users/anshad/odoo/openerp/http.py", line 309, in checked_call
    result = self.endpoint(*a, **kw)
  File "/Users/anshad/odoo/openerp/http.py", line 959, in __call__
    return self.method(*args, **kw)
  File "/Users/anshad/odoo/openerp/http.py", line 509, in response_wrap
    response = f(*args, **kw)
  File "/Users/anshad/odoo/addons/web/controllers/main.py", line 505, in load_locale
    addons_path = http.addons_manifest['web']['addons_path']
KeyError: 'web'

Screen-shot:Terminal and file system 截屏:终端和文件系统

在此输入图像描述

Screen-shot:Database selection window 截屏:数据库选择窗口

在此输入图像描述

Screen-shot: Main window 屏幕截图:主窗口

在此输入图像描述

Tried sudo pip install pyPdf and it says Requirement already satisfied (use --upgrade to upgrade): pyPdf in /Users/anshad/Library/Python/2.7/lib/python/site-packages 尝试sudo pip install pyPdf ,它说Requirement already satisfied (use --upgrade to upgrade): pyPdf in /Users/anshad/Library/Python/2.7/lib/python/site-packages

I just went through the setup on two systems, one is Mac OS X El Capitan 10.11.2 and another one is my primary OS - Ubuntu 15.04 (where things went much easier, but maybe it is just because I use Ubuntu on daily basis). 我刚刚在两个系统上进行了设置,一个是Mac OS X El Capitan 10.11.2,另一个是我的主要操作系统 - Ubuntu 15.04(事情变得更容易,但也许只是因为我每天都使用Ubuntu) 。

Below are installation steps for both systems. 以下是两个系统的安装步骤。 Make sure that every command finishes successfully (at least doesn't report any errors). 确保每个命令都成功完成(至少不报告任何错误)。

Mac OS X El Capitan 10.11.2 Mac OS X El Capitan 10.11.2

Prerequisites: I already had git and python 2.7.10 . 先决条件:我已经有了gitpython 2.7.10

1) Clone odoo repository: 1)克隆odoo存储库:

git clone https://github.com/odoo/odoo.git

2) Download and install Postgresapp 2)下载并安装Postgresapp

  • Go to http://postgresapp.com/ , download 转到http://postgresapp.com/ ,下载
  • Open it in Finder, drag to Applications, double click 在Finder中打开它,拖动到Applications,双击
  • Postgres application appears, double click it 出现Postgres应用程序,双击它
  • Sorry if these steps are obvious, it is just for me since I am not a Mac OS user 很抱歉,如果这些步骤很明显,那对我来说就是因为我不是Mac OS用户

Now add to ~/.bash_profile : 现在添加到~/.bash_profile

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin

And just execute the command above it if you already have the open terminal. 如果您已经拥有开放终端,只需执行上面的命令即可。

3) Install pip 3)安装pip

sudo easy_install pip

4) Install nodejs 4)安装nodejs

  • Go to https://nodejs.org , 转到https://nodejs.org
  • Download node v4.3.0 下载节点v4.3.0
  • Move to Applications, run and install 移至应用程序,运行并安装
  • Open terminal and check that node and npm commands are available 打开终端并检查nodenpm命令是否可用

5) Install less and less-plugin-clean-css 5)安装less less-plugin-clean-css

sudo npm install -g less less-plugin-clean-css

Should show output like this: 应该显示如下输出:

/usr/local/bin/lessc -> /usr/local/lib/node_modules/less/bin/lessc
less-plugin-clean-css@1.5.1 /usr/local/lib/node_modules/less-plugin-clean-css
└── clean-css@3.4.9 (source-map@0.4.4, commander@2.8.1)
less@2.6.0 /usr/local/lib/node_modules/less
├── mime@1.3.4
├── graceful-fs@3.0.8
├── image-size@0.3.5
├── errno@0.1.4 (prr@0.0.0)
├── promise@6.1.0 (asap@1.0.0)
├── source-map@0.4.4 (amdefine@1.0.0)
├── mkdirp@0.5.1 (minimist@0.0.8)
└── request@2.69.0 (aws-sign2@0.6.0, forever-agent@0.6.1, tunnel-agent@0.4.2, oauth-sign@0.8.1, is-typedarray@1.0.0, caseless@0.11.0, stringstream@0.0.5, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, tough-cookie@2.2.1, node-uuid@1.4.7, qs@6.0.2, combined-stream@1.0.5, mime-types@2.1.9, form-data@1.0.0-rc3, aws4@1.2.1, hawk@3.1.3, bl@1.0.2, har-validator@2.0.6, http-signature@1.1.1)

6) Install binary dependencies 6)安装二进制依赖项

I think not all the steps below are really necessary, but I performed them, so include just for the case they actually were needed. 我认为下面的所有步骤并非都是必要的,但是我执行了它们,因此仅包括它们实际需要的情况。

  • Run in the terminal xcode-select --install , when dialog appears - agree to install 在终端xcode-select --install ,当出现对话框时 - 同意安装
  • Go to http://brew.sh and follow instructions to install homebrew 转到http://brew.sh并按照说明安装自制软件

Once you have brew , run the following in the terminal: brew完成后,在终端中运行以下命令:

brew install autoconf automake libtool
brew install libxml2 libxslt libevent

7) Install python dependencies 7)安装python依赖项

sudo easy_install -U setuptools
pip install --user -r requirements.txt

It should show something like this at the end: 它应该在最后显示这样的东西:

Successfully installed Babel-1.3 Jinja2-2.7.3 Mako-1.0.1 MarkupSafe-0.23 Pillow-2.7.0 PyYAML-3.11 Python-Chart-1.39 Werkzeug-0.9.6 argparse-1.2.1 beautifulsoup4-4.4.1 decorator-3.4.0 docutils-0.12 feedparser-5.1.3 gdata-2.0.18 gevent-1.0.2 greenlet-0.4.7 jcconv-0.2.3 lxml-3.4.1 mock-1.0.1 ofxparse-0.14 passlib-1.6.2 psutil-2.2.0 psycogreen-1.0 psycopg2-2.5.4 pyPdf-1.13 pydot-1.0.2 pyparsing-2.0.1 pyserial-2.7 python-dateutil-1.5 python-ldap-2.4.19 python-openid-2.2.5 python-stdnum-1.2 pytz-2013.7 pyusb-1.0.0b2 qrcode-5.1 reportlab-3.1.44 requests-2.6.0 six-1.4.1 suds-jurko-0.6 vatnumber-1.2 vobject-0.6.6 xlwt-0.7.5

8) Run odoo 8)运行odoo

cd odoo  # change dir to the folder you cloned odoo to
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

# Re-check parameters, it looks like addons path you used is incorrect
./odoo.py --addons-path=addons --db-filter=mydb

Now you should see the output like this: 现在你应该看到这样的输出:

INFO ? openerp: OpenERP version 9.0c
INFO ? openerp: addons paths: ['/Users/dev/Library/Application Support/Odoo/addons/9.0', u'/Users/dev/projects/odoo/addons', '/Users/dev/projects/odoo/openerp/addons']
INFO ? openerp: database: default@default:default
INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069

9) Open odoo in your browser 9)在浏览器中打开odoo

  • Go to http://localhost:8069 转到http:// localhost:8069
  • The database setup window appears (see the first screenshot below) 出现数据库设置窗口(参见下面的第一个屏幕截图)
  • Enter databse name = mydbodoo (I think the prefix mydb is important here) and password admin 输入数据库名称= mydbodoo (我认为前缀mydb在这里很重要)和密码admin
  • You can also check the checkbox to load the demo data 您也可以选中复选框以加载演示数据
  • Click Create database 单击Create database
  • Wait and you should be redirected to the odoo interface (see the second screenshot) 等等,你应该被重定向到odoo界面(参见第二个截图)

Done! 完成!

Odoo数据库设置

Odoo用户界面

Update: Mac OS X El Capitan 10.11.2 with virtualenv 更新:带有virtualenv的Mac OS X El Capitan 10.11.2

Do the same as above, on step (7) do not run pip install --user -r requirements.txt and instead to this: 如上所述,在步骤(7)不要运行pip install --user -r requirements.txt而是运行到:

pip install virtualenv  # not sure here, sudo may be needed
mkdir ~/venv
cd ~/venv
mkdir odoo
virtualenv odoo
source ~/venv/odoo/bin/activate
cd ~/path/to/odoo
pip install -r requirements.txt  # no sudo here!

Now continue with step (8) . 现在继续步骤(8) Each time, before starting odoo make sure to activate the virtualenv first: 每次启动odoo之前,请务必先激活virtualenv:

source ~/venv/odoo/bin/activate
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

./odoo.py --addons-path=addons --db-filter=mydb

Ubuntu 15.04 Ubuntu 15.04

Prerequisites: I already had postgresql 9.4.5, nodejs 0.10.25 and python 2.7.8. 先决条件:我已经有postgresql 9.4.5,nodejs 0.10.25和python 2.7.8。

Installation: 安装:

git clone https://github.com/odoo/odoo.git 
cd odoo
sudo apt-get install libldap2-dev libsasl2-dev libevent-dev libxslt1-dev libxml2-dev 
pip install -r requirements.txt
sudo npm install -g less less-plugin-clean-css
./odoo.py --addons-path=addons --db-filter=mydb

That's all, now setup the same way as in the step (9) for Mac OS. 这就是全部,现在设置方法与Mac OS的步骤(9)相同。

Their might be a few issue of python modules, library, packages, or nodejs. 它们可能是python模块,库,包或nodejs的一些问题。

Try with below information: 请尝试以下信息:

  1. Following command will install all python modules required by Odoo. 以下命令将安装Odoo所需的所有python模块。

     pip install lxml 
  2. Check your werkzeug version. 检查你的werkzeug版本。 It will be 0.9.6, if not than upgrade it. 它将是0.9.6,如果不是升级它。

     pip show werkzeug #this command will show the details of werkzeug pip install werkzeug==0.9.6 #this command will install werkzeug up to 0.9.6 
  3. Install nodejs via your preferred package manager ( homebrew , macports ) then install less and less-plugin-clean-css : 通过您的首选包管理器(安装的NodeJS 自制MacPorts的 ),然后安装越来越 少,插件,清理CSS:

     npm install -g less npm install -g less-plugin-clean-css 

For more information, Odoo9 setup documentation. 有关更多信息,请参阅Odoo9安装文档。

NOTE : 注意

Default login and password will be admin and admin . 默认登录名和密码为adminadmin

EDIT: 1 编辑:1

Try to resolve ImportError: No module named pyPdf with below command. 尝试解决ImportError:使用以下命令没有名为pyPdf的模块

pip install pypdf

EDIT: 2 编辑:2

If you don't find relevance distributor than try with below command. 如果您没有找到相关分销商,请尝试使用以下命令。

pip install --allow-unverified pyPdf pyPdf

I did everything but couldn't run odoo on my mac 10.11.6. 我做了一切,但无法在我的Mac 10.11.6上运行odoo。

I had this problem when I try to run odoo ./odoo.py 当我尝试运行odoo ./odoo.py时遇到了这个问题

psycopg2 can't find symbol _PQbackendPID

I found out I have many version of python installed ranging form 2.3 to 3.5 我发现我有很多版本的python安装范围从2.3到3.5

Deleted all version of python How to uninstall Python 2.7 on a Mac OS X 10.6.4? 删除所有版本的python 如何在Mac OS X 10.6.4上卸载Python 2.7?

$ brew uninstall --force python3
$ brew uninstall --force python

Clear all changes in ~/.bash_profile 清除~/.bash_profile所有更改

also deleted /usr/local/lib/python2.7/site-packages 还删除了/usr/local/lib/python2.7/site-packages

Then start from beginning: 然后从头开始:

 $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

 $ brew update
 $ brew install python

 $ brew install postgresql

To start the PostgreSQL right now and automatically at system startup we run: 要立即启动PostgreSQL并在系统启动时自动启动,我们运行:

 $ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
 $ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
 // I had error: LaunchAgents not found 
 // If you have error you can download postgres from postgresapp.com to manually start the server

Install some dependencies 安装一些依赖项

$ brew install freetype jpeg libpng libtiff webp xz
$ pip install --upgrade pip
$ pip uninstall virtualenv
$ pip install virtualenv
// Delete existing ~/odoo-env folder first
$ virtualenv ~/odoo-env  
$ . ~/odoo-env/bin/activate

Clone git repository branch 9.0 克隆git存储库分支9.0

$ git clone https://github.com/odoo/odoo.git -b 9.0

change to the cloned odoo directory (with cd ) and run (you have to be in your virtual environment): 更改为克隆的odoo目录(使用cd )并运行(您必须在您的虚拟环境中):

$ pip install -r requirements.txt

If Successfully installed, run 如果已成功安装,请运行

$ export LC_ALL=en_US.UTF-8
$ export LANG=en_US.UTF-8
$ python ./odoo.py

A wonderful tutorial by Christoph Giesel Christoph Giesel的精彩教程

I get the same issue and it seems that my system is not using the correct Six library. 我得到了同样的问题,似乎我的系统没有使用正确的六库。 What you can do first is to update your library 您首先要做的是更新您的库

sudo pip2 install six -U

And once you have done that, your system can use the wrong library again. 一旦完成,系统就可以再次使用错误的库。 To check that, you can create a python file like this 要检查这一点,您可以创建一个这样的python文件

#vi testsix.py to create the file
#type i to insert
import six
print six.__file__
#escape
#type wq to save
#chmod +x testsix.py
#python testsix.py

Then if you read 如果你读了

/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six.pyc

Then you have to remove this file 然后你必须删除此文件

rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six.*

Then you can re-check the file testsix.py and check you get this path 然后,您可以重新检查文件testsix.py并检查您是否获得此路径

/Library/Python/2.7/site-packages/six.pyc

Then you should re-launch your odoo server. 然后你应该重新启动你的odoo服务器。

I get this from the Oriol Nieto's answer I was trying to solve the previous Internal Server Error I get. 我从Oriol Nieto的回答中得到了这个,我试图解决之前的内部服务器错误。

Note if you are using El Capitan and you meet some permission issue even with sudo, you may need to check this link to remove some root access 请注意,如果您使用El Capitan并且即使使用sudo也遇到一些权限问题,您可能需要检查此链接以删除一些root访问权限

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

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