1

I am using Python3.6.5 and installed with simplekml module 1.3.3, But there is an error message when I running the code below; Error msg>>"kml = simplekml.Kml() AttributeError: module 'simplekml' has no attribute 'Kml'"

I am using sample code from https://pypi.org/project/simplekml/

import simplekml
#from simplekml import Kml  # this line of code not working either.
kml = simplekml.Kml()
kml.newpoint(name="Kirstenbosch", coords=[(18.432314,-33.988862)])
kml.save("botanicalgarden.kml")
Issac_n
  • 89
  • 1
  • 2
  • 13
  • I just installed simplekml and I dont get the error you did. Maybe try uninstall and reinstall simplekml – jtweeder Feb 16 '20 at 16:42
  • Try `from simplekml import *` and if you use `from simplekml import Kml` you must use this code `kml = Kml() # Not simplekml.Kml()`. And if both are not working, look like something wrong here. – ChickenMinh Feb 16 '20 at 16:45
  • Notice one file created call **simplekml.cpython-36.pyc** in **__pycache__** folder. when right click open **simplekml.cpython-36.pyc** then the kml generated. – Issac_n Feb 16 '20 at 17:08
  • found a solution, just put the **.py** in less sub level, then problem solved. My previous error only occurs in 5th sub folder. – Issac_n Feb 17 '20 at 06:05

0 Answers0