All of lore.kernel.org
 help / color / mirror / Atom feed
* Export python packages installed using pypi to target
@ 2024-03-21  7:29 Ashu Joshi
  2024-03-21  7:56 ` [yocto] " Alexander Kanavin
  0 siblings, 1 reply; 15+ messages in thread
From: Ashu Joshi @ 2024-03-21  7:29 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]

Hello,
I am trying to install wirpas_gateway package from pypi using yocto recipe.. Once service is build completely and  I flash image to target, i don't see any of the installed packages. Does anyone has nay reference how to install these packages in target as well. I dont see any generated binary which i can ship tp target. However, source code of the package can be seen in work directory. Currently I am trying to do something like below:

do_install() {
install -m 0755 -d ${D}${sysconfdir}/systemd/system
install -m 0755 ${WORKDIR}/wirepasTransport.service ${D}${sysconfdir}/systemd/system

install -m 0755 -d ${D}/usr/share
install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share

install -m 0755 -d ${D}/usr/share/wirepas_gateway
install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3 ${D}/usr/share/wirepas_gateway
}

FILES_${PN} += "usr/share/wirepas_gateway"
FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
FILES_${PN} += "/usr/share/settings.yml"

wirepas_gateway-1.4.3 is directory which contains setup and other files. Getting error while trying to ship this to target.

[-- Attachment #2: Type: text/html, Size: 78714 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-21  7:29 Export python packages installed using pypi to target Ashu Joshi
@ 2024-03-21  7:56 ` Alexander Kanavin
  2024-03-21  9:43   ` Ashu Joshi
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Kanavin @ 2024-03-21  7:56 UTC (permalink / raw)
  To: ashujoshi35, yocto


[-- Attachment #1.1: Type: text/plain, Size: 1910 bytes --]

Please share your complete recipe and all of the error message, otherwise
it’s impossible to tell what is happening.

Alex

On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com> wrote:

> Hello,
> I am trying to install wirpas_gateway package from pypi using yocto
> recipe.. Once service is build completely and  I flash image to target, i
> don't see any of the installed packages. Does anyone has nay reference how
> to install these packages in target as well. I dont see any generated
> binary which i can ship tp target. However, source code of the package can
> be seen in work directory. Currently I am trying to do something like below:
>
> do_install() {
>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>       install -m 0755 ${WORKDIR}/wirepasTransport.service
> ${D}${sysconfdir}/systemd/system
>
>       install -m 0755 -d ${D}/usr/share
>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>
>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
> ${D}/usr/share/wirepas_gateway
> }
>
> FILES_${PN} += "usr/share/wirepas_gateway"
> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
> FILES_${PN} += "/usr/share/settings.yml"
>
> wirepas_gateway-1.4.3 is directory which contains setup and other files.
> Getting error while trying to ship this to target.
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#62809):
> https://lists.yoctoproject.org/g/yocto/message/62809
> Mute This Topic: https://lists.yoctoproject.org/mt/105061124/1686489
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #1.2: Type: text/html, Size: 3041 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-21  7:56 ` [yocto] " Alexander Kanavin
@ 2024-03-21  9:43   ` Ashu Joshi
  2024-03-21 13:36     ` Ashu Joshi
  0 siblings, 1 reply; 15+ messages in thread
From: Ashu Joshi @ 2024-03-21  9:43 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 3778 bytes --]

Entire recipe is:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
DESCRIPTION = "Wirepas gateway transport service that connects the local
dbus to a remote MQTT broker"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"

SRC_URI = "file://wirepasTransport.service \
           file://settings.yml \
"

PYPI_PACKAGE = "wirepas_gateway"
PV = "1.4.3"
inherit pypi pkgconfig setuptools3

SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"

DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"

SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"

do_install() {
      install -m 0755 -d ${D}${sysconfdir}/systemd/system
      install -m 0755 ${WORKDIR}/wirepasTransport.service
${D}${sysconfdir}/systemd/system

      install -m 0755 -d ${D}/usr/share
      install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share

#      install -m 0755 -d ${D}/usr/share/wirepas_gateway
#      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
${D}/usr/share/wirepas_gateway
}

FILES_${PN} += "usr/share/wirepas_gateway"
#FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
FILES_${PN} += "/usr/share/settings.yml"

Error was basically because of commented code wherein I was trying to
export the entire directory. I have commented out that for now.. I found
that by creating rpm or opkg package we can export the package to target.
Need help around that, if that is the correct way and how to use this
method in yocto recipe. If not, what can be the other way using which we
can ship or install the package in target.

On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> Please share your complete recipe and all of the error message, otherwise
> it’s impossible to tell what is happening.
>
> Alex
>
> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>
>> Hello,
>> I am trying to install wirpas_gateway package from pypi using yocto
>> recipe.. Once service is build completely and  I flash image to target, i
>> don't see any of the installed packages. Does anyone has nay reference how
>> to install these packages in target as well. I dont see any generated
>> binary which i can ship tp target. However, source code of the package can
>> be seen in work directory. Currently I am trying to do something like below:
>>
>> do_install() {
>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>> ${D}${sysconfdir}/systemd/system
>>
>>       install -m 0755 -d ${D}/usr/share
>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>
>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>> ${D}/usr/share/wirepas_gateway
>> }
>>
>> FILES_${PN} += "usr/share/wirepas_gateway"
>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>> FILES_${PN} += "/usr/share/settings.yml"
>>
>> wirepas_gateway-1.4.3 is directory which contains setup and other files.
>> Getting error while trying to ship this to target.
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#62809):
>> https://lists.yoctoproject.org/g/yocto/message/62809
>> Mute This Topic: https://lists.yoctoproject.org/mt/105061124/1686489
>> Group Owner: yocto+owner@lists.yoctoproject.org
>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>> alex.kanavin@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>>

[-- Attachment #1.2: Type: text/html, Size: 5414 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-21  9:43   ` Ashu Joshi
@ 2024-03-21 13:36     ` Ashu Joshi
  2024-03-21 14:23       ` Alexander Kanavin
  0 siblings, 1 reply; 15+ messages in thread
From: Ashu Joshi @ 2024-03-21 13:36 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 5050 bytes --]

It seems I have been able to install the package in gateway but getting
some encoding related error. Below is the error:

