无法导入明确安装的模块

无法导入明确安装的模块

问题描述:

安装机械化后,我似乎无法导入.

After installing mechanize, I don't seem to be able to import it.

我尝试从此仓库通过pip,easy_install并通过python setup.py install安装: https://github. com/abielr/mechanize .所有这些都无济于事,因为每次我进入Python交互式页面时,我都会得到:

I have tried installing from pip, easy_install, and via python setup.py install from this repo: https://github.com/abielr/mechanize. All of this to no avail, as each time I enter my Python interactive I get:

Python 2.7.3 (default, Aug  1 2012, 05:14:39) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mechanize
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mechanize
>>> 

我之前运行的安装报告说它们已经成功完成,因此我希望导入能够正常进行.是什么原因导致此错误?

The installations I ran previously reported that they had completed successfully, so I expect the import to work. What could be causing this error?

就我而言,这是权限问题.该软件包仅以root读写权限安装,其他用户只是无法读写!

In my case, it is permission problem. The package was somehow installed with root rw permission only, other user just cannot rw to it!