module 'ibis.impala' has no attribute 'connect' - python

I have installed Python3.5 and ibis-framework 0.10.0. I want to operate Pandas data to impala database directly. But i meet the following error. Would you help me to solve it? The command line as following:
import ibis
conn = ibis.impala.connect(host='192.168.1.14', port=21050)
The error message as following:
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
conn = ibis.impala.connect(host='192.168.1.14', port=21050)
AttributeError: module 'ibis.impala' has no attribute 'connect'

it seems that you need to do this pip install ibis-framework[impala], see the link here ibis doc

it seems to have been moved in the ibis.impala.api submodule also if you would have to install hdfs otherwise it seems to fail

Related

Can't import "ImportObject" from python "wasmer"

So easy to reproduce that I'm surprised that nobody has reported it yet.
pip install wasmer
python -c 'from wasmer import ImportObject'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name 'ImportObject' from 'wasmer' (/usr/lib/python3.8/site-packages/wasmer.cpython-38-x86_64-linux-gnu.so
"ImportObject" class is described in readme and presented in examples. I've checked that proper 0.4.1 version of "wasmer" was installed. Also I checked the newest tagged version of "wasmer" which fails with the same error. Do I do something totally wrong?
UPD: generate_import_object() function doesn't work also:
python -c "from wasmer import Module; Module.generate_import_object()"
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: type object 'Module' has no attribute 'generate_import_object'
And this code gives the same result:
wasm_bytes = open('binary.wasm', 'rb').read()
module = Module(wasm_bytes)
import_object = module.generate_import_object()
The library in pip is outdated. The current version is from March, 2nd, and the necessary changes were implemented only on June, 2nd. 0.4.2 beta version is outdated also (May, 19). So, the only way now is manual build. Probably the library will be updated in a couple of weeks.
See more details in this thread: https://github.com/wasmerio/python-ext-wasm/issues/215.

unable to find whois library

I am trying "whois" with python.
I installed whois for python using following code (OS:- CentOS 7)
pip install python-whois
when I run following three commands at python console it works
import whois
w = whois.whois('www.google.com')
print w
But when same three lines I save in file whois.py and run code with command
python whois.py
It gives following error
Traceback (most recent call last):
File "whois.py", line 1, in <module>
import whois
File "/home/sysadmin/pythonPractice/whois.py", line 2, in <module>
w = whois.whois('www.google.com')
TypeError: 'module' object is not callable
this issue is because your filename is whois.py and when you try to call the library whois it gets overwritten so, you should name your file from whois.py to something else.

Zbar on raspberry?

I'm trying use zbar on RPI3 but i have a problem. I dont have ImageScanner, Image... module.
import zbar
scanner = zbar.ImageScanner()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'ImageScanner'
I tried to install it from pip, official repository, some fork, but nothing work.
https://pastebin.com/ajbWdSct
how can i access image modul?
To list module content try to type:
import zbar
dir(zbar)
See example are in source https://github.com/npinchot/zbar/blob/master/examples/read_one.py

twitter Api giving error using python

hi i am new to python and i got this error but i have installed twitter but it's giving this error
import twitter
api=twitter.Api()
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
api=twitter.Api()
AttributeError:'module' object has no attribute 'Api'
I don't know about this error as i have almost every package related to twitter
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
api = twitter.Api()
AttributeError: 'module' object has no attribute 'Api'
when i give this command
python setup.py install_data
it give error like this
running install_data
Traceback (most recent call last) :
file "setup.py" ,line 47 , <module>
""" ,
File "C:\python26\lib\distutils\core.py" ,line 152 , in setup
dist.run_commands()
File "C:\python26\lib\distutils\dist.py" ,line 975 , in run_commands
self.run_command(cmd)
File "C:\python26\lib\distutils\dist.py" ,line 995 , in run_commands
command_obj.run
File "C:\python26\lib\distutils\command\install_data.py" , line 44 in run
For f in self.data_files
can you reinstall using,
sudo pip install twitter
or
sudo easy_install twitter
The old versions did not required OAuth but new one does.
The documentation of the latest version requires these to initiate the API
>>> api = twitter.Api(consumer_key='consumer_key',
consumer_secret='consumer_secret', access_token_key='access_token', access_token_secret='access_token_secret')
Your mixed with libraries actually the problem is that your are reading library of python_twitter and installed twitter.You need select the correct documentation.This is documentation error nothing else.You installed correct library.
The error message "'module' object has no attribute 'Api'" means what it says: Python can't find anything named 'Api' inside the imported module 'twitter'.
Try dir(twitter) after the import statement. dir() will show what Python finds inside the object. If dir(twitter) shows an object called 'twitter', you may have to do something like from twitter import twitter.
Where did you install the python twitter module from? I used http://code.google.com/p/python-twitter/source/browse/twitter.py, and it has an Api class.
>>> import twitter
>>> api = twitter.Api()
You've installed the wrong twitter library. I'm guessing you've done
pip install twitter
you should uninstall that library:
pip uninstall twitter
and install the correct(*) one
pip install python_twitter
(*) by correct I mean the one you're reading the documentation to :-)

Get AttributeError after upgrading to IPython13

I upgraded my IPython installation with pip, and when I use ipython, it failed like this:
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Shell'
But when I try $(which ipython), it starts up normally.
What may be the reason of that AttributeError?
Look under ~/.ipython. There's probably a configuration script there that is using the old API.
It turns out that an alias in .bashrc overrode ipython in $PATH, and it was set to be an old version of ipython

Categories

Resources