error while installing pandas on ubuntu 14 - python

I am trying to install pandas on my ubuntu machine.
I am using this command
sudo pip install pandas
I am getting the following error
Downloading pandas-0.25.1.tar.gz (12.6MB): 12.6MB downloaded
Running setup.py (path:/tmp/pip_build_root/pandas/setup.py) egg_info for package pandas
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/pandas/setup.py", line 21, in <module>
import versioneer
File "versioneer.py", line 1629
print("Adding sample versioneer config to setup.cfg", file=sys.stderr)
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/pandas/setup.py", line 21, in <module>
import versioneer
File "versioneer.py", line 1629
print("Adding sample versioneer config to setup.cfg", file=sys.stderr)
^
SyntaxError: invalid syntax
Can any one please help me with this .

print("Adding sample versioneer config to setup.cfg", file=sys.stderr)
It is a Python 3 syntax.
First install Python 3.
Then run sudo pip3 install pandas or python3 -m pip install pandas.

Related

pip: sys.stderr.write(f"ERROR: {exc}") with Python 3.5 [duplicate]

This question already has answers here:
Installing pip is not working in python < 3.6
(6 answers)
Closed 2 years ago.
i am having a trouble with pip and pip3.
I am trying to install requirements and it shows an error. When i write pip3 or pip --version it show this error.
jumphost#jumphost-VirtualBox:~$ pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import __main__
File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line
21, in <module>
from pip._internal.cli.main import main as _main
File
"/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
If i am trying to install, it showed this
jumphost#jumphost-VirtualBox:~/kubespray$ pip install -r requirements.txt
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import __main__
File
"/usr/local/lib/python2.7/dist-packages/pip-21.0-py2.7.egg/pip/__main__.py",
line 21, in <module>
from pip._internal.cli.main import main as _main
File
"/usr/local/lib/python2.7/dist-packages/pip-21.0-py2.7.egg/pip/_internal/cli/main.py",
line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
jumphost#jumphost-VirtualBox:~/kubespray$ pip3 install -r requirements.txt
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import __main__
File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line
21, in <module>
from pip._internal.cli.main import main as _main
File
"/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
I didn't found a right answer so this is the reason why i ask you. Thanks !
I tried remove python, pip, python3 and pip3 multipletimes but still same problem.
pip has dropped support for Python 2 and 3.5. You will need to use a version-specific branch, assuming that your Python version is 3.5:
curl -fsSL https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.5
get-pip.py reference: https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py
Related: How can I install a legacy PIP version with python 2.6.6 or python 2.7.5?
Better yet, as suggested in the comments, install a newer version of Python that is not end-of-life.

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.

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