Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
关于安装Python包的查询_Python_Mechanize_Ipython - Fatal编程技术网

关于安装Python包的查询

关于安装Python包的查询,python,mechanize,ipython,Python,Mechanize,Ipython,我在我的Ubuntu上安装了ipython,然后在同一个Ubuntu上安装了mechanize。 我能做到 import mechanize 从命令提示符。但当我说从ipython导入mechanize时,它说没有名为mechanize的模块。我会这样做 在控制台中: >>> import mechanize >>> mechanize.__file__ Some/path/to/mechanize 然后在伊皮顿 [1] import sys [2] pr

我在我的Ubuntu上安装了ipython,然后在同一个Ubuntu上安装了mechanize。
我能做到

import mechanize
从命令提示符。但当我说从ipython导入mechanize时,它说没有名为mechanize的模块。

我会这样做

在控制台中:

>>> import mechanize
>>> mechanize.__file__
Some/path/to/mechanize
然后在伊皮顿

[1] import sys
[2] print sys.path

查看/Some/path/to/mechanize是否在您的sys.path中。

检查它(mechanize)的安装位置,并确认它是否可以在PYTHON中访问_PATH@harshith:路径是不同的burhan:noand我不明白为什么我可以从命令导入,但不能从IPythons导入,因为它不在sys.path中。你能告诉我如何将它们永久地添加到ubuntu的sys,path中吗?把这一行放到
~\.bashrc
文件
导出PYTHONPATH=
中。这一行命令应该执行以下任务:
$echo“export PYTHONPATH=“>>~\.bashrc
。然后重新启动操作系统并检查。@HarshithJ.V:我尝试了与您解释的相同的方法&同时重新启动系统。还是同样的错误
机械化了什么。_文件_
给了你什么?