Error installing ckanclient on Python 3.3 using pip - python

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.

Related

"SyntaxError: invalid syntax" while installing Setuptools

I needed to install Setuptools for a project I was doing, and I had to download Setuptools through a .tar file (don't ask), but when ran the command I needed to use to install it:
C:\Users\myname\Downloads\setuptools-51.1.1>py -2 setup.py install
It ended up with a SyntaxError:
Traceback (most recent call last):
File "setup.py", line 7, in <module>
import setuptools
File "C:\Users\myname\Downloads\setuptools-51.1.1\setuptools\__init__.py", line 16, in <module>
import setuptools.version
File "C:\Users\myname\Downloads\setuptools-51.1.1\setuptools\version.py", line 1, in <module>
import pkg_resources
File "C:\Users\myname\Downloads\setuptools-51.1.1\pkg_resources\__init__.py", line 1365
raise SyntaxError(e) from e
^
SyntaxError: invalid syntax
I'm using Python 2.7.
Why is it showing the error, and how can I fix it?
Edit:
When I looked into the __init__.py file, I found that there was something called an "invalid marker":
try:
marker = packaging.markers.Marker(text)
return marker.evaluate()
except packaging.markers.InvalidMarker as e:
raise SyntaxError(e) from e
The last version of setuptools to support Python 2.7 was 44.1.1 (Jan 2020). See the changelog.
Upgrade your Python version in order to use setuptools 51.1.1.

find_package() errors during installing package via pip

I'm tring to install django-dbsettings with pip but it causes the following error:
Downloading django-dbsettings-0.7.4.tar.gz
Running setup.py egg_info for package django-dbsettings
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/path/virtualenv/build/django-dbsettings/setup.py", line 23, in <module>
packages=find_packages(include=['dbsettings']),
TypeError: find_packages() got an unexpected keyword argument 'include'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/path/virtualenv/build/django-dbsettings/setup.py", line 23, in <module>
packages=find_packages(include=['dbsettings']),
TypeError: find_packages() got an unexpected keyword argument 'include'
Also I'm using pip 1.0 and python 2.7.
How can I fix it?
There is no include keyword in find_packages() using older versions of setuptools, you need to upgrade:
pip install -U setuptools
I would also update pip.

Error installing python preppy

When installing preppy in a virtualenv on my workstation (Ubuntu Linux) it works, but when installing it the same way on an instance of Amazon Linux I get an error like this:
(env)[ec2-user#server t]$ pip install preppy
Downloading/unpacking preppy
Downloading preppy-2.3.2.tar.gz (42kB): 42kB downloaded
Running setup.py (path:/home/ec2-user/t/env/build/preppy/setup.py) egg_info for package preppy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/ec2-user/t/env/build/preppy/setup.py", line 13, in <module>
import preppy
File "/home/ec2-user/t/env/build/preppy/preppy.py", line 72, in <module>
isPy3 = sys.version_info.major == 3
AttributeError: 'tuple' object has no attribute 'major'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/ec2-user/t/env/build/preppy/setup.py", line 13, in <module>
import preppy
File "/home/ec2-user/t/env/build/preppy/preppy.py", line 72, in <module>
isPy3 = sys.version_info.major == 3
AttributeError: 'tuple' object has no attribute 'major'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/ec2-user/t/env/build/preppy
Storing debug log for failure in /home/ec2-user/.pip/pip.log
This hints at a problem when checking what the Python version is, but googling around did not help me this time.
I'm aware that python packages sometimes have dependencies on host software, eg to install psycopg2 I had to first install the Postgres development packages on the operating system.
So how do I fix this error?
Your ec2 instance needs to be running (at least) Python 2.7.
sys.version_info didn't become a named tuple until 2.7.

Does cql support python 3?

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.

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