我正在使用Python在Raspbian(Pi3)上运行一个Telegram Bot,并且我正在使用Python 3.6。
以下是我的导入:
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import (
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from uuid import uuid4
import re
import telegram
from telegram.utils.helpers import escape_markdown
from telegram import InlineQueryResultArticle, ParseMode, \
InputTextMessageContent
from telegram.ext import Updater, InlineQueryHandler, CommandHandler
import logging
import random
import telepot
import unicodedata
import json
import requests
import bs4
from bs4 import BeautifulSoup
当我尝试使用sudo python3 bot.py运行我的机器人时,出现了问题。ImportError: No module named 'future'
我已经搜索了很多答案,例如pip install future
和pip3 install future
,但都没有对我起作用。这个模块在我的Python 3.6库中确实显示出来了future in lib
不知道为什么它仍然显示No module named future
?
sudo
运行呢?这会破坏你的环境,这就是为什么 Python 找不到已安装的模块的原因。 - avigil