<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Module not found error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1327047#M68563</link>
    <description>&lt;LI-CODE lang="python"&gt;import arcpy
import utm
import pyproj

arcpy.env.workspace = r"C:\Users\Usuario\Desktop\DocsUSACH\SIG_TAREA1"
print('Bienvenido al convertidor de coordenadas GEO-UTM, donde podrá hacer conversiones de coordenadas Geográficas, con SIRGAS como Datúm, a coordenadas UTM con huso definido')
#Toma de Datos

formato= str(input('Por favor elija el tipo de coordenadas que quiere convertir, (G)eográficas o (U)TM:' ))

if formato== 'G':
    long= float(input('Introduzca la longtitud de su coordenada, en formato númerico (No grados) y con un punto (.) en vez de coma (,):' ))
    lat= float(input('Introduzca la latitud de su coordenada, en formato númerico (No grados) y con un punto (.) en vez de coma (,):' ))
    #Convertir coordenadas geográficas a UTM
    coordenadas_utm= utm.from_latlon(lat,long)
    
    #Extraer valores individuales
    este_UTM = coordenadas_utm[0]
    norte_UTM = coordenadas_utm[1]
    zona_UTM = coordenadas_utm[2]
    hemisferio_UTM = coordenadas_utm[3]

    #Mostrar las coordenadas UTM
    print('Este UTM(x):',este_UTM)
    print('Norte UTM(y):',norte_UTM)
    print('Zona UTM:',zona_UTM)
    print('Hemisferio UTM:',hemisferio_UTM)
    
    #Para ver la coordenada en el mapa
    project = arcpy.mp.ArcGISProject("CURRENT")
    coord=arcpy.Point(long,lat)
    coord_entrada = arcpy.SpatialReference(4326) #Código correspondiente a WGS84
    coord_geometry = arcpy.PointGeometry(coord, coord_entrada)
    mapa_activo=project.activeMap

    # Crear una capa temporal y agregar la geometría al mapa
    capa_temporal = mapa_activo.createLayer(None, coord_geometry, 'Coordenada_usuario')

    arcpy.RefresActiveView()
    
#Inicio Segunda opción
    
elif formato == 'U':
    #Recolección de Datos
    este_utm = float(input('Introduzca la coordenada EsteUTM:' ))
    norte_utm = float(input('Introduzca la coordenada NorteUTM:' ))
    zona_utm = int(input('Introduzca el Huso correspondiente a la CoordenadaUTM:' ))
    hemisferio_utm = str(input('Introduzca el Hemisferio correspondiente a la coordenada, ya sea (N)orte o (S)ur:' ))

    #Utilizar UTM para tener la coordenada completa
                                                                           
    zona_completa_utm = str(zona_utm) + hemisferio_utm
                                                                           
    #Crear objeto en librería pyproj para hacer la conversión
                                                                           
    utm_a_geográfica = pyproj.Proj(proj='utm', zone = zona_completa_utm, datum = 'WGS84')
                                                                           
    #Conversión
                                                                           
    long, lat= utm_a_geográfica(este_utm, norte_utm)

    print('Latitud resultante:' , lat)
    print('Longitud resultante:' , long)&lt;/LI-CODE&gt;&lt;P&gt;Thanks for your reply! Here's the script; I checked the folder of the enviroment and 'utm' it's there, but in a 'blank' format when the rest are a .exe file.&lt;/P&gt;&lt;P&gt;I look foward to your Reply, thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 09 Sep 2023 02:43:54 GMT</pubDate>
    <dc:creator>PabloParra</dc:creator>
    <dc:date>2023-09-09T02:43:54Z</dc:date>
    <item>
      <title>Module not found error</title>
      <link>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1326906#M68553</link>
      <description>&lt;P&gt;Hey! I'm parcially new in programing and currently I am making a script in Python for ArcGis Pro. This script has to convert coords from WGS84 to UTM, globally of course. For said cript I started using a library named 'utm' and until then didn't had any problem either with syntax nor the functions from python or arcgis. But when I went to run the script it showed me the error among the words of 'module 'utm' not found'. So I checked thee possible reasons for it and ended up modifying the Enviroment, Path, cheking the python installation and version and the library installation (via PIP) but no joy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone knows or had this same problem and solved it please let me know.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 17:58:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1326906#M68553</guid>
      <dc:creator>PabloParra</dc:creator>
      <dc:date>2023-09-08T17:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Module not found error</title>
      <link>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1326971#M68555</link>
      <description>&lt;P&gt;was 'utm' installed in the python environment that Pro uses?&lt;/P&gt;&lt;P&gt;check in the site-packages folder of your environment to see if it is installed there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also show your script in case it is a scripting error&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 19:40:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1326971#M68555</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-09-08T19:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Module not found error</title>
      <link>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1327047#M68563</link>
      <description>&lt;LI-CODE lang="python"&gt;import arcpy
import utm
import pyproj

