Python中文
首页
教程
问答
标签
搜索
登录
注册
重要错误:没有名为pexp的模块
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在使用Fabric,希望使用fexpect。我有以下Python脚本:</p> <pre><code>from ilogue.fexpect import expect, expecting, run (...) def install_postgresql(profile): print("!!! Installing PostgreSQL...") print(' -> Doing pre-cleanup...') # Remove PostgreSQL if it exists prompts = [] prompts += expect('Do you want to continue [Y/n]? ', 'Y') with settings(warn_only=True): with expecting(prompts): run('sudo apt-get purge postgresql') print(' -> Doing actual installation...') # Install PostgreSQL prompts = [] prompts += expect('Do you want to continue [Y/n]? ', 'Y') with expecting(prompts): run('sudo apt-get install postgresql') # In some cases PostgreSQL has issues with Ubuntu's default kernel params # that prevent PostgreSQL to start automatically, so we try to start it # TODO: Fix it with settings(warn_only=True): run('sudo service postgresql start') </code></pre> <p>执行时,出现以下错误:</p> <pre><code>[xxx.xxx.xxx.xxx] out: Traceback (most recent call last): [xxx.xxx.xxx.xxx] out: File "/tmp/fexpect_MbW3QP6Zpy5KBjBGQcaYxi", line 4, in <module> [xxx.xxx.xxx.xxx] out: import pexpect [xxx.xxx.xxx.xxx] out: ImportError: No module named pexpect </code></pre> <p>我使用的是virtualenv,实际安装的是pexpect:</p> <pre><code>(venv)PALM00545424A:woopup i841712$ pip install pexpect Requirement already satisfied (use --upgrade to upgrade): pexpect in ./venv/lib/python2.7/site-packages </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>找到了解决办法。</p> <p>pexpect不是远程机器Python安装的一部分。</p> <p>我只是执行了</p> <pre><code>sudo -E pip install pexpect </code></pre> <p>在远程机器上。</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
plt.savefig不会覆盖现有文件
3 回答
plt.savefig不保存图像
7 回答
plt.savefig在jupyter笔记本中不起作用
9 回答
plt.savefig在从另一个fi调用时停止工作
3 回答
plt.savefig在调用plt.show之前保存空数字
5 回答
plt.save不创建png文件
7 回答
plt.scatter overlay分类数据帧列
3 回答
Plt.Scatter:如何添加title、xlabel和ylab
1 回答
plt.scatter()绘图与Matplotlib中的plt.plot()绘图类似
2 回答
plt.scatter错误'NoneType'对象在成功运行后没有属性'sqrt'
1 回答
plt.set_title()中的标题字符串有误
4 回答
plt.show()
5 回答
plt.show()不在Jupyter笔记本上渲染任何内容
4 回答
plt.show()不打印plt.plot only plt.scatter
3 回答
plt.show()不显示三维散射图像
6 回答
plt.show()不显示任何内容
2 回答
plt.show()不显示数据,而是保留它供下一个图表使用(spyder)
1 回答
plt.show()使终端挂起
9 回答
plt.show()无法使用此代码
2 回答
plt.show()没有打开新的图形风
4 回答