0

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):

Mike T
  • 41,085
  • 18
  • 152
  • 203
Ravi Mehta
  • 485
  • 1
  • 6
  • 15

1 Answers1

0

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.

Mike T
  • 41,085
  • 18
  • 152
  • 203