简体   繁体   English

Python3 Odoo TypeError sys.print 不是函数

[英]Python3 Odoo TypeError sys.print is not a function

I've just set up a fresh install of Odoo (no custom addons/modules) and, after creating a database, i get this error on my main page:我刚刚设置了全新安装的 Odoo(没有自定义插件/模块),在创建数据库后,我的主页上出现此错误:


The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made.

(b'', b'TypeError: sys.print is not a function
    at /usr/lib/nodejs/less/bin/lessc:384:25
    at tree.importVisitor.finish [as _finish] (/usr/lib/nodejs/less/lib/less/parser.js:669:28)
    at tree.importVisitor.run (/usr/lib/nodejs/less/lib/less/import-visitor.js:25:22)
    at Object.parse (/usr/lib/nodejs/less/lib/less/parser.js:675:22)
    at parseLessFile (/usr/lib/nodejs/less/bin/lessc:345:12)
    at Socket. (/usr/lib/nodejs/less/bin/lessc:407:9)
    at Socket.emit (events.js:228:7)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)
')This error occured while compiling the bundle 'web.assets_common' containing:
    - /web/static/lib/bootstrap/less/variables.less
    ....

I've already tried, after some researches on Google:我已经尝试过,经过对谷歌的一些研究:

  • Linking nodejs to node in /usr/bin将 nodejs 链接到 /usr/bin 中的节点

  • Reinstalling node-js, less-js, uglify-js重新安装 node-js、less-js、uglify-js

  • Reinstalling all pip3 Odoo requirements重新安装所有 pip3 Odoo 要求

  • Dropping my database after every try每次尝试后删除我的数据库

  • Downgrading Less to 1.3.3将 Less 降级到 1.3.3

My versions:我的版本:

NodeJs v12.14.1 NodeJs v12.14.1

Npm 6.13.4新版 6.13.4

less@3.11.1少@3.11.1

less-plugin-clean-css@1.5.1 less-plugin-clean-css@1.5.1

It's not a common error as i see, and it's not well documented what to do in this case.正如我所见,这不是一个常见的错误,并且没有很好地记录在这种情况下该怎么做。 Anyone has ever seen something similiar?有人见过类似的东西吗?

I recently had a similar error with Odoo 11 on Ubuntu 18.04, I had installed less with apt install node-less (which installs lessc 1.6.3).我最近在 Ubuntu 18.04 上使用 Odoo 11 遇到了类似的错误,我使用apt install node-less (安装了lessc 1.6.3)安装了 less。 Installing less with npm install -g less instead (npm 6.13.4, nodejs 12.16.1, which installs lessc 3.11.1) made it work.使用npm install -g less (npm 6.13.4,nodejs 12.16.1,安装 lessc 3.11.1)使它工作。

What is strange is that you state that you already have lessc 3.11.1.奇怪的是你说你已经有了lessc 3.11.1。 Maybe try removing less completly and install it with npm.也许尝试不完全删除并使用 npm 安装它。

Install Recommended build dependencies from bootstrap,从引导程序安装推荐的构建依赖项,

command - npm install -g less jshint recess uglify-js命令 - npm install -g less jshint 凹进 uglify-js

Thanks谢谢

Try using npm install -g --force less less-plugin-clean-css尝试使用npm install -g --force less less-plugin-clean-css
I had a similar issue when upgrading from Odoo 10 to 11, on Ubuntu 20.4, I tried running从 Odoo 10 升级到 11 时,我遇到了类似的问题,在 Ubuntu 20.4 上,我尝试运行
sudo npm install -g less less-plugin-clean-css
which brought errors given node-less was installed, but on trying the flag --force it installed without any errors and Odoo functioned ok.如果安装了无节点,这会带来错误,但是在尝试标记--force它安装时没有任何错误,Odoo 运行正常。

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

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