我在 python 中运行一个电报机器人,我在 raspbian ( pi3 ) 上使用 python3.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
? ?
最佳答案
我尝试了安装、重新安装、easy_install 和 conda install,但对我没有任何帮助。我终于能够通过在 future 运行升级来导入我的包。
pip install -U future
这解决了我的问题。
关于python-3.x - 没有名为 future 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49353905/