Python 3.6 Error when installing pip install gearman - python

I have been trying to install gearman on python 3.6 but I'm getting this error:
$ pip install gearman
Collecting gearman
Using cached gearman-2.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-xmf1cqe7/gearman/setup.py", line 5, in <module>
from gearman import __version__ as version
File "/tmp/pip-build-xmf1cqe7/gearman/gearman/__init__.py", line 7, in <module>
from gearman.admin_client import GearmanAdminClient
File "/tmp/pip-build-xmf1cqe7/gearman/gearman/admin_client.py", line 4, in <module>
from gearman import util
File "/tmp/pip-build-xmf1cqe7/gearman/gearman/util.py", line 62
except select_lib.error, exc:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xmf1cqe7/gearman/
I am using Ubuntu 16.04 LTS
pip -V -> pip 9.0.1 from [my_project_folder]/venv/lib/python3.6/site-packages (python 3.6)
python --version -> Python 3.6.2
How do I fix that?

The gearman package does not support Python 3. Only python 2.4-2.7 are supported according to their setup.py. There is an open pull request to add python 3 support but it has been untouched for a year. I believe that Yelp! may have stopped supporting this library.

You use python3 and in python3
Use as instead:the raise syntax no longer accepts comma-separated arguments.
The gearman is not the Python 3 version, you can check the link https://pypi.python.org/pypi/gearman

Related

pip3 install mysql-python failed with error code 1 in /tmp/pip-install-4nev4id4/mysql-python/

I am new in python on flask, when i try to install mysql-python by entering the
following command in terminal
pip3 install mysql-python
it shows the following error:
Collecting mysql-python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-4nev4id4/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-install-4nev4id4/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-4nev4id4/mysql-python/
and then I use this command
sudo apt install default-libmysqlclient-dev in terminal which has been suggested by many i checked on stackoverflow.
and then I retry to install mysql-python but also it is showing the same error, can anyone please help me.
mysql-python only supports Python 2.x, while you seem to be using Python 3. From the linked PyPI page:
MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently
supported. Python-3.0 will be supported in a future release.
To connect to MySQL from Python 3 you can use other alternatives:
mysqlclient
mysql-connector-python
pymysql
cymysql
MySQL-python does not support python3. That is why you get this particular error
ModuleNotFoundError: No module named 'ConfigParser'
In python3 ConfigParser is renamed configparser
One option to connect to MySQL DB is official python connector
Another option is pyodbc
Other options are provided in other answers

Python Eel cant be installed

I was trying to install eel using pip install eel but I get an error of
C:\Users\USER>pip install eel
Collecting eel
Using cached Eel-0.7.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\user\appdata\local\temp\pip-build-aa7ptb\eel\setup.py", line 14, in <module>
long_description=open('README.md', encoding='utf-8').readlines()[1],
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\user\appdata\local\temp\pip-build-aa7ptb\eel\
I tried using pip install --upgrade setuptools but still doesnt work.
using python 2.7
The open function in Python 2.7 has a different signature and especially no keyword argument called encoding, as you can read from the error message.
Eel seems to no support Python 2.7 (you should go with Python 3 anyways ;)
open in Python 2.7: https://docs.python.org/2/library/functions.html#open
open in Python 3.6: https://docs.python.org/3/library/functions.html#open

Read the Docs: Distutils2 error during installation

I try to install local instance of Read the Docs on my Win10
When I follow this documentation:
http://docs.readthedocs.io/en/latest/install.html
and type:
pip install -r requirements.txt
I get this error:
Collecting Distutils2==1.0a3 (from -r requirements/pip.txt (line 65))
Using cached Distutils2-1.0a3.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\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\setup.py", line 9, in <module>
from distutils2.util import find_packages
File "C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\distutils2\util.py", line 174
except KeyError, var:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\
Anyone know this error?
My pip version: 8.1.2;
python: 3.5
Is it possible you are running the Python 2 pip? The error message clearly indicates that the code is being executed under Python 3 but has Python 2 syntax. Do you get better results with
python -m pip install -r requirements.txt
I wonder? If not then verify that
python
runs version 3.5 ...
Oh. I just checked and the disutils2 page on PyPI says
Distutils2 development is stopped.
tl;dr: keep using setuptools and pip for now, don’t use distutils2.
It looks like there was never a Python 3 version. Looks like you might need to update your code.

python-daemon 2.0.5 won't install with pip

I am getting errors when trying to install python-daemon 2.0.5 with pip & python 2.6. I know there are other questions that refer to python-daemon 2.0.3 having this problem. But those answers indicate it should be fixed now.
I've tried installing older versions as well without luck. Although if I start over with a fresh virtualenv I am able to install 1.5.6 . However in this virtualenv I get the same error with 2.0.5 and 1.5.6
(py26)[brianb#api proj]$ pip install python-daemon
Downloading/unpacking python-daemon
Downloading python-daemon-2.0.5.tar.gz (71Kb): 71Kb downloaded
Running setup.py egg_info for package python-daemon
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/brianb/py26/build/python-daemon/setup.py", line 26, in <module>
import version
File "version.py", line 438
for item in versions}
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/brianb/py26/build/python-daemon/setup.py", line 26, in <module>
import version
File "version.py", line 438
for item in versions}
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/brianb/.pip/pip.log
This is strange! I tried to upgrade virtualenv too, but this did not work out.
To get it running, I had to upgrade to Python 2.7.

running pip install from python 2.7.5

I have a CentOS server (5.6) which has Python 2.4.3 on it. I have another local installation of Python (2.7.5) installed in /opt and soft-links created as follows /usr/local/bin/python2.7 and /usr/local/python2.7. I want to install python-requests using pip. While installing using the command pip install requests, I get the following error:
root ~/ff_test_ff # pip install requests
Unpacking ./requests
Running setup.py egg_info for package from file:///root/ff_test_ff/requests
Traceback (most recent call last):
File "<string>", line 14, in ?
File "/tmp/pip-MM685m-build/setup.py", line 6, in ?
import requests
File "requests/__init__.py", line 58
from . import utils
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in ?
File "/tmp/pip-MM685m-build/setup.py", line 6, in ?
import requests
File "requests/__init__.py", line 58
from . import utils
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /root/.pip/pip.log
I'm assuming it's still trying to use Python 2.4. I checked here which says 2.4 isn't supported. So how do I run the pip install command but use python2.7 instead?
you need to set the PYTHONPATH / PYTHONHOME like here
you can also try to install virtualenv
You probably should (re)install a new version of pip explicitly for the new Python version. On pip installation instructions page it says that
pip works with CPython versions 2.6, 2.7, 3.1, 3.2, 3.3 and also pypy.
While installing, be sure to use the newer version of Python instead of the old one.

Categories

Resources