Httplib2 module installation on window7 64 - oauth-2.0

In Python, I used the easy_install and tried to install oauth2. Then I found it needs httplib2.
Used: easy_install httplib2 in the command prompt.
and found the httplib2 0.7.6 egg in site-packages directory.
But when I do
import httplib2
it came back with this: ImportError: No module named httplib2
The only way I can make 'import httplib2' work is first run the setup file in the httplib2 package in the shell and then 'import oauth2'.
I don't know what to do with this, because I need oauth2 to connect to Yelp API. Please help me with this, thank you sooooooooooooo much!!!

Related

Import cv2 doesn't work despite having installed OpenCV-python

I am a newbie and have been trying to run a python code that uses cv2. I am using the python 3.6.8 terminal.
Please see below for the first part of the code:
import cv2
import numpy as np
import os
import sys
import tensorflow as tf
from sklearn.model_selection import train_test_split
Although I have installed opencv-python, I get a "Module not found" error message as below:
(base) Dhammas-MacBook-Air:python-code-r dhammaandrivini$ python3 traffic.py
Traceback (most recent call last):
File "traffic.py", line 1, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
I would be most grateful for any help with this, as I really want to finish this project! :)
It is most likely that you have installed the package using pip install opencv-python. This is the correct command but if you have multiple python installations on your device it might lead to issues.
I would suggest you try and use the command python3 -m pip install opencv-python, this command will install opencv for the pip being used by python3, which you seem to be using to run your code.

i installed opencv-python getting import error

import cv2
ImportError Traceback (most recent call
last) in
----> 1 import cv2
~\Anaconda3\lib\site-packages\cv2__init__.py in
3 import sys
4
----> 5 from .cv2 import *
6 from .data import *
7
ImportError: DLL load failed: The specified module could not be found
Looks like you are using Anaconda. If so don't use pip as it can break your environment, use conda.
You can try by
first going to "anaconda-prompt" using windows search and then run the command as below:
conda install -c conda-forge opencv
or any other from https://anaconda.org/conda-forge/opencv.
Maybe you can uninstall and install opencv. This usually happens when you download package at a different file location or the package itself is not installed properly.
I suggest using this:
1.pip install opencv-python
or if you need the full module (cnn, face analysis, shape and etc)
2.pip install opencv-python-contrib

ModuleNotFoundError: No module named '_lzma'

I am trying to plot in metpy with the help of "xarray with MetPy Tutorial".
For that, I am getting error when am running following modules in:
'import cartopy.crs as crs'
'import cartopy.feature as cfeature'
'import matplotlib.pyplot as plt'
'import xarray as xr'
'import metpy.calc as mpcalc'
'from metpy.testing import get_test_data'
'from metpy.units import units.'
ModuleNotFoundError: No module named '_lzma'
like those errors will appear
so anyone help me.
Thanks in Advance.
This appears to be an issue with your Python build, rather than with MetPy, as _lzma is part of the standard library. From a quick Google search, it seems like this may be an issue with Ubuntu? At any rate, if you google the error, you'll find quite a few solutions to this issue, depending on what your operating system is. We suggest using the Anaconda distribution of Python (https://www.anaconda.com/distribution/), which is easy to set up, and haven't had anyone report this issue before using that stack.
I experienced this error with python 3.7.3 as well. Switching to Python 3.6.5 :: Anaconda, Inc. solved my problem.
I just ran into the same error and blogged about it here. Basically the underscore in the module name hints that it is a module written in C or C++. The reason it is missing from your system is most likely because of a missing system dependencies during installation of the python interpreter. If you installed Python with pyenv they have documented which dependencies should be installed by plattform. Conda does not have that particular problem as it ships with binary dependencies.

Not able to import en_core_web_sm or Spacy

I am trying to import en_core_web_sm as independent package and also tried through spacy. But I am getting an error in ujson module in both case.
Error :
ModuleNotFoundError: No module named 'srsly.ujson.ujson'
I installed en_core_web_sm through following command
python -m spacy download en_core_web_sm
Going by Spacy documentation it shall work. But it is not. I want to import en_core_web_sm.
srsly listed as a dependency so it should be installed. If it's not installed just install it yourself:
python -m pip install srsly

ModuleNotFoundError: No module named 'autokeras.image_supervised'

Installed AutoKeras and pre-reqs in 3.6 Python environment using Anaconda.
Trying to test AutoKeras in Jupyter, but keep getting this error:
ModuleNotFoundError: No module named 'autokeras.image_supervised'
from autokeras.image.image_supervised import load_image_dataset
works for me (seems they changed files' structure of project)
I'm using autokeras-0.3.5
from autokeras import ImageClassifier
if this problem is arised then there might be a chance that u might have not installed autokeras library in the enironment.... I got the same error in Colab notebook try this code
!pip install autokeras
This might solve your problem.....

Resources