What should I do if I can import a module when I run python, but not when I run sudo python?
For example:
whoami
rose
python
>>> import mymodule
>>>
.
sudo python
>>> import mymodule
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mymodule
I had run sudo chown -R rose:rose
on the package containing this module.
sudo which python
and which python
both print /usr/bin/python
.
I'm running Linux.