Error installing python preppy - python

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.

Related

Tweepy Installation Issue

I am having problems with importing tweedy:
this is the error received
Traceback (most recent call last):
File "star_twitter.py", line 71, in <module>
send_to_twitter(get_price())
File "star_twitter.py", line 9, in send_to_twitter
import tweepy
ImportError: No module named tweepy
I tried re-installing it but now am receiving the following error message
Downloading/unpacking tweepy
Downloading tweepy-3.3.0.tar.gz
Running setup.py egg_info for package tweepy
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/build/tweepy/setup.py", line 17, in <module>
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
TypeError: parse_requirements() got an unexpected keyword argument 'session'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/build/tweepy/setup.py", line 17, in <module>
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
TypeError: parse_requirements() got an unexpected keyword argument 'session'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/pi/build/tweepy
Storing complete log in /root/.pip/pip.log
Your assistance will be appreciated
You may have faced known problem. Try upgrading pip.
sudo pip install --upgrade pip
The fact that you're using virtualenv does help. If you used sudo trying to install tweepy then that's where the installation went wrong.
Try using pip install tweepy only.
If you're still getting an error from that then your virtualenv has probably became corrup. Do the following:
$ deactivate
$ rmvirtualenv nlmanagement
$ mkvirtualenv nlmanagement
$ pip install -r requirements.txt
Try the pip installation first and only use that for future needs in virtualenv.

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 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.

can`t install whoosh alchemy

I can`t seem to install whoosh alchemy for the life of me. reference: http://pythonhosted.org/Flask-WhooshAlchemy/ . Anyway, i'm following http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world and at the part where i'm trying to install whoosh-alchemy.
I'm typing in any of these 3
flask\Scripts\pip install flask-whooshalchemy==0.55a
flask\Scripts\pip install flask-whooshalchemy
flask\Scripts\pip install flask-whooshalchemy==0.55
The error I get is the following:
Downloading/unpacking flask-whooshalchemy
Downloading Flask-WhooshAlchemy-0.55.tar.gz
Running setup.py (path:C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py) egg_info for package flask-whooshalchemy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py", line 28, in <module>
'requirements.txt')).xreadlines()],
AttributeError: '_io.TextIOWrapper' object has no attribute 'xreadlines'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py", line 28, in <module>
'requirements.txt')).xreadlines()],
AttributeError: '_io.TextIOWrapper' object has no attribute 'xreadlines'
I have no idea how to solve this at all... I'm trying to google this but haven't found any luck whatsoever. Maybe my google-fu is just terrible. Much appreciation for any help.
I found this pull request on Flask-WhooshAlchemy's github which talks about pip installs failing due to xreadlines call like in your error log. Try installing it directly from github where that pull request has been merged.
Here's the command to do that - pip install git+https://github.com/gyllstromk/Flask-WhooshAlchemy.git

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