I am trying to install pydoop via following command
pip3.4 install pydoop
The installation is interrupted with following error
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-jwy57_9u/pydoop/setup.py", line 41
print 'using setuptools version', setuptools.__version__
^
SyntaxError: Missing parentheses in call to 'print'
I think the error has to do with mismatch in python version as there should be parantheses in call to 'print' in python3.
I am able to install other packages using pip3.4 install
The docs clearly state that Pydoop requires Python 2.7 (or 2.6) as a pre-requisite. As far as I know, there is no current support for Python 3 provided by Pydoop. In short, you need to switch to Python 2.7 (or 2.6).
As sgp mentioned, pydoop is only supported by Python 2. I suggest to preview the slides here and particularly
where comparison to Python and Java for Hadoop. Because Hadoop is natively written in Java, the Python community on hadoop is far smaller.
where the native implementation in Java outperforms the other ones.
Other options contain
use Java with Hadoop
or other libraries such as Hadoopy, mrjob and dumbo: Hadoopy not mentioning Python version explicitly on its 2-4 years old-dated repos in github, mrjob supports Python 3 as well by this and dumbo's websites are down from github here.
octopy
Related
After installing Anaconda with python3 under C (Path: C:\Anaconda)and setting the path to the environmental variables in windows 10 system, I try to install "pyspec" module to Anaconda in command lines. It turns out to the following messages:
C:\Users\Timothy>pip install pyspec
Collecting pyspec
Using cached https://files.pythonhosted.org/packages/f0/36/fdcd349f2873a5ebd16b7ba2ed4c869a7474e1a77c2f1b6371ff2cfe0ee3/pyspec-0.2-r213.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\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\setup.py", line 15, in <module>
from ez_setup import use_setuptools
File "C:\Users\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\ez_setup.py", line 106
except pkg_resources.VersionConflict, e:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\
And I have no idea what happened. Could anybody help me to fix it?
One of the files in pyspec, namely the file ez-setup.py, has the line
except pkg_resources.VersionConflict, e:
Unfortunately, that syntax is acceptable in Python 2 but not in Python 3. The Python 3 syntax is
except pkg_resources.VersionConflict as e:
This shows that pyspec was written for Python version 2 and will not work with Python version 3. Its PyPI page shows that the package has not been updated since July 21, 2011. Most worrying, there are no versions of Python listed for the package. That means it was indeed written for Python 2 and has not been updated to Python 3.
Your best bet is to use another package. Using such an old, outdated package is not wise. If you really want to try, you could use 2to3 or something similar to attempt to convert pyspec to Python 3. But that would probably be a nightmare.
You could try to contact the authors, Stuart B. Wilkins and Certified Scientific Software, for updated code. (Contact info is in that PyPI page).
I am currently working on a mongo db assignment using pymongo, as part of it we need to install python bottle framework. I have installed bottle on the Mac using the below command:
$ pip install bottle
got the below message returned.
Requirement already satisfied: bottle in /Library/Python/2.7/site-packages
when I run a program from terminal which uses bottle, it throws the below error:
$ python hello_m101p.py
Traceback (most recent call last):
File "hello_m101p.py", line 2, in <module>
import bottle
ModuleNotFoundError: No module named 'bottle'
I noted that i also have python 3.6.4 version installed on my system. I need bottle framework to be saved or installed for this version instead of the default 2.7 version. After a quick lookup around stack overflow, I tried the below command from one the suggested answers. I get the command not found error:
sudo pip-3.6.4 install bottle
sudo: pip-3.6.4: command not found
Any help to correct this error ? I am not sure how to address this. Please let me know if the question is unclear or need more context.
The default name for pip for Python version X.Y.Z is not pip-X.Y.Z, but pipX.Y. Some linux distros use different names for their versions, but I believe on Mac, both the python.org Python installer and the Homebrew python package (and you probably have one of those two) use the default names, at least as of 2018.
If you only have one 3.Y.Z, it will probably also be available as pip3, which is convenient.
If you've got different names and are hopelessly confused, but you do know how to run your Python 3 itself, you can always use the -m flag to run pip.
Also, most Mac Python installs don't need sudo. If you don't know whether you do, try it without first. If you get a bunch of permissions errors, then you do need sudo after all, but otherwise, don't use it.
So, what you want is probably any of these:
pip3.6 install bottle
pip3 install bottle
python3 -m pip install bottle
I need to extract IPTC metadata from images. Most of the things I've read about Python packages on Windows suggest using pre-compiled binaries, but I don't see one for IPTCInfo, thus I tried pip3.
I'm getting an error from pip when trying to install this:
C:\Users\hackr>pip3 install IPTCInfo
Collecting IPTCInfo
Downloading IPTCInfo-1.9.5-6.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\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo\setup.py", line 32
print self.get_archive_files()
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo
So, I tried to open that last temporary file it refrences, but it doesn't appear to exist...
I have the same problem. Appears the IPTCinfo is for python-2. I will upgrade IPTCinfo for python-3.
However I have found the library exvi2 which provides the same type of image support. There is a python interface for this at https://wiki.gnome.org/Projects/gexiv2
I maintain IPTCInfo3 in Pypi. I recommend downloading it via pip3 install iptcinfo3 as it is specifically upgraded for Python3x. Follow the readme and issue comments for examples. Enjoy.
I've looked at quite a lot of related questions here - no help for me. I need to repair easy_install, so that I can update distribute to a version >=0.6.28, so that I can update python matplotlib using pip and not yum.
In the process of trying to update python matplotlib from 0.99 (the default with Centos64) to 1.4.x, I got into this trouble:
pip install --upgrade matplotlib tells me this:
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.10 (/usr/lib/python2.6/site-packages))
So I followed the suggestion and saw that some 0.7.x version of distribute was installed (so it seemed). Re-ran the pip command and got the exact same complaint.
Trouble with easy_install?
It was either now, or maybe after performing yum remove, then install python-setuptools that I discovered easy_install is thoroughly broken. Now when I try to run easy_install, I get this stacktrace:
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 9, in <module>
load_entry_point('distribute', 'console_scripts', 'easy_install')()
File "/usr/local/lib/python3.3/site-packages/setuptools-18.2-py3.3.egg/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.3/site-packages/setuptools-18.2-py3.3.egg/pkg_resources/__init__.py", line 2681, in load_entry_point
raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found
Look at that - why is it referring to python3.3? I don't think I've got that installed. My default python is 2.6.6.
Any ideas? TIA.
Fixed it. The python3.3 bit was my clue. I found the python script for easy_install, in /usr/local/bin. The very first line designated /usr/bin/python3.3 to execute the script. Changed to 2.6 and then was good to go.
In the end I was not able to upgrade matplotlib from 0.99 to 1.4.3, because I could not upgrade basemap from 0.99 and some conflicts arose. Rather than punish myself with trying to build from source, I think I should simply upgrade my entire VM to Centos7 and I will then have much newer matplotlib.
I am trying to install a module on python 3.2 but am unable to. I am using Windows 7. I need to have the module installed only on Python 3.2, so solutions that work for other versions of Python won't be helpful to me (I had no problem installing modules in Python 2.7 or 3.3, 3,4) I got rid of all my other versions of python, because I thought that might be the problem.
I have tried both using pip install, and to manually install the package and neither works. At first glance it looks like I am installing setuptools and pip correctly. Here is the output I get when I try to install pip
Installed c:\python32\lib\site-packages\setuptools-7.0-py3.2.egg
Processing dependencies for setuptools==7.0
Finished processing dependencies for setuptools==7.0
PS C:\> python32 .\get-pip.py
Requirement already up-to-date: pip in c:\python32\lib\site-packages
Cleaning up...
PS C:\> pip install geopy
It looks fine, right?
Then when I try to use by entering pip install geopy Here is the output I get
pip: the termpipis not recognized as the name of a cmdlet, function or operable program etc. I made sure that python 3.2 was specified in the path environments, and uninstalled all other versions of pythons. I don't know what else I can do?
I also tried to manually install geopy. I went to the geopy page on github and pressed on "Download ZIP". I then extracted the folder to lib/site-packages directory in python32. When I tried to install using the setup.py (python32 setup.py install) Here is the error message that I got. I am not sure what this error message means
Traceback (most recent call last):
File "setup.py", line 6, in <module>
from geopy import __version__ as version
File "C:\python32\lib\site-packages\geopy-master\geopy\__init__.py", line 10, in <module>
from geopy.location import Location
File "C:\python32\lib\site-packages\geopy-master\geopy\location.py", line 21
def __init__(self, address=u"", point=None, raw=None):
Update: GeoPy 1.6.0 introduced support for Python 3.2, so update it and it should install and work.
Old answer:
This is a bug with geopy, and/or it doesn't support Python 3.2. With this Python release, strings cannot be in the form u"the string", since it is a SyntaxError. This was fixed with PEP-414 for Python 3.3.
While you can install the package, a quick fix for geopy is to edit the installed files to remove the u in several module files, such as "C:\python32\lib\site-packages\geopy-master\geopy\location.py" (as shown in your question).
For example:
Change address=u"" to address=""
Change signature_method=u"HMAC-SHA1" to signature_method="HMAC-SHA1"
Also watch out for single quote changes, e.g. u'the string'
etc.