Does cql support python 3? - python

Does cql has support python3?
I tried to install with pip but it failed.
rabit#localhost:/usr/bin> pip-3.3 install cql
^CDownloading/unpacking cql
Operation cancelled by user
Storing complete log in /home/rabit/.pip/pip.log
rabit#localhost:/usr/bin> sudo pip-3.3 install cql
root's password:
Downloading/unpacking cql
Downloading cql-1.4.0.tar.gz (76kB): 76kB downloaded
Running setup.py egg_info for package cql
Downloading/unpacking thrift (from cql)
Running setup.py egg_info for package thrift
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build/thrift/setup.py", line 45
except DistutilsPlatformError, x:
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build/thrift/setup.py", line 45
except DistutilsPlatformError, x:
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/thrift
In fact cql is dependent on Thrift which probably not support python3
Any solution??

Thrift does indeed explicitly not support Python 3, it's metadata is marked as supporting Python 2 only, and installing it gives you a Syntax error.
The solution is to contact the authors of Thrift and help them port to Python 3. and once that is done, help port cql. Updating is usually easy (except in some special cases) and fun!

No, the cql library is not compatible with Python 3. It relies on thrift, a package that is not Python 3 compatible itself:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/Users/mj/Development/venvs/stackoverflow-3.3/build/thrift/setup.py", line 45
except DistutilsPlatformError, x:
^
SyntaxError: invalid syntax
cql itself uses the same obsolete syntax in cqltypes.py:
except (ValueError, AssertionError, IndexError), e:
Both thrift and cql need to be ported first.

For Python 3, you can use CQLEngine.

Related

Python text to speech library download problem

I am tying to install the library pyttsx3 by running pip install pyttsx3 But it gives my this output:
Downloading/unpacking pyttsx3
Downloading pyttsx3-2.7.tar.gz
Running setup.py (path:/private/var/folders/km/sv51fl4d30g668xtstm8_lzh0000gq/T/pip_build_username/pyttsx3/setup.py) egg_info for package pyttsx3
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'summary'
warnings.warn(msg)
/private/var/folders/km/sv51fl4d30g668xtstm8_lzh0000gq/T/pip_build_username/pyttsx3/setup.py:12: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.
The above copyright notice and this permission notice shall be included in all
Downloading/unpacking pyobjc>=2.4 (from pyttsx3)
Downloading pyobjc-7.0.1.tar.gz
Running setup.py (path:/private/var/folders/km/sv51fl4d30g668xtstm8_lzh0000gq/T/pip_build_username/pyobjc/setup.py) egg_info for package pyobjc
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/var/folders/km/sv51fl4d30g668xtstm8_lzh0000gq/T/pip_build_username/pyobjc/setup.py", line 536
print(f"Framework {fwk} not in framework-wrappers.rst")
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/var/folders/km/sv51fl4d30g668xtstm8_lzh0000gq/T/pip_build_username/pyobjc/setup.py", line 536
print(f"Framework {fwk} not in framework-wrappers.rst")
^
SyntaxError: invalid syntax
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/km/sv51fl4d30g668xtstm8_lzh0000gq/T/pip_build_username/pyobjc
Storing debug log for failure in /var/folders/km/sv51fl4d30g668xtstm8_lzh0000gq/T/tmp7QzgEE
What should I do?
BTW I am using Visual Studio Code. a--------------------------------------------------
Stackoverflow doesn't give me the access to post this question because it is mostly code so I am writing this. Please do not care.
I found my problem,
The library that I wanted to download wasn't compatible with python2.7. When I passed into 3.9, it worked.

Not able to pip install DAG package in python

I am getting an error while trying pip install DAG packcage.
Error
Collecting DAG
Using cached https://files.pythonhosted.org/packages/e1/92/ffc722ac557e3c180f8ec6cdad96d2731b981677529c263c3df04a656910/DAG-0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ASHOK~1.EAP\AppData\Local\Temp\pip-install-4dybsujd\DAG\setup.py", line 1, in <module>
from ez_setup import use_setuptools
File "C:\Users\ASHOK~1.EAP\AppData\Local\Temp\pip-install-4dybsujd\DAG\ez_setup.py", line 94
except pkg_resources.VersionConflict, e:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ASHOK~1.EAP\AppData\Local\Temp\pip-install-4dybsujd\DAG\
How to fix this.
Try pip install py-dag, this will use https://github.com/thieman/py-dag
DAG, released in 2007. The code is Python2-only.
Try installing the module with Python 2.7. Or find a different, Python3-compatible module.

Installing hachoir-metadata throws exception

