Software > Software de Meteoclimatic

Orange Pi y meteoclimatic.py

<< < (2/8) > >>

Telares:
¿Puede que tenga que ver con el formato de fecha, locale...?:

root@Matueca:~# python3 /home/pi/meteoclimatic/meteoclimatic.py
Traceback (most recent call last):
  File "/home/pi/meteoclimatic/meteoclimatic.py", line 189, in <module>
    fechaformat = time.mktime(time.strptime(fecha, '%d-%m-' + anho + ' %H:%M'))
  File "/usr/lib/python3.10/_strptime.py", line 562, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "/usr/lib/python3.10/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '10-27-2022 07:11' does not match format '%d-%m-%Y %H:%M'

jmviper:
Ok por partes

No tienes /usr/bin/python el cual es la ruta al ejecutable de python. Esa línea es con la que se llama a python al inicio del archivo meteoclimatic.py

Puedes hacer dos cosas. Editar meteoclimatic.py y poner la línea al inicio de #!/usr/bin/python como #!/usr/bin/python3 para que apunte a python versión 3 o crear un enlace simbólico a /usr/bin/python3

cd /usr/bin
ln -s python3 python

Ejecutando esos dos comandos se creará ese enlace simbólico con el que escribir python apuntará a python3 que es el que verdaderamente ejecuta.

En cuanto a lo de la fecha sí, es por el formato del locale. Pon el locale en español:

dpkg-reconfigure locales

Seleccionando el español es_ES.UTF-8 y poniéndolo como defecto en el sistema.

Lo podrás ver ejecutando el comando locale en el terminal.



Telares:
Hecho lo del .py
En cuanto al locale en la raspi siempre he tenido en_GB.UTF-8 UTF-8
En armbian-config, al contrario que en raspi-config no queda marcado con asterisco el locale elegido : también en_GB.UTF-8 UTF-8 y al ejecutar locale:

root@Matueca:~# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

y sigue sin ejecutarse el .py

jmviper:
Pon resultado de ejecutar

ls -l /usr/bin/python*

En cuanto a los locales selecciona el locale español con la barra espaciadora. Debería de generarse y en la opción correspondiente ponerlo por defecto.



Telares:
root@Matueca:~# ls -l /usr/bin/python*
lrwxrwxrwx 1 root root      10 Aug 11 12:57 /usr/bin/python3 -> python3.10
-rwxr-xr-x 1 root root     963 Apr 23  2022 /usr/bin/python3-commonmark
-rwxr-xr-x 1 root root 4067736 Oct 24 10:07 /usr/bin/python3.10

Navegación

[0] Índice de Mensajes

[#] Página Siguiente

[*] Página Anterior

Ir a la versión completa