~ $ wm-gw --help
Python path configuration:
  PYTHONHOME = '/'
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3'
  sys.base_prefix = '/'
  sys.base_exec_prefix = '/'
  sys.executable = '/usr/bin/python3'
  sys.prefix = '/'
  sys.exec_prefix = '/'
  sys.path = [
    'lib/python38.zip',
    '/lib/python3.8',
    '/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the
file
                                      system encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below in the
recipe file but still encountering the same error. Any idea how to fix this?

do_configure(){
    unset PYTHONPATH
    unset PYTHONHOME
}


On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com> wrote:

> Entire recipe is:
>
> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> DESCRIPTION = "Wirepas gateway transport service that connects the local
> dbus to a remote MQTT broker"
> LICENSE = "Apache-2.0"
> LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>
> SRC_URI = "file://wirepasTransport.service \
>            file://settings.yml \
> "
>
> PYPI_PACKAGE = "wirepas_gateway"
> PV = "1.4.3"
> inherit pypi pkgconfig setuptools3
>
> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>
> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>
> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>
> do_install() {
>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>       install -m 0755 ${WORKDIR}/wirepasTransport.service
> ${D}${sysconfdir}/systemd/system
>
>       install -m 0755 -d ${D}/usr/share
>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>
> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
> ${D}/usr/share/wirepas_gateway
> }
>
> FILES_${PN} += "usr/share/wirepas_gateway"
> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
> FILES_${PN} += "/usr/share/settings.yml"
>
> Error was basically because of commented code wherein I was trying to
> export the entire directory. I have commented out that for now.. I found
> that by creating rpm or opkg package we can export the package to target.
> Need help around that, if that is the correct way and how to use this
> method in yocto recipe. If not, what can be the other way using which we
> can ship or install the package in target.
>
> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
>
>> Please share your complete recipe and all of the error message, otherwise
>> it’s impossible to tell what is happening.
>>
>> Alex
>>
>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>
>>> Hello,
>>> I am trying to install wirpas_gateway package from pypi using yocto
>>> recipe.. Once service is build completely and  I flash image to target, i
>>> don't see any of the installed packages. Does anyone has nay reference how
>>> to install these packages in target as well. I dont see any generated
>>> binary which i can ship tp target. However, source code of the package can
>>> be seen in work directory. Currently I am trying to do something like below:
>>>
>>> do_install() {
>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>> ${D}${sysconfdir}/systemd/system
>>>
>>>       install -m 0755 -d ${D}/usr/share
>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>
>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>> ${D}/usr/share/wirepas_gateway
>>> }
>>>
>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>>> FILES_${PN} += "/usr/share/settings.yml"
>>>
>>> wirepas_gateway-1.4.3 is directory which contains setup and other files.
>>> Getting error while trying to ship this to target.
>>>
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>> Links: You receive all messages sent to this group.
>>> View/Reply Online (#62809):
>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>> Mute This Topic: https://lists.yoctoproject.org/mt/105061124/1686489
>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>> alex.kanavin@gmail.com]
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>
>>>

[-- Attachment #1.2: Type: text/html, Size: 7252 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-21 13:36     ` Ashu Joshi
@ 2024-03-21 14:23       ` Alexander Kanavin
  2024-03-22  6:00         ` Ashu Joshi
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Kanavin @ 2024-03-21 14:23 UTC (permalink / raw)
  To: Ashu Joshi; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 5603 bytes --]

It's a little odd that the application is looking for python modules in
/lib and not /usr/lib.

If you run python3 on the target and issue 'import encodings', does that
work? Then they are installed in /usr/lib, and you need to find out why the
app redirects python to look elsewhere.

Alex

On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com> wrote:

> It seems I have been able to install the package in gateway but getting
> some encoding related error. Below is the error:
>
> ~ $ wm-gw --help
> Python path configuration:
>   PYTHONHOME = '/'
>   PYTHONPATH = (not set)
>   program name = 'python3'
>   isolated = 0
>   environment = 1
>   user site = 1
>   import site = 1
>   sys._base_executable = '/usr/bin/python3'
>   sys.base_prefix = '/'
>   sys.base_exec_prefix = '/'
>   sys.executable = '/usr/bin/python3'
>   sys.prefix = '/'
>   sys.exec_prefix = '/'
>   sys.path = [
>     'lib/python38.zip',
>     '/lib/python3.8',
>     '/lib/python3.8/lib-dynload',
>   ]
> Fatal Python error: init_fs_encoding: failed to get the Python codec of
> the file
>                                           system encoding
> Python runtime state: core initialized
> ModuleNotFoundError: No module named 'encodings'
>
> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below in the
> recipe file but still encountering the same error. Any idea how to fix this?
>
> do_configure(){
>     unset PYTHONPATH
>     unset PYTHONHOME
> }
>
>
> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com> wrote:
>
>> Entire recipe is:
>>
>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>> DESCRIPTION = "Wirepas gateway transport service that connects the local
>> dbus to a remote MQTT broker"
>> LICENSE = "Apache-2.0"
>> LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>
>> SRC_URI = "file://wirepasTransport.service \
>>            file://settings.yml \
>> "
>>
>> PYPI_PACKAGE = "wirepas_gateway"
>> PV = "1.4.3"
>> inherit pypi pkgconfig setuptools3
>>
>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>
>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>
>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>
>> do_install() {
>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>> ${D}${sysconfdir}/systemd/system
>>
>>       install -m 0755 -d ${D}/usr/share
>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>
>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>> ${D}/usr/share/wirepas_gateway
>> }
>>
>> FILES_${PN} += "usr/share/wirepas_gateway"
>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>> FILES_${PN} += "/usr/share/settings.yml"
>>
>> Error was basically because of commented code wherein I was trying to
>> export the entire directory. I have commented out that for now.. I found
>> that by creating rpm or opkg package we can export the package to target.
>> Need help around that, if that is the correct way and how to use this
>> method in yocto recipe. If not, what can be the other way using which we
>> can ship or install the package in target.
>>
>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <alex.kanavin@gmail.com>
>> wrote:
>>
>>> Please share your complete recipe and all of the error message,
>>> otherwise it’s impossible to tell what is happening.
>>>
>>> Alex
>>>
>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>
>>>> Hello,
>>>> I am trying to install wirpas_gateway package from pypi using yocto
>>>> recipe.. Once service is build completely and  I flash image to target, i
>>>> don't see any of the installed packages. Does anyone has nay reference how
>>>> to install these packages in target as well. I dont see any generated
>>>> binary which i can ship tp target. However, source code of the package can
>>>> be seen in work directory. Currently I am trying to do something like below:
>>>>
>>>> do_install() {
>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>> ${D}${sysconfdir}/systemd/system
>>>>
>>>>       install -m 0755 -d ${D}/usr/share
>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>
>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>> ${D}/usr/share/wirepas_gateway
>>>> }
>>>>
>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>
>>>> wirepas_gateway-1.4.3 is directory which contains setup and other
>>>> files. Getting error while trying to ship this to target.
>>>>
>>>>
>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>> Links: You receive all messages sent to this group.
>>>> View/Reply Online (#62809):
>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>> Mute This Topic: https://lists.yoctoproject.org/mt/105061124/1686489
>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>> alex.kanavin@gmail.com]
>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>
>>>>

[-- Attachment #1.2: Type: text/html, Size: 7973 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-21 14:23       ` Alexander Kanavin
@ 2024-03-22  6:00         ` Ashu Joshi
  2024-03-22  6:17           ` Alexander Kanavin
  0 siblings, 1 reply; 15+ messages in thread
From: Ashu Joshi @ 2024-03-22  6:00 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 5944 bytes --]

It doesn't allow me to run import encodings as it is giving another error
import:not found

On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> It's a little odd that the application is looking for python modules in
> /lib and not /usr/lib.
>
> If you run python3 on the target and issue 'import encodings', does that
> work? Then they are installed in /usr/lib, and you need to find out why the
> app redirects python to look elsewhere.
>
> Alex
>
> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>
>> It seems I have been able to install the package in gateway but getting
>> some encoding related error. Below is the error:
>>
>> ~ $ wm-gw --help
>> Python path configuration:
>>   PYTHONHOME = '/'
>>   PYTHONPATH = (not set)
>>   program name = 'python3'
>>   isolated = 0
>>   environment = 1
>>   user site = 1
>>   import site = 1
>>   sys._base_executable = '/usr/bin/python3'
>>   sys.base_prefix = '/'
>>   sys.base_exec_prefix = '/'
>>   sys.executable = '/usr/bin/python3'
>>   sys.prefix = '/'
>>   sys.exec_prefix = '/'
>>   sys.path = [
>>     'lib/python38.zip',
>>     '/lib/python3.8',
>>     '/lib/python3.8/lib-dynload',
>>   ]
>> Fatal Python error: init_fs_encoding: failed to get the Python codec of
>> the file
>>                                           system encoding
>> Python runtime state: core initialized
>> ModuleNotFoundError: No module named 'encodings'
>>
>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below in the
>> recipe file but still encountering the same error. Any idea how to fix this?
>>
>> do_configure(){
>>     unset PYTHONPATH
>>     unset PYTHONHOME
>> }
>>
>>
>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>
>>> Entire recipe is:
>>>
>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>> DESCRIPTION = "Wirepas gateway transport service that connects the local
>>> dbus to a remote MQTT broker"
>>> LICENSE = "Apache-2.0"
>>> LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>
>>> SRC_URI = "file://wirepasTransport.service \
>>>            file://settings.yml \
>>> "
>>>
>>> PYPI_PACKAGE = "wirepas_gateway"
>>> PV = "1.4.3"
>>> inherit pypi pkgconfig setuptools3
>>>
>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>
>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>
>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>
>>> do_install() {
>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>> ${D}${sysconfdir}/systemd/system
>>>
>>>       install -m 0755 -d ${D}/usr/share
>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>
>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>> ${D}/usr/share/wirepas_gateway
>>> }
>>>
>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>>> FILES_${PN} += "/usr/share/settings.yml"
>>>
>>> Error was basically because of commented code wherein I was trying to
>>> export the entire directory. I have commented out that for now.. I found
>>> that by creating rpm or opkg package we can export the package to target.
>>> Need help around that, if that is the correct way and how to use this
>>> method in yocto recipe. If not, what can be the other way using which we
>>> can ship or install the package in target.
>>>
>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>> alex.kanavin@gmail.com> wrote:
>>>
>>>> Please share your complete recipe and all of the error message,
>>>> otherwise it’s impossible to tell what is happening.
>>>>
>>>> Alex
>>>>
>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>>
>>>>> Hello,
>>>>> I am trying to install wirpas_gateway package from pypi using yocto
>>>>> recipe.. Once service is build completely and  I flash image to target, i
>>>>> don't see any of the installed packages. Does anyone has nay reference how
>>>>> to install these packages in target as well. I dont see any generated
>>>>> binary which i can ship tp target. However, source code of the package can
>>>>> be seen in work directory. Currently I am trying to do something like below:
>>>>>
>>>>> do_install() {
>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>> ${D}${sysconfdir}/systemd/system
>>>>>
>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>
>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>> ${D}/usr/share/wirepas_gateway
>>>>> }
>>>>>
>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>
>>>>> wirepas_gateway-1.4.3 is directory which contains setup and other
>>>>> files. Getting error while trying to ship this to target.
>>>>>
>>>>>
>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>> Links: You receive all messages sent to this group.
>>>>> View/Reply Online (#62809):
>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>> Mute This Topic: https://lists.yoctoproject.org/mt/105061124/1686489
>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>> alex.kanavin@gmail.com]
>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>
>>>>>

[-- Attachment #1.2: Type: text/html, Size: 8456 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-22  6:00         ` Ashu Joshi
@ 2024-03-22  6:17           ` Alexander Kanavin
  2024-03-22  7:38             ` Ashu Joshi
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Kanavin @ 2024-03-22  6:17 UTC (permalink / raw)
  To: Ashu Joshi; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 6275 bytes --]

You need to first start python3 and run it there, not directly from the
shell.

Alex

On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com> wrote:

> It doesn't allow me to run import encodings as it is giving another error
> import:not found
>
> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
>
>> It's a little odd that the application is looking for python modules in
>> /lib and not /usr/lib.
>>
>> If you run python3 on the target and issue 'import encodings', does that
>> work? Then they are installed in /usr/lib, and you need to find out why the
>> app redirects python to look elsewhere.
>>
>> Alex
>>
>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>
>>> It seems I have been able to install the package in gateway but getting
>>> some encoding related error. Below is the error:
>>>
>>> ~ $ wm-gw --help
>>> Python path configuration:
>>>   PYTHONHOME = '/'
>>>   PYTHONPATH = (not set)
>>>   program name = 'python3'
>>>   isolated = 0
>>>   environment = 1
>>>   user site = 1
>>>   import site = 1
>>>   sys._base_executable = '/usr/bin/python3'
>>>   sys.base_prefix = '/'
>>>   sys.base_exec_prefix = '/'
>>>   sys.executable = '/usr/bin/python3'
>>>   sys.prefix = '/'
>>>   sys.exec_prefix = '/'
>>>   sys.path = [
>>>     'lib/python38.zip',
>>>     '/lib/python3.8',
>>>     '/lib/python3.8/lib-dynload',
>>>   ]
>>> Fatal Python error: init_fs_encoding: failed to get the Python codec of
>>> the file
>>>                                           system encoding
>>> Python runtime state: core initialized
>>> ModuleNotFoundError: No module named 'encodings'
>>>
>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below in the
>>> recipe file but still encountering the same error. Any idea how to fix this?
>>>
>>> do_configure(){
>>>     unset PYTHONPATH
>>>     unset PYTHONHOME
>>> }
>>>
>>>
>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com>
>>> wrote:
>>>
>>>> Entire recipe is:
>>>>
>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>> DESCRIPTION = "Wirepas gateway transport service that connects the
>>>> local dbus to a remote MQTT broker"
>>>> LICENSE = "Apache-2.0"
>>>> LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>
>>>> SRC_URI = "file://wirepasTransport.service \
>>>>            file://settings.yml \
>>>> "
>>>>
>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>> PV = "1.4.3"
>>>> inherit pypi pkgconfig setuptools3
>>>>
>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>
>>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>>
>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>
>>>> do_install() {
>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>> ${D}${sysconfdir}/systemd/system
>>>>
>>>>       install -m 0755 -d ${D}/usr/share
>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>
>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>> ${D}/usr/share/wirepas_gateway
>>>> }
>>>>
>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>
>>>> Error was basically because of commented code wherein I was trying to
>>>> export the entire directory. I have commented out that for now.. I found
>>>> that by creating rpm or opkg package we can export the package to target.
>>>> Need help around that, if that is the correct way and how to use this
>>>> method in yocto recipe. If not, what can be the other way using which we
>>>> can ship or install the package in target.
>>>>
>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>> alex.kanavin@gmail.com> wrote:
>>>>
>>>>> Please share your complete recipe and all of the error message,
>>>>> otherwise it’s impossible to tell what is happening.
>>>>>
>>>>> Alex
>>>>>
>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>>>
>>>>>> Hello,
>>>>>> I am trying to install wirpas_gateway package from pypi using yocto
>>>>>> recipe.. Once service is build completely and  I flash image to target, i
>>>>>> don't see any of the installed packages. Does anyone has nay reference how
>>>>>> to install these packages in target as well. I dont see any generated
>>>>>> binary which i can ship tp target. However, source code of the package can
>>>>>> be seen in work directory. Currently I am trying to do something like below:
>>>>>>
>>>>>> do_install() {
>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>
>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>
>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>> }
>>>>>>
>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>
>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and other
>>>>>> files. Getting error while trying to ship this to target.
>>>>>>
>>>>>>
>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>> Links: You receive all messages sent to this group.
>>>>>> View/Reply Online (#62809):
>>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>>> Mute This Topic: https://lists.yoctoproject.org/mt/105061124/1686489
>>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>>> alex.kanavin@gmail.com]
>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>
>>>>>>

[-- Attachment #1.2: Type: text/html, Size: 8951 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-22  6:17           ` Alexander Kanavin
@ 2024-03-22  7:38             ` Ashu Joshi
  2024-03-22  7:59               ` Alexander Kanavin
  0 siblings, 1 reply; 15+ messages in thread
From: Ashu Joshi @ 2024-03-22  7:38 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 6714 bytes --]

How do i start python3 because when i try to start python by writing
python3 in target's terminal, i get above error message related to
encodings.

On Fri, Mar 22, 2024 at 11:48 AM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> You need to first start python3 and run it there, not directly from the
> shell.
>
> Alex
>
> On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>
>> It doesn't allow me to run import encodings as it is giving another error
>> import:not found
>>
>> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <alex.kanavin@gmail.com>
>> wrote:
>>
>>> It's a little odd that the application is looking for python modules in
>>> /lib and not /usr/lib.
>>>
>>> If you run python3 on the target and issue 'import encodings', does that
>>> work? Then they are installed in /usr/lib, and you need to find out why the
>>> app redirects python to look elsewhere.
>>>
>>> Alex
>>>
>>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>
>>>> It seems I have been able to install the package in gateway but getting
>>>> some encoding related error. Below is the error:
>>>>
>>>> ~ $ wm-gw --help
>>>> Python path configuration:
>>>>   PYTHONHOME = '/'
>>>>   PYTHONPATH = (not set)
>>>>   program name = 'python3'
>>>>   isolated = 0
>>>>   environment = 1
>>>>   user site = 1
>>>>   import site = 1
>>>>   sys._base_executable = '/usr/bin/python3'
>>>>   sys.base_prefix = '/'
>>>>   sys.base_exec_prefix = '/'
>>>>   sys.executable = '/usr/bin/python3'
>>>>   sys.prefix = '/'
>>>>   sys.exec_prefix = '/'
>>>>   sys.path = [
>>>>     'lib/python38.zip',
>>>>     '/lib/python3.8',
>>>>     '/lib/python3.8/lib-dynload',
>>>>   ]
>>>> Fatal Python error: init_fs_encoding: failed to get the Python codec of
>>>> the file
>>>>                                           system encoding
>>>> Python runtime state: core initialized
>>>> ModuleNotFoundError: No module named 'encodings'
>>>>
>>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below in
>>>> the recipe file but still encountering the same error. Any idea how to fix
>>>> this?
>>>>
>>>> do_configure(){
>>>>     unset PYTHONPATH
>>>>     unset PYTHONHOME
>>>> }
>>>>
>>>>
>>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com>
>>>> wrote:
>>>>
>>>>> Entire recipe is:
>>>>>
>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>>> DESCRIPTION = "Wirepas gateway transport service that connects the
>>>>> local dbus to a remote MQTT broker"
>>>>> LICENSE = "Apache-2.0"
>>>>> LIC_FILES_CHKSUM =
>>>>> "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>>
>>>>> SRC_URI = "file://wirepasTransport.service \
>>>>>            file://settings.yml \
>>>>> "
>>>>>
>>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>>> PV = "1.4.3"
>>>>> inherit pypi pkgconfig setuptools3
>>>>>
>>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>>
>>>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>>>
>>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>>
>>>>> do_install() {
>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>> ${D}${sysconfdir}/systemd/system
>>>>>
>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>
>>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>> ${D}/usr/share/wirepas_gateway
>>>>> }
>>>>>
>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>
>>>>> Error was basically because of commented code wherein I was trying to
>>>>> export the entire directory. I have commented out that for now.. I found
>>>>> that by creating rpm or opkg package we can export the package to target.
>>>>> Need help around that, if that is the correct way and how to use this
>>>>> method in yocto recipe. If not, what can be the other way using which we
>>>>> can ship or install the package in target.
>>>>>
>>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>>> alex.kanavin@gmail.com> wrote:
>>>>>
>>>>>> Please share your complete recipe and all of the error message,
>>>>>> otherwise it’s impossible to tell what is happening.
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>> I am trying to install wirpas_gateway package from pypi using yocto
>>>>>>> recipe.. Once service is build completely and  I flash image to target, i
>>>>>>> don't see any of the installed packages. Does anyone has nay reference how
>>>>>>> to install these packages in target as well. I dont see any generated
>>>>>>> binary which i can ship tp target. However, source code of the package can
>>>>>>> be seen in work directory. Currently I am trying to do something like below:
>>>>>>>
>>>>>>> do_install() {
>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>
>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>
>>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>> }
>>>>>>>
>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>> FILES_${PN} +=
>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>
>>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and other
>>>>>>> files. Getting error while trying to ship this to target.
>>>>>>>
>>>>>>>
>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>> Links: You receive all messages sent to this group.
>>>>>>> View/Reply Online (#62809):
>>>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>>>> Mute This Topic: https://lists.yoctoproject.org/mt/105061124/1686489
>>>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>>>> alex.kanavin@gmail.com]
>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>
>>>>>>>

[-- Attachment #1.2: Type: text/html, Size: 9487 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-22  7:38             ` Ashu Joshi
@ 2024-03-22  7:59               ` Alexander Kanavin
  2024-03-22  8:10                 ` Ashu Joshi
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Kanavin @ 2024-03-22  7:59 UTC (permalink / raw)
  To: Ashu Joshi; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 7208 bytes --]

This means the python installation on the target is incomplete/broken. You
need to look into how the image was formed because encodings module is
included in the core python package and is normally always present.

Alex

On Fri 22. Mar 2024 at 8.38, Ashu Joshi <ashujoshi35@gmail.com> wrote:

> How do i start python3 because when i try to start python by writing
> python3 in target's terminal, i get above error message related to
> encodings.
>
> On Fri, Mar 22, 2024 at 11:48 AM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
>
>> You need to first start python3 and run it there, not directly from the
>> shell.
>>
>> Alex
>>
>> On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>
>>> It doesn't allow me to run import encodings as it is giving another
>>> error import:not found
>>>
>>> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <
>>> alex.kanavin@gmail.com> wrote:
>>>
>>>> It's a little odd that the application is looking for python modules in
>>>> /lib and not /usr/lib.
>>>>
>>>> If you run python3 on the target and issue 'import encodings', does
>>>> that work? Then they are installed in /usr/lib, and you need to find out
>>>> why the app redirects python to look elsewhere.
>>>>
>>>> Alex
>>>>
>>>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>>
>>>>> It seems I have been able to install the package in gateway but
>>>>> getting some encoding related error. Below is the error:
>>>>>
>>>>> ~ $ wm-gw --help
>>>>> Python path configuration:
>>>>>   PYTHONHOME = '/'
>>>>>   PYTHONPATH = (not set)
>>>>>   program name = 'python3'
>>>>>   isolated = 0
>>>>>   environment = 1
>>>>>   user site = 1
>>>>>   import site = 1
>>>>>   sys._base_executable = '/usr/bin/python3'
>>>>>   sys.base_prefix = '/'
>>>>>   sys.base_exec_prefix = '/'
>>>>>   sys.executable = '/usr/bin/python3'
>>>>>   sys.prefix = '/'
>>>>>   sys.exec_prefix = '/'
>>>>>   sys.path = [
>>>>>     'lib/python38.zip',
>>>>>     '/lib/python3.8',
>>>>>     '/lib/python3.8/lib-dynload',
>>>>>   ]
>>>>> Fatal Python error: init_fs_encoding: failed to get the Python codec
>>>>> of the file
>>>>>                                             system encoding
>>>>> Python runtime state: core initialized
>>>>> ModuleNotFoundError: No module named 'encodings'
>>>>>
>>>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below in
>>>>> the recipe file but still encountering the same error. Any idea how to fix
>>>>> this?
>>>>>
>>>>> do_configure(){
>>>>>     unset PYTHONPATH
>>>>>     unset PYTHONHOME
>>>>> }
>>>>>
>>>>>
>>>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Entire recipe is:
>>>>>>
>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>>>> DESCRIPTION = "Wirepas gateway transport service that connects the
>>>>>> local dbus to a remote MQTT broker"
>>>>>> LICENSE = "Apache-2.0"
>>>>>> LIC_FILES_CHKSUM =
>>>>>> "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>>>
>>>>>> SRC_URI = "file://wirepasTransport.service \
>>>>>>            file://settings.yml \
>>>>>> "
>>>>>>
>>>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>>>> PV = "1.4.3"
>>>>>> inherit pypi pkgconfig setuptools3
>>>>>>
>>>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>>>
>>>>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>>>>
>>>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>>>
>>>>>> do_install() {
>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>
>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>
>>>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>> }
>>>>>>
>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>> FILES_${PN} += "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>
>>>>>> Error was basically because of commented code wherein I was trying to
>>>>>> export the entire directory. I have commented out that for now.. I found
>>>>>> that by creating rpm or opkg package we can export the package to target.
>>>>>> Need help around that, if that is the correct way and how to use this
>>>>>> method in yocto recipe. If not, what can be the other way using which we
>>>>>> can ship or install the package in target.
>>>>>>
>>>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>
>>>>>>> Please share your complete recipe and all of the error message,
>>>>>>> otherwise it’s impossible to tell what is happening.
>>>>>>>
>>>>>>> Alex
>>>>>>>
>>>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hello,
>>>>>>>> I am trying to install wirpas_gateway package from pypi using yocto
>>>>>>>> recipe.. Once service is build completely and  I flash image to target, i
>>>>>>>> don't see any of the installed packages. Does anyone has nay reference how
>>>>>>>> to install these packages in target as well. I dont see any generated
>>>>>>>> binary which i can ship tp target. However, source code of the package can
>>>>>>>> be seen in work directory. Currently I am trying to do something like below:
>>>>>>>>
>>>>>>>> do_install() {
>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>
>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>
>>>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>> }
>>>>>>>>
>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>> FILES_${PN} +=
>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>
>>>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and other
>>>>>>>> files. Getting error while trying to ship this to target.
>>>>>>>>
>>>>>>>>
>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>> Links: You receive all messages sent to this group.
>>>>>>>> View/Reply Online (#62809):
>>>>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>>>>> Mute This Topic:
>>>>>>>> https://lists.yoctoproject.org/mt/105061124/1686489
>>>>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>>>>> alex.kanavin@gmail.com]
>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>
>>>>>>>>

[-- Attachment #1.2: Type: text/html, Size: 10467 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-22  7:59               ` Alexander Kanavin
@ 2024-03-22  8:10                 ` Ashu Joshi
  2024-03-22 14:54                   ` Alexander Kanavin
  0 siblings, 1 reply; 15+ messages in thread
From: Ashu Joshi @ 2024-03-22  8:10 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 7745 bytes --]

But I can see python3.8 present in usr/lib and if I go in that directory, I
can see encodings as well.. see below output in target's terminal.

/usr/lib/python3.8 $
/usr/lib/python3.8 $ find -iname "encodings"
./encodings


On Fri, Mar 22, 2024 at 1:29 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> This means the python installation on the target is incomplete/broken. You
> need to look into how the image was formed because encodings module is
> included in the core python package and is normally always present.
>
> Alex
>
> On Fri 22. Mar 2024 at 8.38, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>
>> How do i start python3 because when i try to start python by writing
>> python3 in target's terminal, i get above error message related to
>> encodings.
>>
>> On Fri, Mar 22, 2024 at 11:48 AM Alexander Kanavin <
>> alex.kanavin@gmail.com> wrote:
>>
>>> You need to first start python3 and run it there, not directly from the
>>> shell.
>>>
>>> Alex
>>>
>>> On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>
>>>> It doesn't allow me to run import encodings as it is giving another
>>>> error import:not found
>>>>
>>>> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <
>>>> alex.kanavin@gmail.com> wrote:
>>>>
>>>>> It's a little odd that the application is looking for python modules
>>>>> in /lib and not /usr/lib.
>>>>>
>>>>> If you run python3 on the target and issue 'import encodings', does
>>>>> that work? Then they are installed in /usr/lib, and you need to find out
>>>>> why the app redirects python to look elsewhere.
>>>>>
>>>>> Alex
>>>>>
>>>>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> It seems I have been able to install the package in gateway but
>>>>>> getting some encoding related error. Below is the error:
>>>>>>
>>>>>> ~ $ wm-gw --help
>>>>>> Python path configuration:
>>>>>>   PYTHONHOME = '/'
>>>>>>   PYTHONPATH = (not set)
>>>>>>   program name = 'python3'
>>>>>>   isolated = 0
>>>>>>   environment = 1
>>>>>>   user site = 1
>>>>>>   import site = 1
>>>>>>   sys._base_executable = '/usr/bin/python3'
>>>>>>   sys.base_prefix = '/'
>>>>>>   sys.base_exec_prefix = '/'
>>>>>>   sys.executable = '/usr/bin/python3'
>>>>>>   sys.prefix = '/'
>>>>>>   sys.exec_prefix = '/'
>>>>>>   sys.path = [
>>>>>>     'lib/python38.zip',
>>>>>>     '/lib/python3.8',
>>>>>>     '/lib/python3.8/lib-dynload',
>>>>>>   ]
>>>>>> Fatal Python error: init_fs_encoding: failed to get the Python codec
>>>>>> of the file
>>>>>>                                             system encoding
>>>>>> Python runtime state: core initialized
>>>>>> ModuleNotFoundError: No module named 'encodings'
>>>>>>
>>>>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below in
>>>>>> the recipe file but still encountering the same error. Any idea how to fix
>>>>>> this?
>>>>>>
>>>>>> do_configure(){
>>>>>>     unset PYTHONPATH
>>>>>>     unset PYTHONHOME
>>>>>> }
>>>>>>
>>>>>>
>>>>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Entire recipe is:
>>>>>>>
>>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>>>>> DESCRIPTION = "Wirepas gateway transport service that connects the
>>>>>>> local dbus to a remote MQTT broker"
>>>>>>> LICENSE = "Apache-2.0"
>>>>>>> LIC_FILES_CHKSUM =
>>>>>>> "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>>>>
>>>>>>> SRC_URI = "file://wirepasTransport.service \
>>>>>>>            file://settings.yml \
>>>>>>> "
>>>>>>>
>>>>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>>>>> PV = "1.4.3"
>>>>>>> inherit pypi pkgconfig setuptools3
>>>>>>>
>>>>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>>>>
>>>>>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>>>>>
>>>>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>>>>
>>>>>>> do_install() {
>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>
>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>
>>>>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>> }
>>>>>>>
>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>> FILES_${PN} +=
>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>
>>>>>>> Error was basically because of commented code wherein I was trying
>>>>>>> to export the entire directory. I have commented out that for now.. I found
>>>>>>> that by creating rpm or opkg package we can export the package to target.
>>>>>>> Need help around that, if that is the correct way and how to use this
>>>>>>> method in yocto recipe. If not, what can be the other way using which we
>>>>>>> can ship or install the package in target.
>>>>>>>
>>>>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>
>>>>>>>> Please share your complete recipe and all of the error message,
>>>>>>>> otherwise it’s impossible to tell what is happening.
>>>>>>>>
>>>>>>>> Alex
>>>>>>>>
>>>>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>> I am trying to install wirpas_gateway package from pypi using
>>>>>>>>> yocto recipe.. Once service is build completely and  I flash image to
>>>>>>>>> target, i don't see any of the installed packages. Does anyone has nay
>>>>>>>>> reference how to install these packages in target as well. I dont see any
>>>>>>>>> generated binary which i can ship tp target. However, source code of the
>>>>>>>>> package can be seen in work directory. Currently I am trying to do
>>>>>>>>> something like below:
>>>>>>>>>
>>>>>>>>> do_install() {
>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>
>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>
>>>>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>> FILES_${PN} +=
>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>
>>>>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and other
>>>>>>>>> files. Getting error while trying to ship this to target.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>> Links: You receive all messages sent to this group.
>>>>>>>>> View/Reply Online (#62809):
>>>>>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>>>>>> Mute This Topic:
>>>>>>>>> https://lists.yoctoproject.org/mt/105061124/1686489
>>>>>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>>>>>> alex.kanavin@gmail.com]
>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>
>>>>>>>>>

[-- Attachment #1.2: Type: text/html, Size: 10794 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-22  8:10                 ` Ashu Joshi
@ 2024-03-22 14:54                   ` Alexander Kanavin
  2024-03-24  3:23                     ` Ashu Joshi
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Kanavin @ 2024-03-22 14:54 UTC (permalink / raw)
  To: Ashu Joshi; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 8144 bytes --]

Do you have something odd in the shell environment that prevents python
from looking in the right location?

Alex

On Fri 22. Mar 2024 at 9.11, Ashu Joshi <ashujoshi35@gmail.com> wrote:

> But I can see python3.8 present in usr/lib and if I go in that directory,
> I can see encodings as well.. see below output in target's terminal.
>
> /usr/lib/python3.8 $
> /usr/lib/python3.8 $ find -iname "encodings"
> ./encodings
>
>
> On Fri, Mar 22, 2024 at 1:29 PM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
>
>> This means the python installation on the target is incomplete/broken.
>> You need to look into how the image was formed because encodings module is
>> included in the core python package and is normally always present.
>>
>> Alex
>>
>> On Fri 22. Mar 2024 at 8.38, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>
>>> How do i start python3 because when i try to start python by writing
>>> python3 in target's terminal, i get above error message related to
>>> encodings.
>>>
>>> On Fri, Mar 22, 2024 at 11:48 AM Alexander Kanavin <
>>> alex.kanavin@gmail.com> wrote:
>>>
>>>> You need to first start python3 and run it there, not directly from the
>>>> shell.
>>>>
>>>> Alex
>>>>
>>>> On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>>
>>>>> It doesn't allow me to run import encodings as it is giving another
>>>>> error import:not found
>>>>>
>>>>> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <
>>>>> alex.kanavin@gmail.com> wrote:
>>>>>
>>>>>> It's a little odd that the application is looking for python modules
>>>>>> in /lib and not /usr/lib.
>>>>>>
>>>>>> If you run python3 on the target and issue 'import encodings', does
>>>>>> that work? Then they are installed in /usr/lib, and you need to find out
>>>>>> why the app redirects python to look elsewhere.
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> It seems I have been able to install the package in gateway but
>>>>>>> getting some encoding related error. Below is the error:
>>>>>>>
>>>>>>> ~ $ wm-gw --help
>>>>>>> Python path configuration:
>>>>>>>   PYTHONHOME = '/'
>>>>>>>   PYTHONPATH = (not set)
>>>>>>>   program name = 'python3'
>>>>>>>   isolated = 0
>>>>>>>   environment = 1
>>>>>>>   user site = 1
>>>>>>>   import site = 1
>>>>>>>   sys._base_executable = '/usr/bin/python3'
>>>>>>>   sys.base_prefix = '/'
>>>>>>>   sys.base_exec_prefix = '/'
>>>>>>>   sys.executable = '/usr/bin/python3'
>>>>>>>   sys.prefix = '/'
>>>>>>>   sys.exec_prefix = '/'
>>>>>>>   sys.path = [
>>>>>>>     'lib/python38.zip',
>>>>>>>     '/lib/python3.8',
>>>>>>>     '/lib/python3.8/lib-dynload',
>>>>>>>   ]
>>>>>>> Fatal Python error: init_fs_encoding: failed to get the Python codec
>>>>>>> of the file
>>>>>>>                                             system encoding
>>>>>>> Python runtime state: core initialized
>>>>>>> ModuleNotFoundError: No module named 'encodings'
>>>>>>>
>>>>>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below in
>>>>>>> the recipe file but still encountering the same error. Any idea how to fix
>>>>>>> this?
>>>>>>>
>>>>>>> do_configure(){
>>>>>>>     unset PYTHONPATH
>>>>>>>     unset PYTHONHOME
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Entire recipe is:
>>>>>>>>
>>>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>>>>>> DESCRIPTION = "Wirepas gateway transport service that connects the
>>>>>>>> local dbus to a remote MQTT broker"
>>>>>>>> LICENSE = "Apache-2.0"
>>>>>>>> LIC_FILES_CHKSUM =
>>>>>>>> "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>>>>>
>>>>>>>> SRC_URI = "file://wirepasTransport.service \
>>>>>>>>            file://settings.yml \
>>>>>>>> "
>>>>>>>>
>>>>>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>>>>>> PV = "1.4.3"
>>>>>>>> inherit pypi pkgconfig setuptools3
>>>>>>>>
>>>>>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>>>>>
>>>>>>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>>>>>>
>>>>>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>>>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>>>>>
>>>>>>>> do_install() {
>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>
>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>
>>>>>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>> }
>>>>>>>>
>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>> FILES_${PN} +=
>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>
>>>>>>>> Error was basically because of commented code wherein I was trying
>>>>>>>> to export the entire directory. I have commented out that for now.. I found
>>>>>>>> that by creating rpm or opkg package we can export the package to target.
>>>>>>>> Need help around that, if that is the correct way and how to use this
>>>>>>>> method in yocto recipe. If not, what can be the other way using which we
>>>>>>>> can ship or install the package in target.
>>>>>>>>
>>>>>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Please share your complete recipe and all of the error message,
>>>>>>>>> otherwise it’s impossible to tell what is happening.
>>>>>>>>>
>>>>>>>>> Alex
>>>>>>>>>
>>>>>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>> I am trying to install wirpas_gateway package from pypi using
>>>>>>>>>> yocto recipe.. Once service is build completely and  I flash image to
>>>>>>>>>> target, i don't see any of the installed packages. Does anyone has nay
>>>>>>>>>> reference how to install these packages in target as well. I dont see any
>>>>>>>>>> generated binary which i can ship tp target. However, source code of the
>>>>>>>>>> package can be seen in work directory. Currently I am trying to do
>>>>>>>>>> something like below:
>>>>>>>>>>
>>>>>>>>>> do_install() {
>>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>>
>>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>>
>>>>>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>>
>>>>>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and other
>>>>>>>>>> files. Getting error while trying to ship this to target.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>> Links: You receive all messages sent to this group.
>>>>>>>>>> View/Reply Online (#62809):
>>>>>>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>>>>>>> Mute This Topic:
>>>>>>>>>> https://lists.yoctoproject.org/mt/105061124/1686489
>>>>>>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>>>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>>>>>>> alex.kanavin@gmail.com]
>>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>>
>>>>>>>>>>

[-- Attachment #1.2: Type: text/html, Size: 11752 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-22 14:54                   ` Alexander Kanavin
@ 2024-03-24  3:23                     ` Ashu Joshi
  2024-03-28  7:36                       ` Ashu Joshi
  0 siblings, 1 reply; 15+ messages in thread
From: Ashu Joshi @ 2024-03-24  3:23 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Yocto-mailing-list


[-- Attachment #1.1: Type: text/plain, Size: 8620 bytes --]

I am not able to figure out.. Is there any way we can override the location
where application looks for python may be in recipe file or some setting,
conf file?



On Fri, 22 Mar 2024, 8:24 pm Alexander Kanavin, <alex.kanavin@gmail.com>
wrote:

> Do you have something odd in the shell environment that prevents python
> from looking in the right location?
>
> Alex
>
> On Fri 22. Mar 2024 at 9.11, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>
>> But I can see python3.8 present in usr/lib and if I go in that directory,
>> I can see encodings as well.. see below output in target's terminal.
>>
>> /usr/lib/python3.8 $
>> /usr/lib/python3.8 $ find -iname "encodings"
>> ./encodings
>>
>>
>> On Fri, Mar 22, 2024 at 1:29 PM Alexander Kanavin <alex.kanavin@gmail.com>
>> wrote:
>>
>>> This means the python installation on the target is incomplete/broken.
>>> You need to look into how the image was formed because encodings module is
>>> included in the core python package and is normally always present.
>>>
>>> Alex
>>>
>>> On Fri 22. Mar 2024 at 8.38, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>
>>>> How do i start python3 because when i try to start python by writing
>>>> python3 in target's terminal, i get above error message related to
>>>> encodings.
>>>>
>>>> On Fri, Mar 22, 2024 at 11:48 AM Alexander Kanavin <
>>>> alex.kanavin@gmail.com> wrote:
>>>>
>>>>> You need to first start python3 and run it there, not directly from
>>>>> the shell.
>>>>>
>>>>> Alex
>>>>>
>>>>> On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> It doesn't allow me to run import encodings as it is giving another
>>>>>> error import:not found
>>>>>>
>>>>>> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <
>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>
>>>>>>> It's a little odd that the application is looking for python modules
>>>>>>> in /lib and not /usr/lib.
>>>>>>>
>>>>>>> If you run python3 on the target and issue 'import encodings', does
>>>>>>> that work? Then they are installed in /usr/lib, and you need to find out
>>>>>>> why the app redirects python to look elsewhere.
>>>>>>>
>>>>>>> Alex
>>>>>>>
>>>>>>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> It seems I have been able to install the package in gateway but
>>>>>>>> getting some encoding related error. Below is the error:
>>>>>>>>
>>>>>>>> ~ $ wm-gw --help
>>>>>>>> Python path configuration:
>>>>>>>>   PYTHONHOME = '/'
>>>>>>>>   PYTHONPATH = (not set)
>>>>>>>>   program name = 'python3'
>>>>>>>>   isolated = 0
>>>>>>>>   environment = 1
>>>>>>>>   user site = 1
>>>>>>>>   import site = 1
>>>>>>>>   sys._base_executable = '/usr/bin/python3'
>>>>>>>>   sys.base_prefix = '/'
>>>>>>>>   sys.base_exec_prefix = '/'
>>>>>>>>   sys.executable = '/usr/bin/python3'
>>>>>>>>   sys.prefix = '/'
>>>>>>>>   sys.exec_prefix = '/'
>>>>>>>>   sys.path = [
>>>>>>>>     'lib/python38.zip',
>>>>>>>>     '/lib/python3.8',
>>>>>>>>     '/lib/python3.8/lib-dynload',
>>>>>>>>   ]
>>>>>>>> Fatal Python error: init_fs_encoding: failed to get the Python
>>>>>>>> codec of the file
>>>>>>>>                                                   system encoding
>>>>>>>> Python runtime state: core initialized
>>>>>>>> ModuleNotFoundError: No module named 'encodings'
>>>>>>>>
>>>>>>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below
>>>>>>>> in the recipe file but still encountering the same error. Any idea how to
>>>>>>>> fix this?
>>>>>>>>
>>>>>>>> do_configure(){
>>>>>>>>     unset PYTHONPATH
>>>>>>>>     unset PYTHONHOME
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Entire recipe is:
>>>>>>>>>
>>>>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>>>>>>> DESCRIPTION = "Wirepas gateway transport service that connects the
>>>>>>>>> local dbus to a remote MQTT broker"
>>>>>>>>> LICENSE = "Apache-2.0"
>>>>>>>>> LIC_FILES_CHKSUM =
>>>>>>>>> "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>>>>>>
>>>>>>>>> SRC_URI = "file://wirepasTransport.service \
>>>>>>>>>            file://settings.yml \
>>>>>>>>> "
>>>>>>>>>
>>>>>>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>>>>>>> PV = "1.4.3"
>>>>>>>>> inherit pypi pkgconfig setuptools3
>>>>>>>>>
>>>>>>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>>>>>>
>>>>>>>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>>>>>>>
>>>>>>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>>>>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>>>>>>
>>>>>>>>> do_install() {
>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>
>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>
>>>>>>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>> FILES_${PN} +=
>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>
>>>>>>>>> Error was basically because of commented code wherein I was trying
>>>>>>>>> to export the entire directory. I have commented out that for now.. I found
>>>>>>>>> that by creating rpm or opkg package we can export the package to target.
>>>>>>>>> Need help around that, if that is the correct way and how to use this
>>>>>>>>> method in yocto recipe. If not, what can be the other way using which we
>>>>>>>>> can ship or install the package in target.
>>>>>>>>>
>>>>>>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Please share your complete recipe and all of the error message,
>>>>>>>>>> otherwise it’s impossible to tell what is happening.
>>>>>>>>>>
>>>>>>>>>> Alex
>>>>>>>>>>
>>>>>>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hello,
>>>>>>>>>>> I am trying to install wirpas_gateway package from pypi using
>>>>>>>>>>> yocto recipe.. Once service is build completely and  I flash image to
>>>>>>>>>>> target, i don't see any of the installed packages. Does anyone has nay
>>>>>>>>>>> reference how to install these packages in target as well. I dont see any
>>>>>>>>>>> generated binary which i can ship tp target. However, source code of the
>>>>>>>>>>> package can be seen in work directory. Currently I am trying to do
>>>>>>>>>>> something like below:
>>>>>>>>>>>
>>>>>>>>>>> do_install() {
>>>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>
>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>>>
>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>>>> FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>>>
>>>>>>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and
>>>>>>>>>>> other files. Getting error while trying to ship this to target.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>>> Links: You receive all messages sent to this group.
>>>>>>>>>>> View/Reply Online (#62809):
>>>>>>>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>>>>>>>> Mute This Topic:
>>>>>>>>>>> https://lists.yoctoproject.org/mt/105061124/1686489
>>>>>>>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>>>>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>>>>>>>> alex.kanavin@gmail.com]
>>>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>>>
>>>>>>>>>>>

[-- Attachment #1.2: Type: text/html, Size: 12553 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-24  3:23                     ` Ashu Joshi
@ 2024-03-28  7:36                       ` Ashu Joshi
  2024-03-28  8:10                         ` Alexander Kanavin
       [not found]                         ` <17C0DF5A32BC8CCA.6770@lists.yoctoproject.org>
  0 siblings, 2 replies; 15+ messages in thread
From: Ashu Joshi @ 2024-03-28  7:36 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Yocto-mailing-list


[-- Attachment #1.1: Type: text/plain, Size: 9249 bytes --]

Does anyone knows aby other way how to resolve this python related issue? I
even tried to export path in local.conf file but even that is not working.
Also tried to create soft link for /lib pointing to /usr/lib but it gives
permission denied error. When trying with sudo there is LD_PRELOAD related
error.

On Sun, 24 Mar 2024, 8:53 am Ashu Joshi, <ashujoshi35@gmail.com> wrote:

> I am not able to figure out.. Is there any way we can override the
> location where application looks for python may be in recipe file or some
> setting, conf file?
>
>
>
> On Fri, 22 Mar 2024, 8:24 pm Alexander Kanavin, <alex.kanavin@gmail.com>
> wrote:
>
>> Do you have something odd in the shell environment that prevents python
>> from looking in the right location?
>>
>> Alex
>>
>> On Fri 22. Mar 2024 at 9.11, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>
>>> But I can see python3.8 present in usr/lib and if I go in that
>>> directory, I can see encodings as well.. see below output in target's
>>> terminal.
>>>
>>> /usr/lib/python3.8 $
>>> /usr/lib/python3.8 $ find -iname "encodings"
>>> ./encodings
>>>
>>>
>>> On Fri, Mar 22, 2024 at 1:29 PM Alexander Kanavin <
>>> alex.kanavin@gmail.com> wrote:
>>>
>>>> This means the python installation on the target is incomplete/broken.
>>>> You need to look into how the image was formed because encodings module is
>>>> included in the core python package and is normally always present.
>>>>
>>>> Alex
>>>>
>>>> On Fri 22. Mar 2024 at 8.38, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>>
>>>>> How do i start python3 because when i try to start python by writing
>>>>> python3 in target's terminal, i get above error message related to
>>>>> encodings.
>>>>>
>>>>> On Fri, Mar 22, 2024 at 11:48 AM Alexander Kanavin <
>>>>> alex.kanavin@gmail.com> wrote:
>>>>>
>>>>>> You need to first start python3 and run it there, not directly from
>>>>>> the shell.
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>> On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> It doesn't allow me to run import encodings as it is giving another
>>>>>>> error import:not found
>>>>>>>
>>>>>>> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <
>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>
>>>>>>>> It's a little odd that the application is looking for python
>>>>>>>> modules in /lib and not /usr/lib.
>>>>>>>>
>>>>>>>> If you run python3 on the target and issue 'import encodings', does
>>>>>>>> that work? Then they are installed in /usr/lib, and you need to find out
>>>>>>>> why the app redirects python to look elsewhere.
>>>>>>>>
>>>>>>>> Alex
>>>>>>>>
>>>>>>>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> It seems I have been able to install the package in gateway but
>>>>>>>>> getting some encoding related error. Below is the error:
>>>>>>>>>
>>>>>>>>> ~ $ wm-gw --help
>>>>>>>>> Python path configuration:
>>>>>>>>>   PYTHONHOME = '/'
>>>>>>>>>   PYTHONPATH = (not set)
>>>>>>>>>   program name = 'python3'
>>>>>>>>>   isolated = 0
>>>>>>>>>   environment = 1
>>>>>>>>>   user site = 1
>>>>>>>>>   import site = 1
>>>>>>>>>   sys._base_executable = '/usr/bin/python3'
>>>>>>>>>   sys.base_prefix = '/'
>>>>>>>>>   sys.base_exec_prefix = '/'
>>>>>>>>>   sys.executable = '/usr/bin/python3'
>>>>>>>>>   sys.prefix = '/'
>>>>>>>>>   sys.exec_prefix = '/'
>>>>>>>>>   sys.path = [
>>>>>>>>>     'lib/python38.zip',
>>>>>>>>>     '/lib/python3.8',
>>>>>>>>>     '/lib/python3.8/lib-dynload',
>>>>>>>>>   ]
>>>>>>>>> Fatal Python error: init_fs_encoding: failed to get the Python
>>>>>>>>> codec of the file
>>>>>>>>>                                                   system encoding
>>>>>>>>> Python runtime state: core initialized
>>>>>>>>> ModuleNotFoundError: No module named 'encodings'
>>>>>>>>>
>>>>>>>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below
>>>>>>>>> in the recipe file but still encountering the same error. Any idea how to
>>>>>>>>> fix this?
>>>>>>>>>
>>>>>>>>> do_configure(){
>>>>>>>>>     unset PYTHONPATH
>>>>>>>>>     unset PYTHONHOME
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Entire recipe is:
>>>>>>>>>>
>>>>>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>>>>>>>> DESCRIPTION = "Wirepas gateway transport service that connects
>>>>>>>>>> the local dbus to a remote MQTT broker"
>>>>>>>>>> LICENSE = "Apache-2.0"
>>>>>>>>>> LIC_FILES_CHKSUM =
>>>>>>>>>> "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>>>>>>>
>>>>>>>>>> SRC_URI = "file://wirepasTransport.service \
>>>>>>>>>>            file://settings.yml \
>>>>>>>>>> "
>>>>>>>>>>
>>>>>>>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>>>>>>>> PV = "1.4.3"
>>>>>>>>>> inherit pypi pkgconfig setuptools3
>>>>>>>>>>
>>>>>>>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>>>>>>>
>>>>>>>>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>>>>>>>>
>>>>>>>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>>>>>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>>>>>>>
>>>>>>>>>> do_install() {
>>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>>
>>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>>
>>>>>>>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>>> #FILES_${PN} += "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>>
>>>>>>>>>> Error was basically because of commented code wherein I was
>>>>>>>>>> trying to export the entire directory. I have commented out that for now..
>>>>>>>>>> I found that by creating rpm or opkg package we can export the package to
>>>>>>>>>> target. Need help around that, if that is the correct way and how to use
>>>>>>>>>> this method in yocto recipe. If not, what can be the other way using which
>>>>>>>>>> we can ship or install the package in target.
>>>>>>>>>>
>>>>>>>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Please share your complete recipe and all of the error message,
>>>>>>>>>>> otherwise it’s impossible to tell what is happening.
>>>>>>>>>>>
>>>>>>>>>>> Alex
>>>>>>>>>>>
>>>>>>>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hello,
>>>>>>>>>>>> I am trying to install wirpas_gateway package from pypi using
>>>>>>>>>>>> yocto recipe.. Once service is build completely and  I flash image to
>>>>>>>>>>>> target, i don't see any of the installed packages. Does anyone has nay
>>>>>>>>>>>> reference how to install these packages in target as well. I dont see any
>>>>>>>>>>>> generated binary which i can ship tp target. However, source code of the
>>>>>>>>>>>> package can be seen in work directory. Currently I am trying to do
>>>>>>>>>>>> something like below:
>>>>>>>>>>>>
>>>>>>>>>>>> do_install() {
>>>>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>>
>>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>>>>
>>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>>> "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>>>>
>>>>>>>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and
>>>>>>>>>>>> other files. Getting error while trying to ship this to target.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>>>> Links: You receive all messages sent to this group.
>>>>>>>>>>>> View/Reply Online (#62809):
>>>>>>>>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>>>>>>>>> Mute This Topic:
>>>>>>>>>>>> https://lists.yoctoproject.org/mt/105061124/1686489
>>>>>>>>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>>>>>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>>>>>>>>> alex.kanavin@gmail.com]
>>>>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>>>>
>>>>>>>>>>>>

[-- Attachment #1.2: Type: text/html, Size: 13419 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
  2024-03-28  7:36                       ` Ashu Joshi
@ 2024-03-28  8:10                         ` Alexander Kanavin
       [not found]                         ` <17C0DF5A32BC8CCA.6770@lists.yoctoproject.org>
  1 sibling, 0 replies; 15+ messages in thread
From: Alexander Kanavin @ 2024-03-28  8:10 UTC (permalink / raw)
  To: Ashu Joshi; +Cc: Yocto-mailing-list


[-- Attachment #1.1: Type: text/plain, Size: 9825 bytes --]

I think you have to get an expert to boot your system and look at it
directly. If we can’t reproduce the issue, it’s just too much effort to
exchange emails for no reward at all other than thanks. It’s open source,
that’s how it works.

Alex

On Thu 28. Mar 2024 at 8.36, Ashu Joshi <ashujoshi35@gmail.com> wrote:

> Does anyone knows aby other way how to resolve this python related issue?
> I even tried to export path in local.conf file but even that is not working.
> Also tried to create soft link for /lib pointing to /usr/lib but it gives
> permission denied error. When trying with sudo there is LD_PRELOAD related
> error.
>
> On Sun, 24 Mar 2024, 8:53 am Ashu Joshi, <ashujoshi35@gmail.com> wrote:
>
>> I am not able to figure out.. Is there any way we can override the
>> location where application looks for python may be in recipe file or some
>> setting, conf file?
>>
>>
>>
>> On Fri, 22 Mar 2024, 8:24 pm Alexander Kanavin, <alex.kanavin@gmail.com>
>> wrote:
>>
>>> Do you have something odd in the shell environment that prevents python
>>> from looking in the right location?
>>>
>>> Alex
>>>
>>> On Fri 22. Mar 2024 at 9.11, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>
>>>> But I can see python3.8 present in usr/lib and if I go in that
>>>> directory, I can see encodings as well.. see below output in target's
>>>> terminal.
>>>>
>>>> /usr/lib/python3.8 $
>>>> /usr/lib/python3.8 $ find -iname "encodings"
>>>> ./encodings
>>>>
>>>>
>>>> On Fri, Mar 22, 2024 at 1:29 PM Alexander Kanavin <
>>>> alex.kanavin@gmail.com> wrote:
>>>>
>>>>> This means the python installation on the target is incomplete/broken.
>>>>> You need to look into how the image was formed because encodings module is
>>>>> included in the core python package and is normally always present.
>>>>>
>>>>> Alex
>>>>>
>>>>> On Fri 22. Mar 2024 at 8.38, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>>>
>>>>>> How do i start python3 because when i try to start python by writing
>>>>>> python3 in target's terminal, i get above error message related to
>>>>>> encodings.
>>>>>>
>>>>>> On Fri, Mar 22, 2024 at 11:48 AM Alexander Kanavin <
>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>
>>>>>>> You need to first start python3 and run it there, not directly from
>>>>>>> the shell.
>>>>>>>
>>>>>>> Alex
>>>>>>>
>>>>>>> On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> It doesn't allow me to run import encodings as it is giving another
>>>>>>>> error import:not found
>>>>>>>>
>>>>>>>> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <
>>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> It's a little odd that the application is looking for python
>>>>>>>>> modules in /lib and not /usr/lib.
>>>>>>>>>
>>>>>>>>> If you run python3 on the target and issue 'import encodings',
>>>>>>>>> does that work? Then they are installed in /usr/lib, and you need to find
>>>>>>>>> out why the app redirects python to look elsewhere.
>>>>>>>>>
>>>>>>>>> Alex
>>>>>>>>>
>>>>>>>>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> It seems I have been able to install the package in gateway but
>>>>>>>>>> getting some encoding related error. Below is the error:
>>>>>>>>>>
>>>>>>>>>> ~ $ wm-gw --help
>>>>>>>>>> Python path configuration:
>>>>>>>>>>   PYTHONHOME = '/'
>>>>>>>>>>   PYTHONPATH = (not set)
>>>>>>>>>>   program name = 'python3'
>>>>>>>>>>   isolated = 0
>>>>>>>>>>   environment = 1
>>>>>>>>>>   user site = 1
>>>>>>>>>>   import site = 1
>>>>>>>>>>   sys._base_executable = '/usr/bin/python3'
>>>>>>>>>>   sys.base_prefix = '/'
>>>>>>>>>>   sys.base_exec_prefix = '/'
>>>>>>>>>>   sys.executable = '/usr/bin/python3'
>>>>>>>>>>   sys.prefix = '/'
>>>>>>>>>>   sys.exec_prefix = '/'
>>>>>>>>>>   sys.path = [
>>>>>>>>>>     'lib/python38.zip',
>>>>>>>>>>     '/lib/python3.8',
>>>>>>>>>>     '/lib/python3.8/lib-dynload',
>>>>>>>>>>   ]
>>>>>>>>>> Fatal Python error: init_fs_encoding: failed to get the Python
>>>>>>>>>> codec of the file
>>>>>>>>>>                                                   system encoding
>>>>>>>>>> Python runtime state: core initialized
>>>>>>>>>> ModuleNotFoundError: No module named 'encodings'
>>>>>>>>>>
>>>>>>>>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding below
>>>>>>>>>> in the recipe file but still encountering the same error. Any idea how to
>>>>>>>>>> fix this?
>>>>>>>>>>
>>>>>>>>>> do_configure(){
>>>>>>>>>>     unset PYTHONPATH
>>>>>>>>>>     unset PYTHONHOME
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Entire recipe is:
>>>>>>>>>>>
>>>>>>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>>>>>>>>> DESCRIPTION = "Wirepas gateway transport service that connects
>>>>>>>>>>> the local dbus to a remote MQTT broker"
>>>>>>>>>>> LICENSE = "Apache-2.0"
>>>>>>>>>>> LIC_FILES_CHKSUM =
>>>>>>>>>>> "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>>>>>>>>
>>>>>>>>>>> SRC_URI = "file://wirepasTransport.service \
>>>>>>>>>>>            file://settings.yml \
>>>>>>>>>>> "
>>>>>>>>>>>
>>>>>>>>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>>>>>>>>> PV = "1.4.3"
>>>>>>>>>>> inherit pypi pkgconfig setuptools3
>>>>>>>>>>>
>>>>>>>>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>>>>>>>>
>>>>>>>>>>> DEPENDS += "systemd python3 python3-pkgconfig-native python3-pip"
>>>>>>>>>>>
>>>>>>>>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>>>>>>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>>>>>>>>
>>>>>>>>>>> do_install() {
>>>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>
>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>>>
>>>>>>>>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>>>> #FILES_${PN} +=
>>>>>>>>>>> "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>>>
>>>>>>>>>>> Error was basically because of commented code wherein I was
>>>>>>>>>>> trying to export the entire directory. I have commented out that for now..
>>>>>>>>>>> I found that by creating rpm or opkg package we can export the package to
>>>>>>>>>>> target. Need help around that, if that is the correct way and how to use
>>>>>>>>>>> this method in yocto recipe. If not, what can be the other way using which
>>>>>>>>>>> we can ship or install the package in target.
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>>>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Please share your complete recipe and all of the error message,
>>>>>>>>>>>> otherwise it’s impossible to tell what is happening.
>>>>>>>>>>>>
>>>>>>>>>>>> Alex
>>>>>>>>>>>>
>>>>>>>>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hello,
>>>>>>>>>>>>> I am trying to install wirpas_gateway package from pypi using
>>>>>>>>>>>>> yocto recipe.. Once service is build completely and  I flash image to
>>>>>>>>>>>>> target, i don't see any of the installed packages. Does anyone has nay
>>>>>>>>>>>>> reference how to install these packages in target as well. I dont see any
>>>>>>>>>>>>> generated binary which i can ship tp target. However, source code of the
>>>>>>>>>>>>> package can be seen in work directory. Currently I am trying to do
>>>>>>>>>>>>> something like below:
>>>>>>>>>>>>>
>>>>>>>>>>>>> do_install() {
>>>>>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>>>
>>>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>>>>>
>>>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>>>> "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>>>>>
>>>>>>>>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and
>>>>>>>>>>>>> other files. Getting error while trying to ship this to target.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>>>>> Links: You receive all messages sent to this group.
>>>>>>>>>>>>> View/Reply Online (#62809):
>>>>>>>>>>>>> https://lists.yoctoproject.org/g/yocto/message/62809
>>>>>>>>>>>>> Mute This Topic:
>>>>>>>>>>>>> https://lists.yoctoproject.org/mt/105061124/1686489
>>>>>>>>>>>>> Group Owner: yocto+owner@lists.yoctoproject.org
>>>>>>>>>>>>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
>>>>>>>>>>>>> alex.kanavin@gmail.com]
>>>>>>>>>>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>>>>>>>>>>
>>>>>>>>>>>>>

[-- Attachment #1.2: Type: text/html, Size: 14261 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [yocto] Export python packages installed using pypi to target
       [not found]                         ` <17C0DF5A32BC8CCA.6770@lists.yoctoproject.org>
@ 2024-03-28  9:44                           ` Alexander Kanavin
  0 siblings, 0 replies; 15+ messages in thread
From: Alexander Kanavin @ 2024-03-28  9:44 UTC (permalink / raw)
  To: yocto, alex.kanavin; +Cc: Ashu Joshi


[-- Attachment #1.1: Type: text/plain, Size: 10710 bytes --]

That said, there's one thing you *can* do. Abandon whatever legacy yocto
build and images you have, and set up a clean yocto build directly from the
poky repository, targeting one of the qemu machines (this is the default).
Then build an image with python in it (e.g. core-image-full-cmdline), then
boot it in qemu and verify that python can start. Then add your app recipe
and check that. It won't answer the question about why your existing build
has a broken python, but it will give you a working setup that you can then
bring step by step to match your requirements.

Alex

On Thu, 28 Mar 2024 at 09:10, Alexander Kanavin via lists.yoctoproject.org
<alex.kanavin=gmail.com@lists.yoctoproject.org> wrote:

> I think you have to get an expert to boot your system and look at it
> directly. If we can’t reproduce the issue, it’s just too much effort to
> exchange emails for no reward at all other than thanks. It’s open source,
> that’s how it works.
>
> Alex
>
> On Thu 28. Mar 2024 at 8.36, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>
>> Does anyone knows aby other way how to resolve this python related issue?
>> I even tried to export path in local.conf file but even that is not working.
>> Also tried to create soft link for /lib pointing to /usr/lib but it gives
>> permission denied error. When trying with sudo there is LD_PRELOAD related
>> error.
>>
>> On Sun, 24 Mar 2024, 8:53 am Ashu Joshi, <ashujoshi35@gmail.com> wrote:
>>
>>> I am not able to figure out.. Is there any way we can override the
>>> location where application looks for python may be in recipe file or some
>>> setting, conf file?
>>>
>>>
>>>
>>> On Fri, 22 Mar 2024, 8:24 pm Alexander Kanavin, <alex.kanavin@gmail.com>
>>> wrote:
>>>
>>>> Do you have something odd in the shell environment that prevents python
>>>> from looking in the right location?
>>>>
>>>> Alex
>>>>
>>>> On Fri 22. Mar 2024 at 9.11, Ashu Joshi <ashujoshi35@gmail.com> wrote:
>>>>
>>>>> But I can see python3.8 present in usr/lib and if I go in that
>>>>> directory, I can see encodings as well.. see below output in target's
>>>>> terminal.
>>>>>
>>>>> /usr/lib/python3.8 $
>>>>> /usr/lib/python3.8 $ find -iname "encodings"
>>>>> ./encodings
>>>>>
>>>>>
>>>>> On Fri, Mar 22, 2024 at 1:29 PM Alexander Kanavin <
>>>>> alex.kanavin@gmail.com> wrote:
>>>>>
>>>>>> This means the python installation on the target is
>>>>>> incomplete/broken. You need to look into how the image was formed because
>>>>>> encodings module is included in the core python package and is normally
>>>>>> always present.
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>> On Fri 22. Mar 2024 at 8.38, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> How do i start python3 because when i try to start python by writing
>>>>>>> python3 in target's terminal, i get above error message related to
>>>>>>> encodings.
>>>>>>>
>>>>>>> On Fri, Mar 22, 2024 at 11:48 AM Alexander Kanavin <
>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>
>>>>>>>> You need to first start python3 and run it there, not directly from
>>>>>>>> the shell.
>>>>>>>>
>>>>>>>> Alex
>>>>>>>>
>>>>>>>> On Fri, 22 Mar 2024 at 07:00, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> It doesn't allow me to run import encodings as it is giving
>>>>>>>>> another error import:not found
>>>>>>>>>
>>>>>>>>> On Thu, Mar 21, 2024 at 7:53 PM Alexander Kanavin <
>>>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> It's a little odd that the application is looking for python
>>>>>>>>>> modules in /lib and not /usr/lib.
>>>>>>>>>>
>>>>>>>>>> If you run python3 on the target and issue 'import encodings',
>>>>>>>>>> does that work? Then they are installed in /usr/lib, and you need to find
>>>>>>>>>> out why the app redirects python to look elsewhere.
>>>>>>>>>>
>>>>>>>>>> Alex
>>>>>>>>>>
>>>>>>>>>> On Thu, 21 Mar 2024 at 14:36, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> It seems I have been able to install the package in gateway but
>>>>>>>>>>> getting some encoding related error. Below is the error:
>>>>>>>>>>>
>>>>>>>>>>> ~ $ wm-gw --help
>>>>>>>>>>> Python path configuration:
>>>>>>>>>>>   PYTHONHOME = '/'
>>>>>>>>>>>   PYTHONPATH = (not set)
>>>>>>>>>>>   program name = 'python3'
>>>>>>>>>>>   isolated = 0
>>>>>>>>>>>   environment = 1
>>>>>>>>>>>   user site = 1
>>>>>>>>>>>   import site = 1
>>>>>>>>>>>   sys._base_executable = '/usr/bin/python3'
>>>>>>>>>>>   sys.base_prefix = '/'
>>>>>>>>>>>   sys.base_exec_prefix = '/'
>>>>>>>>>>>   sys.executable = '/usr/bin/python3'
>>>>>>>>>>>   sys.prefix = '/'
>>>>>>>>>>>   sys.exec_prefix = '/'
>>>>>>>>>>>   sys.path = [
>>>>>>>>>>>     'lib/python38.zip',
>>>>>>>>>>>     '/lib/python3.8',
>>>>>>>>>>>     '/lib/python3.8/lib-dynload',
>>>>>>>>>>>   ]
>>>>>>>>>>> Fatal Python error: init_fs_encoding: failed to get the Python
>>>>>>>>>>> codec of the file
>>>>>>>>>>>                                                   system encoding
>>>>>>>>>>> Python runtime state: core initialized
>>>>>>>>>>> ModuleNotFoundError: No module named 'encodings'
>>>>>>>>>>>
>>>>>>>>>>> I even tried to unset PYTHONHOME and  PYTHONPATH  by adding
>>>>>>>>>>> below in the recipe file but still encountering the same error. Any idea
>>>>>>>>>>> how to fix this?
>>>>>>>>>>>
>>>>>>>>>>> do_configure(){
>>>>>>>>>>>     unset PYTHONPATH
>>>>>>>>>>>     unset PYTHONHOME
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Mar 21, 2024 at 3:13 PM Ashu Joshi <
>>>>>>>>>>> ashujoshi35@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Entire recipe is:
>>>>>>>>>>>>
>>>>>>>>>>>> FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>>>>>>>>>>>> DESCRIPTION = "Wirepas gateway transport service that connects
>>>>>>>>>>>> the local dbus to a remote MQTT broker"
>>>>>>>>>>>> LICENSE = "Apache-2.0"
>>>>>>>>>>>> LIC_FILES_CHKSUM =
>>>>>>>>>>>> "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
>>>>>>>>>>>>
>>>>>>>>>>>> SRC_URI = "file://wirepasTransport.service \
>>>>>>>>>>>>            file://settings.yml \
>>>>>>>>>>>> "
>>>>>>>>>>>>
>>>>>>>>>>>> PYPI_PACKAGE = "wirepas_gateway"
>>>>>>>>>>>> PV = "1.4.3"
>>>>>>>>>>>> inherit pypi pkgconfig setuptools3
>>>>>>>>>>>>
>>>>>>>>>>>> SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"
>>>>>>>>>>>>
>>>>>>>>>>>> DEPENDS += "systemd python3 python3-pkgconfig-native
>>>>>>>>>>>> python3-pip"
>>>>>>>>>>>>
>>>>>>>>>>>> SYSTEMD_SERVICE_${PN} = "wirepasTransport.service"
>>>>>>>>>>>> SYSTEMD_AUTO_ENABLE_${PN} = "enable"
>>>>>>>>>>>>
>>>>>>>>>>>> do_install() {
>>>>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>>
>>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>>>>
>>>>>>>>>>>> #      install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>> #      install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>>>>> #FILES_${PN} +=
>>>>>>>>>>>> "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>>>>
>>>>>>>>>>>> Error was basically because of commented code wherein I was
>>>>>>>>>>>> trying to export the entire directory. I have commented out that for now..
>>>>>>>>>>>> I found that by creating rpm or opkg package we can export the package to
>>>>>>>>>>>> target. Need help around that, if that is the correct way and how to use
>>>>>>>>>>>> this method in yocto recipe. If not, what can be the other way using which
>>>>>>>>>>>> we can ship or install the package in target.
>>>>>>>>>>>>
>>>>>>>>>>>> On Thu, Mar 21, 2024 at 1:26 PM Alexander Kanavin <
>>>>>>>>>>>> alex.kanavin@gmail.com> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Please share your complete recipe and all of the error
>>>>>>>>>>>>> message, otherwise it’s impossible to tell what is happening.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Alex
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Thu 21. Mar 2024 at 8.29, Ashu Joshi <ashujoshi35@gmail.com>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hello,
>>>>>>>>>>>>>> I am trying to install wirpas_gateway package from pypi using
>>>>>>>>>>>>>> yocto recipe.. Once service is build completely and  I flash image to
>>>>>>>>>>>>>> target, i don't see any of the installed packages. Does anyone has nay
>>>>>>>>>>>>>> reference how to install these packages in target as well. I dont see any
>>>>>>>>>>>>>> generated binary which i can ship tp target. However, source code of the
>>>>>>>>>>>>>> package can be seen in work directory. Currently I am trying to do
>>>>>>>>>>>>>> something like below:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> do_install() {
>>>>>>>>>>>>>>       install -m 0755 -d ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>>>>       install -m 0755 ${WORKDIR}/wirepasTransport.service
>>>>>>>>>>>>>> ${D}${sysconfdir}/systemd/system
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share
>>>>>>>>>>>>>>       install -m 0644 ${WORKDIR}/settings.yml ${D}/usr/share
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>       install -m 0755 -d ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>>>>       install -m 0644 ${WORKDIR}/wirepas_gateway-1.4.3
>>>>>>>>>>>>>> ${D}/usr/share/wirepas_gateway
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> FILES_${PN} += "usr/share/wirepas_gateway"
>>>>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>>>>> "/usr/share/wirepas_gateway/wirepas_gateway-1.4.3"
>>>>>>>>>>>>>> FILES_${PN} +=
>>>>>>>>>>>>>> "${sysconfdir}/systemd/system/wirepasTransport.service"
>>>>>>>>>>>>>> FILES_${PN} += "/usr/share/settings.yml"
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> wirepas_gateway-1.4.3 is directory which contains setup and
>>>>>>>>>>>>>> other files. Getting error while trying to ship this to target.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#62854):
> https://lists.yoctoproject.org/g/yocto/message/62854
> Mute This Topic: https://lists.yoctoproject.org/mt/105061124/1686489
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #1.2: Type: text/html, Size: 14724 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 57798 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-03-28  9:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21  7:29 Export python packages installed using pypi to target Ashu Joshi
2024-03-21  7:56 ` [yocto] " Alexander Kanavin
2024-03-21  9:43   ` Ashu Joshi
2024-03-21 13:36     ` Ashu Joshi
2024-03-21 14:23       ` Alexander Kanavin
2024-03-22  6:00         ` Ashu Joshi
2024-03-22  6:17           ` Alexander Kanavin
2024-03-22  7:38             ` Ashu Joshi
2024-03-22  7:59               ` Alexander Kanavin
2024-03-22  8:10                 ` Ashu Joshi
2024-03-22 14:54                   ` Alexander Kanavin
2024-03-24  3:23                     ` Ashu Joshi
2024-03-28  7:36                       ` Ashu Joshi
2024-03-28  8:10                         ` Alexander Kanavin
     [not found]                         ` <17C0DF5A32BC8CCA.6770@lists.yoctoproject.org>
2024-03-28  9:44                           ` Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.