ImportError: No module named httplib2 on Heroku - python

Here is my import libraries in my python code which i hosted on heroku
import os
from flask import Flask, render_template
import sys, httplib2, json;
Its shows error ImportError: No module named httplib2??
Can any tell me why is it happening and if any way to correct it??

Do you have the httplib2 module installed?
Try
pip install httplib2

Related

ImportError: cannot import name 'types' Even though I installed google-cloud

I am making a program right now and I am failing at the imports. I am just importing google.cloud.vision and from google.cloud.vision I am importing types as my code
import os, io
from google.cloud import vision
from google.cloud.vision import types
says. I am not getting an error when installing google.cloud in the second line but only at the third line and I don't know why since I am not failing at the second line? I already installed both google-cloud and google-cloud-vision using pip install google-cloud and pip install google-cloud-vision
I believe types is in the vision_v1 namespace. Try the following:
from google.cloud.vision_v1 import types
https://googleapis.dev/python/vision/latest/vision_v1/types.html

Issue importing flask_cors module into Flask App

Hello I am running an application with Flask and have installed flask-cors as per the documentation, however when I try to import the module into my app.py file I get this error:
from flask_cors import CORS
ModuleNotFoundError: No module named 'flask_cors'
Anyone know what may be going wrong here?
Try to run in console following command:
pip install flask_cors
or in some case
pip3 install flask_cors
And be sure that you running Python 3 instead of Python 2

from apiclient.discovery import build ModuleNotFoundError: No module named 'apiclient.discovery'

I'm trying to use the python google-api-python-client for a Youtube Data API project but when I run the following line:
from apiclient.discovery import build
I get the following eror:
from apiclient.discovery import build ModuleNotFoundError: No module named 'apiclient.discovery'
import apiclient runs fine but importing discovery returns an error.
I already checked the top answers from ImportError: No module named apiclient.discovery, but to no avail.
When I run python --version:
I get Python 3.7.6
I'm running MacOs Catalina
Nevermind I fixed the issue by switching apiclient with googleapiclient

import simplejson - no module named simplejson

my python version is 2.7.14 in windows 7
I have import simplejson with command "pip install simplejson"
my code is
import os
import platform
import re
import subprocess
import sys
import threading
import simplejson
error messge is
ImportError: No module named simplejson
how can i fix this ?
Download it from here - simplejson 3.12.0
Install
Enjoy
If you have Python and pip in your PATH just run the following command in your console.
$ pip install simplejson
The console will return the following output
Collecting simplejson
Downloading simplejson-3.13.2-cp27-cp27m-win32.whl (68kB)
Installing collected packages: simplejson
Successfully installed simplejson-3.13.2

Python script can't open zmq-module

I've a problem with a python-script. In a script, i have:
import zmq
from datetime import datetime
import pytz
import bottle
import logging
from bottle import response
But, when i run this script, i see:
ImportError: No module named zmq
I've also tried:
import pyzmq
When i run: pip install pyzmq, it display's that the package already is installed.
But it doesn't works. The probleem arose after i have updated Python 2.6.x to Python 2.7. I think, the plugins are not included in the upgrade?????
Does anyone have an idea?

Categories