Closed AninditaBhowmik closed 7 years ago
Hi,
I am trying to import geotext using Anaconda for a long time. Could you please help me with that? I have been following the link below: http://stackoverflow.com/questions/39996997/cannot-import-name-geotext-from-the-geotext-python-package It would be great if you could help me how I need to install that.
Thanks.
You guys are both using Python 3 right? I was having the same issue. My temporary workaround was to move the contents of geotext.py into the init file, change the file reading from 'rb' to 'r', remove the .decode(encoding), and enclose the print statements. Works as a quick solution but definitely not worthy of a pull request to this repo. @elyase would you be ok with me submitting a pull at some point to try and make this lib both 2 and 3 compatible? Really like the functionality of this module
Hi guys, sorry that I haven't been following the issues. I thought I was the only one using the library. Promise to take a look in January. @cdpeuter a PR would be very welcome!
Hey @elyase I like geotext's functionality. Used it for my project :smile: It works how I expected it to be. I had some problem with importing it with python3 as others mentioned above. I fixed it and now it works with python3. I pulled a request, is it ok? :+1:
Hi Joel, I will take a look when I come back from holidays. Right now my internet is somewhat limited. Thanks a lot!
I merged @freezer9 pull request that adds Python 3 support. I have tested it with conda 2 and 3 environments and it seems to work well. Please upgrade with:
pip install geotext -U
Hi,
I have texts extracted from certain contexts of files like:
'. Education : 05/2012 DePaul University Graduate School Master of Science in E-Commerce Technology Morgan in E-Commerce Technology Morgan State University 05/88 BS in Computer Science Technical Training or Certifications '
'Information Technology Southern New Hampshire University Expected 2015 Associate of Arts , Graphic Design Penn'
These contain the name of some university along with some city names like 'Morgan city' in the first sentence and 'New Hampshire' in the second sentence. I am using the code mentioned below to extract the city names from the text using the 'geotext' python library:
I had used
pip install geotext
for the installation on Python 3 Anaconda 3.0 in Windows 7. The output I am getting is ['University'] and ['University', 'University']. These are clearly not city names.I would like to mention that the post installation I have had some 'expecting bytes not strings' errors and 'cannot find name GeoText' errors which I corrected manually.
I changed the import statement in init.py to contain geotext instead of GeoText and I changed the string to string.encode() for the byte array errors.