Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named future

I am running a telegram bot in python and i am using python3.6 on raspbian ( pi3 )

Below is my imports:

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

When i try to run my bot with sudo python3 bot.py i get

ImportError: No module named 'future'

I have searched and found many answers on this but none have worked for me such as pip install future and pip3 install future The module does show in my lib for python 3.6 future in lib

Any idea why it still says No module named future? ?

like image 874
PeppaPigKilla Avatar asked Mar 18 '18 23:03

PeppaPigKilla


People also ask

What is __ future __ in Python?

__future__ module is a built-in module in Python that is used to inherit new features that will be available in the new Python versions.. This module includes all the latest functions which were not present in the previous version in Python.

What does from __ future __ import annotations do?

For files with from __future__ import annotations it automatically unquotes stringified type hints.


2 Answers

I ran into a similar problem using Python code written by someone else. See http://python-future.org/. future is a module that aids in conversion between Python 2 and 3. It was an easy installation for me by doing pip3 install future

like image 90
jkulpe Avatar answered Sep 21 '22 06:09

jkulpe


I tried install, reinstall, easy_install and conda install but nothing worked for me. I was finally able to import my package by running upgrade on future.

pip install -U future 

This solved my issue.

like image 24
Sayali Sonawane Avatar answered Sep 21 '22 06:09

Sayali Sonawane