AttributeError: 'module' object has no attribute 'SubscriberClient' - python

After running sudo pip install google.cloud.pubsub
I am running the following python code in ubtunu google compute engine:
import google.cloud.pubsub_v1
I get the following error when importing this:
ImportError: No module named pubsub_v1 attribute 'SubscriberClient'
Can anyone tell me how to fix this?

Update your google-cloud-pubsub to the latest version. It should resolve the issue

Related

Why doesn't "pip install" work in Anaconda 3.7?

I installed Anaconda 3.7 on Windows 10.
When I try to run pip install xxx
I get the following message:
TypeError: 'module' object is not callable
Any advice on how to solve this will be much appreciated.
'module' object is not callable points to what xxx is as pointed out by #Lescurel.
You may be trying to access a class inside of the module (which wasn't added to their __init__) and need to change your import statement.
Try: import xxx.class
or
from xxx import class

Why importing pydicom rise AttributeError: module 'gdcm' has no attribute 'DataElement'

After having installed libgdcm-tools (2.6.6-3) on my system (via apt install libgdcm-tools) I am not longer able to import pydicom in Python. When running import pydicom as pdc I got the following error
AttributeError: module 'gdcm' has no attribute 'DataElement'.
Removing libgdcm-tools does not solve the issue.
I am working with Python 3.7 and pydicom 2.0.0 in Ubuntu 18.04.
Indeed #scaramallion's comment pointed me in the right direction. I didnt't have a gcdm directory in the working directory, but in my home directory. Removing that directory solved the problem.

AttributeError: module 'pandas_ml' has no attribute 'imbaccessors'

i try to import lib pandas_ml using pip and using .whl file
but i get the following error
AttributeError: module 'pandas_ml' has no attribute 'imbaccessors'
can any one tell me how can i fix this error

attribute errors: module has no attribute in tensorflow

I am trying to run a sample script where I use
import tensorflow as tf
def main():
if __name__ = '__main__':
tf.app.run(main = main)
that throws an error:
AttributeError: module 'tensorflow' has no attribute 'app'
but when i run it as:
from tensorflow.python.platform import app
it runs well.. the python version I am using is 3.6.1 and tensorflow version: 0.1.8
actuall even
print(tf.__version__)
is showing an attribute error..
AttributeError: module 'tensorflow' has no attribute '__version__'
As Mitiku pointed out.. there was a problem with the installation so i reinstalled it.. and it works now..
print( dir(tf)) -- this should show the list of packages under tensorflow..
My problem was running Tensorflow 1 script for version 2.
tf.app is moved to tf.compat.v1.app in version 2. There is a tool that helps to upgrade to version 2 automatically.
tf_upgrade_v2 --intree my_project/ --outtree my_project_v2/ --reportfile report.txt
I put it here in case somebody had same issue.

install grequests but error: "No module named grequests"

http://i.imgur.com/Kyw8Rip.png
It says grequests is succesfull installed. But when i want to import it. I get a error saying "No module named grequests"
How can i fix this?
System = OS 10.11.6
In command line
pip list
Check package in there

Categories

Resources