平台:ubuntu 17.04服务器
ubuntu 17.04服务器安装包括python 2.7和python 3.5.我从源手动安装了Python 3.6.3.然而,lsb_release -a失败了:
root@birds:~# lsb_release -a
Traceback (most recent call last):
File "/usr/bin/lsb_release", line 25, in <module>
import lsb_release
ModuleNotFoundError: No module named 'lsb_release'
Run Code Online (Sandbox Code Playgroud)
但是,如果我从修改文件lsb_release的第一线
#!/usr/bin/python3 -Es
,以
#!/usr/bin/python3.5 -Es
它再次工作.
root@birds:~# lsb_release -a
LSB Version: core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
Run Code Online (Sandbox Code Playgroud)
以下是模块搜索路径:
python3.5
root@birds:~# python3.5
Python 3.5.3 (default, Sep 14 2017, 22:58:41)
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> …Run Code Online (Sandbox Code Playgroud) 我有一个控件,它将呈现带有对象数组的哈巴狗模板。
res.render('template.pug', {objects: objects});
Run Code Online (Sandbox Code Playgroud)
在模板中,我将遍历数组,并将日期修改为local date/time.我想调用moment函数实现的日期。
是否可以在pug模板中调用moment函数?还是有更好的解决方案?