Posts

Showing posts with the label urllib2

How to run pykml in python3

First, you need to install pykml for python3: sudo pip3 install pykml Now, if you try to read a kml file you will get the following message: Python 3.6.3 (default, Oct  3 2017, 21:45:48)  [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pykml import parser Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "/usr/local/lib/python3.6/dist-packages/pykml/parser.py", line 8, in <module>     import urllib2 ModuleNotFoundError: No module named 'urllib2' To solve it, you need to fix urllib2 to work well in python3 If you try to install it with pip3 you will get:                                                               Collecting urllib2   Could not find a version that satisfi...