I'm trying to build my own bot but I've some troubles when I try to import the telepot
package. I installed telepot with the command to a virtualenv
:
pip install telepot
and I've no problems when I do
python
import telepot
But to use the GPIO
it's necessary the be the super user, so
sudo python
import telepot
but the answer is
ImportError: No module named telepot
What is wrong?
Since you are using virtualenv
and want to execute Python with sudo
, try this:
pip install telepot
which python
sudo <path_to_python_from_step3>
import telepot
should work now
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.