arcpy.env.workspace = r"C:\Users\Usuario\Desktop\DocsUSACH\SIG_TAREA1"
print('Bienvenido al convertidor de coordenadas GEO-UTM, donde podrá hacer conversiones de coordenadas Geográficas, con SIRGAS como Datúm, a coordenadas UTM con huso definido')
#Toma de Datos

formato= str(input('Por favor elija el tipo de coordenadas que quiere convertir, (G)eográficas o (U)TM:' ))

if formato== 'G':
    long= float(input('Introduzca la longtitud de su coordenada, en formato númerico (No grados) y con un punto (.) en vez de coma (,):' ))
    lat= float(input('Introduzca la latitud de su coordenada, en formato númerico (No grados) y con un punto (.) en vez de coma (,):' ))
    #Convertir coordenadas geográficas a UTM
    coordenadas_utm= utm.from_latlon(lat,long)
    
    #Extraer valores individuales
    este_UTM = coordenadas_utm[0]
    norte_UTM = coordenadas_utm[1]
    zona_UTM = coordenadas_utm[2]
    hemisferio_UTM = coordenadas_utm[3]

    #Mostrar las coordenadas UTM
    print('Este UTM(x):',este_UTM)
    print('Norte UTM(y):',norte_UTM)
    print('Zona UTM:',zona_UTM)
    print('Hemisferio UTM:',hemisferio_UTM)
    
    #Para ver la coordenada en el mapa
    project = arcpy.mp.ArcGISProject("CURRENT")
    coord=arcpy.Point(long,lat)
    coord_entrada = arcpy.SpatialReference(4326) #Código correspondiente a WGS84
    coord_geometry = arcpy.PointGeometry(coord, coord_entrada)
    mapa_activo=project.activeMap

    # Crear una capa temporal y agregar la geometría al mapa
    capa_temporal = mapa_activo.createLayer(None, coord_geometry, 'Coordenada_usuario')

    arcpy.RefresActiveView()
    
#Inicio Segunda opción
    
elif formato == 'U':
    #Recolección de Datos
    este_utm = float(input('Introduzca la coordenada EsteUTM:' ))
    norte_utm = float(input('Introduzca la coordenada NorteUTM:' ))
    zona_utm = int(input('Introduzca el Huso correspondiente a la CoordenadaUTM:' ))
    hemisferio_utm = str(input('Introduzca el Hemisferio correspondiente a la coordenada, ya sea (N)orte o (S)ur:' ))

    #Utilizar UTM para tener la coordenada completa
                                                                           
    zona_completa_utm = str(zona_utm) + hemisferio_utm
                                                                           
    #Crear objeto en librería pyproj para hacer la conversión
                                                                           
    utm_a_geográfica = pyproj.Proj(proj='utm', zone = zona_completa_utm, datum = 'WGS84')
                                                                           
    #Conversión
                                                                           
    long, lat= utm_a_geográfica(este_utm, norte_utm)

    print('Latitud resultante:' , lat)
    print('Longitud resultante:' , long)&lt;/LI-CODE&gt;&lt;P&gt;Thanks for your reply! Here's the script; I checked the folder of the enviroment and 'utm' it's there, but in a 'blank' format when the rest are a .exe file.&lt;/P&gt;&lt;P&gt;I look foward to your Reply, thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2023 02:43:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1327047#M68563</guid>
      <dc:creator>PabloParra</dc:creator>
      <dc:date>2023-09-09T02:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Module not found error</title>
      <link>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1327065#M68564</link>
      <description>&lt;P&gt;A basic arcgis pro environment will be&amp;nbsp;&lt;/P&gt;&lt;P&gt;C:\...install folder ...\bin\Python\envs\arcgispro-py3&lt;/P&gt;&lt;P&gt;packages, like utm should be in&lt;/P&gt;&lt;P&gt;C:\...install folder ...\bin\Python\envs\arcgispro-py3\Lib\&lt;STRONG&gt;site-packages&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The python executable and where python will look for packages can be determined using the sys module&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sys

sys.executable
'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\python.exe'

sys.path
['C:\\arc_pro\\Resources\\ArcPy',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\python39.zip',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\DLLs',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\lib',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc',
 '',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\lib\\site-packages',
 'C:\\arc_pro\\bin',
 'C:\\arc_pro\\Resources\\ArcToolbox\\Scripts',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\lib\\site-packages\\win32',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\lib\\site-packages\\win32\\lib',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\lib\\site-packages\\Pythonwin',
 'C:\\arc_pro\\bin\\Python\\envs\\spyarc\\lib\\site-packages\\pywin32security',
 'C:\\arcpro_npg\\npg',
 'C:\\arcpro_npg']&lt;/LI-CODE&gt;&lt;P&gt;In the above example the last two lines are paths I have added for extra packages, .... you can add to the path, as I did, or install your package in the listed site-packages folder in your environment.&amp;nbsp; In my case Pro is installed in the c:\\arc_pro folder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2023 08:51:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/module-not-found-error/m-p/1327065#M68564</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-09-09T08:51:15Z</dc:date>
    </item>
  </channel>
</rss>

