解决“ImportError :No Module named sh"和”Import error: No module named jinja2“

1,引言

     在centOS7服务器上搭建小米的mace框架时,执行

python tools/converter.py convert --config=/path/to/mace-models/mobilenet-v2/mobilenet-v2.yml

时候,一直出现。然后到pycharm上配置python2.7和python3.6的sh库,安装上了但是还是报错。

 

补充:解决完上述的。错误之后,又出现Import error:
No module named jinja2

2.解决办法

 sudo easy_install sh  (解决ImportError :No Module namesd sh问题)

sudo yum install python-jinja2(解决Import error: No module named jinja2问题,   这里需要注意因为我的是centOS7系统所以用yum命令,如果你的是ubuntu,把yum命令换成apt-get即可)

ok,完美解决

后面会自动提示

Searching for sh
Reading https://pypi.python.org/simple/sh/
Best match: sh 1.12.14
Downloading https://files.pythonhosted.org/packages/7c/71/199d27d3e7e78bf448bcecae0105a1d5b29173ffd2bbadaa95a74c156770/sh-1.12.14.tar.gz#sha256=b52bf5833ed01c7b5c5fb73a7f71b3d98d48e9b9b8764236237bdc7ecae850fc
Processing sh-1.12.14.tar.gz
Writing /tmp/easy_install-uOE44G/sh-1.12.14/setup.cfg
Running sh-1.12.14/setup.py -q bdist_egg --dist-dir /tmp/easy_install-uOE44G/sh-1.12.14/egg-dist-tmp-VJduTg
warning: no previously-included files matching '*.pyc' found anywhere in distribution
zip_safe flag not set; analyzing archive contents...
sh: module references __file__
sh: module references __path__
sh: module MAY be using inspect.stack
Adding sh 1.12.14 to easy-install.pth file

Installed /usr/lib/python2.7/site-packages/sh-1.12.14-py2.7.egg
Processing dependencies for sh
Finished processing dependencies for sh
 

 

  • 6
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hanaif

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值