from googleapiclient.discovery import build ModuleNotFoundError: No module named 'googleapiclient' - visual-studio

Visual Studio blows the below error:
from googleapiclient.discovery import build ModuleNotFoundError: No
module named 'googleapiclient'
when I am running a script that reads google sheets using the:
from googleapiclient.discovery import build from
google_auth_oauthlib.flow import InstalledAppFlow
I have installed the libraries using pip
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
the code runs fine in Pycharm but not when using other interpreter in VS.

maybe you could try
pip install google-api-python-client
For more information,visit this tutorial

Related

gensim - ConcatenatedDoc2Vec: ModuleNotFoundError: No module named 'testfixtures

I have
pip install gensim
But when I tried to import ConcatenatedDoc2Vec, I get
ModuleNotFoundError: No module named 'testfixtures
from gensim.test.test_doc2vec import ConcatenatedDoc2Vec
I need to first
pip install testfixtures

Cannot import 'etree' from 'lxml'

I have installed lxml on my Windows machine using
pip install lxml
However, if I run
from lxml import etree
or
from requests_html import HTMLSession
I get
cannot import name 'etree' from 'lxml' (C:\Users\user\AppData\Local\Programs\Python\Python39\Lib\site-packages\lxml\__init__.py)
I have uninstalled and reinstalled lxml many times through pip and it installs successfully every time. I can see folders lxml and lxml-4.6.2.dist-info getting installed in site-packages every time I reinstall. I don't have any lxml.py files in this directory either.
Do you also have Anaconda installed ? If you have both Python and Anaconda installed, there are two directories for the site-packages (one for Python and another for Ananconda), which could cause an error when trying to import.
You can try the following steps below and then run your program again:
Uninstall Anaconda from your machine
pip uninstall lxml
pip install lxml

Import Error : C Extension while generating windows executable of a Python script using PyInstaller

Import error: C extension: NO MODULE NAMED TIMEDELTAS NOT BUILT. If you want to import PANDAS from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.
I tried following things up to now but couldn't resolve this :
pip install --upgrade pip
pip install --upgrade pandas
uninstalled the existing version of pandas and installed again.
pip install Cython
Please look at the SCREENSHOT ATTACHED ABOVE SHOWS VERSION of PANDAS, NUMPY, PYTZ, SIX installed on my system.
NOTE : I'm using Python 2.7
Any help on this will be appreciated.
Thanks.

Google Cloud Logging in Python - ImportError

I get the following error when trying to import Google Cloud Logging in Python:
from google.cloud import logging
File "/usr/local/lib/python3.6/site-packages/google/cloud/logging/__init__.py", line 21, in <module>
from google.cloud.logging.client import Client
File "/usr/local/lib/python3.6/site-packages/google/cloud/logging/client.py", line 32, in <module>
from google.cloud.client import ClientWithProject
ImportError: cannot import name 'ClientWithProject'
I have it running in a virtual environment
with this in requirements.txt:
google-cloud-logging>=0.20.0
I was able to get to the next error with:
pip3 install --upgrade google-cloud-logging
for Python 3 and:
pip install --upgrade google-cloud-logging
for Python 2.7
Try to update your google cloud components, run in terminal as admin:
gcloud components update
I had to install dataproc on top of the google-cloud-logging and google-cloud-storage.
Python3
pip3 install mrjob google-cloud-dataproc google-cloud-logging google-cloud-storage
Python2.7
pip3 install mrjob google-cloud-dataproc google-cloud-logging google-cloud-storage

Import Tensorflow in spyder on mac

I followed the instructions on tensorflow.org:
./conda create -n tensorflow python=2.7
source activate tensorflow
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl --ignore-installed
pip install --upgrade $TF_BINARY_URL
When I run python in terminal, I can import tensorflow
But when I try to import tensorflow in Spyder, I got:
ImportError: No module named tensorflow
How to get tensorflow in Spyder?
I just found out that if environment is changed at the Launcher from root to tensorflow, I can install a fresh copy of Spyder in that environment. Once installed, import tensorflow works.

Resources