I am trying to install the package hachoir-metadata using pip:
pip install hachoir-metadata
After executing the above command, I got the error
C:\Users\Dimitar>pip install hachoir-metadata Downloading/unpacking
hachoir-metadata Running setup.py
(path:C:\Users\Dimitar\AppData\Local\Temp\pip_build_Dimitar\h
achoir-metadata\setup.py) egg_info for package hachoir-metadata
Traceback (most recent call last):
File "", line 17, in
File "C:\Users\Dimitar\AppData\Local\Temp\pip_build_Dimitar\hachoir-metada
ta\setup.py", line 65
except OSError, err:
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 17, in
File
"C:\Users\Dimitar\AppData\Local\Temp\pip_build_Dimitar\hachoir-metadata\s
etup.py", line 65
except OSError, err:
^
SyntaxError: invalid syntax
The downloaded file is the correct one from Pypi. From the log:
Using version 1.3.3 (newest of versions: 1.3.3, 1.3.2, 1.3.1, 1.3,
1.2.1, 1.2, 1.1, 1.0.1, 1.0)
Downloading from URL https://pypi.python.org/packages/source/h/hachoir-metadata/hachoir-metadata-1.3.3.tar.gz#md5=26e04a2395205d31469fc2d6935055a9
(from https://pypi.python.org/simple/hachoir-metadata/)
I've opened the file hachoir-metadata\setup.py to see what's wrong on line 65:
command = ["pyuic4", "-o", dialog_python, dialog + ".ui"]
try:
exitcode = call(command)
except OSError, err:
exitcode = 1
But the above lines can't tell me anything more since I'm using Python for 1 hour. My guess is that I'm missing some other packages, which needs to be installed prior installing this hachoir-metadata? Thanks in advance.
You're using Python 3, but this package does not support it.
The line throwing the error is valid Python 2 syntax, but not valid Python 3 syntax.

Error installing ckanclient on Python 3.3 using pip

I'm trying to install ckanclient on Python 3.3 using pip. The command line I'm using is:
c:\Python33\Scripts>pip install ckanclient
I'm getting:
Downloading/unpacking ckanclient
Downloading ckanclient-0.10.tar.gz
Running setup.py (path:c:\users\lgms\appdata\local\temp\pip_build_lgms\ckanclient\setup.py) egg_info for package ckanclient
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\lgms\appdata\local\temp\pip_build_lgms\ckanclient\setup.py"
, line 8, in <module>
from ckanclient import __version__, __description__, __long_description_
_, __license__
File ".\ckanclient\__init__.py", line 100
except HTTPError, inst:
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "c:\users\lgms\appdata\local\temp\pip_build_lgms\ckanclient\setup.py", li
ne 8, in <module>
from ckanclient import __version__, __description__, __long_description__, _
_license__
File ".\ckanclient\__init__.py", line 100
except HTTPError, inst:
^
SyntaxError: invalid syntax
----------------------------------------
Cleaning up...
I need a clue about what is happening there and how to fix it. My OS is Windows 7 Pro, I'm using the standard Python distribution (I also have Anaconda Python installed, but this doesn't look like a version conflict).
The full error log is in: http://pastebin.com/NgFFCrcK
ckanclient, as well as CKAN itself, is not compatible with Python 3. You'll need 2.7.
Another hint: ckanclient is deprecated, see https://github.com/okfn/ckanclient-deprecated. However, if for some reason you really need it please do not use the rather old pip (e.g. pypi) version, but the up-to-date one from github.

pip install rauth fails : syntax error

I just installed Python 3.3 and then I tried to install rauth by issuing the command:
pip install rauth
and I get this error:
Downloading/unpacking rauth
Running setup.py egg_info for package rauth
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\pipul\appdata\local\temp\pip-build-pipul\rauth\setup.py", l
ine 4, in <module>
from rauth import __version__
File ".\rauth\__init__.py", line 30, in <module>
from .service import OAuth1Service, OAuth2Service, OflyService
File ".\rauth\service.py", line 23
except KeyError, e: # pragma: no cover
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\pipul\appdata\local\temp\pip-build-pipul\rauth\setup.py", line 4, in <module>
from rauth import __version__
File ".\rauth\__init__.py", line 30, in <module>
from .service import OAuth1Service, OAuth2Service, OflyService
File ".\rauth\service.py", line 23
except KeyError, e: # pragma: no cover
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1 in c:\users\pipul\appd
ata\local\temp\pip-build-pipul\rauth
Storing complete log in C:\Users\pipul\pip\pip.log
## Heading ##c:\Python33\Scripts>
Similarly installing oauth2 also fails. But installing selenium succeeds.
Now what could be the thing that is causing this failure?
Thanks in advance.
Like many packages, rauth currently does not support Python 3. However, it looks like there is a branch where they are working on it. See here.
In general, you may have more luck installing packages if you use Python 2.7.

Categories