<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX Processors中的主题 Re: yocto toolchains compile optee_example code ,ModuleNotFoundError: No module named 'Crypto'</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/yocto-toolchains-compile-optee-example-code-ModuleNotFoundError/m-p/1227184#M169024</link>
    <description>&lt;P&gt;finally, I have found the solutions. I did it 2 years ago for imx7 board. I remember again.&lt;BR /&gt;do not need to modify the recipe.&lt;BR /&gt;the toolchain does not include the Crypto package&lt;BR /&gt;just manually copy Crypto to toolchain(I do not know how to modify somewhere in the compilation process to copy directly to make it, if someone knows how to do .please tell me ,thank you)&lt;/P&gt;&lt;P&gt;sudo cp -r /home/rnd2/work/maaxboard/zeus/imx-yocto-bsp/maaxboard/build/tmp/sysroots-components/x86_64/python3-pycrypto-native/usr/lib/python3.7/site-packages/Crypto /opt/fsl-imx-wayland-lite/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/lib/python3.7/site-packages/.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have found the solution.&lt;/P&gt;&lt;P&gt;please install pycryptodome==3.7 on host opensuse mechine:&lt;/P&gt;&lt;P&gt;pip install pycryptodome==3.7&lt;BR /&gt;----&lt;BR /&gt;Before I played the old board maaxboard, the python is 2.6, but now it's 3.7. so need to install it.&lt;BR /&gt;sometimes ,I am confuse that the pycryptodome should be install in yocto toolcains (DEPENDS += "python3-pycryptodome-native python3-pyelftools-native") or in host machine.&lt;/P&gt;&lt;P&gt;I can find DEPENDS += "python3-pycryptodome-native python3-pyelftools-native" in optee_os.bb file,&lt;BR /&gt;so I installed my toolchains in my another ubuntu 18.or host machine. the compilation is passed ! so I thought the error was not in toolchain itself. it should be in host machine.&lt;BR /&gt;so I installed : pip install pycryptodome==3.7 on opensuse host. solved it!&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 15:08:34 GMT</pubDate>
    <dc:creator>gonewithwind-peter</dc:creator>
    <dc:date>2021-05-06T15:08:34Z</dc:date>
    <item>
      <title>yocto toolchains compile optee_example code ,ModuleNotFoundError: No module named 'Crypto'</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/yocto-toolchains-compile-optee-example-code-ModuleNotFoundError/m-p/1227154#M169021</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;yocto toolchains compile optee_example code ,ModuleNotFoundError: No module named 'Crypto'&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I am playing imx8qm -iwave board.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I use yocto toolchains to cross compile optee_example code,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;error happened:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;from Crypto.Signature import PKCS1_v1_5&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;ModuleNotFoundError: No module named 'Crypto'&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;but I find in toolchain folder, the Crypto folder is there:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;./sysroots/aarch64-poky-linux/usr/lib/python3.7/site-packages/Crypto&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;It seems the compiler can not find it ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;I have added :&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;IMAGE_INSTALL_append &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;+=&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;" python3-pycryptodome " in local.conf&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;any help?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;aarch64-poky-linux-gcc&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;-fstack-protector-strong&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/fsl-imx-xwayland/5.4-zeus/sysroots/aarch64-poky-linux -o optee_example_aes main.o -lteec -L/opt/fsl-imx-xwayland/5.4-zeus/sysroots/aarch64-poky-linux/usr//lib&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;make[1]: Leaving directory '/opt/oe/iw/iw-5.4.24/optee_examples/aes/host'&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;make -C ta CROSS_COMPILE="aarch64-poky-linux-" LDFLAGS=""&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;make[1]: Entering directory '/opt/oe/iw/iw-5.4.24/optee_examples/aes/ta'&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;CC&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;aes_ta.o&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;CC&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;user_ta_header.o&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;CPP &lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;ta.lds&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;LD&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;5dbac793-f574-4871-8ad3-04331ec17f24.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;OBJDUMP 5dbac793-f574-4871-8ad3-04331ec17f24.dmp&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;OBJCOPY 5dbac793-f574-4871-8ad3-04331ec17f24.stripped.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;SIGN&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;5dbac793-f574-4871-8ad3-04331ec17f24.ta&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;File "/usr/local/optee/sysroots/aarch64-poky-linux/usr/include/optee/export-user_ta_arm64//scripts/sign.py", line 78, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;main()&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;File "/usr/local/optee/sysroots/aarch64-poky-linux/usr/include/optee/export-user_ta_arm64//scripts/sign.py", line 31, in main&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;from Crypto.Signature import PKCS1_v1_5&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;ModuleNotFoundError: No module named 'Crypto'&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;/usr/local/optee/sysroots/aarch64-poky-linux/usr/include/optee/export-user_ta_arm64/mk/link.mk:60: recipe for target '5dbac793-f574-4871-8ad3-04331ec17f24.ta' failed&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;make[1]: *** [5dbac793-f574-4871-8ad3-04331ec17f24.ta] Error 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;make[1]: Leaving directory '/opt/oe/iw/iw-5.4.24/optee_examples/aes/ta'&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Makefile:9: recipe for target 'all' failed&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;make: *** [all] Error 2&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 13:36:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/yocto-toolchains-compile-optee-example-code-ModuleNotFoundError/m-p/1227154#M169021</guid>
      <dc:creator>gonewithwind-peter</dc:creator>
      <dc:date>2021-02-05T13:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: yocto toolchains compile optee_example code ,ModuleNotFoundError: No module named 'Crypto'</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/yocto-toolchains-compile-optee-example-code-ModuleNotFoundError/m-p/1227184#M169024</link>
      <description>&lt;P&gt;finally, I have found the solutions. I did it 2 years ago for imx7 board. I remember again.&lt;BR /&gt;do not need to modify the recipe.&lt;BR /&gt;the toolchain does not include the Crypto package&lt;BR /&gt;just manually copy Crypto to toolchain(I do not know how to modify somewhere in the compilation process to copy directly to make it, if someone knows how to do .please tell me ,thank you)&lt;/P&gt;&lt;P&gt;sudo cp -r /home/rnd2/work/maaxboard/zeus/imx-yocto-bsp/maaxboard/build/tmp/sysroots-components/x86_64/python3-pycrypto-native/usr/lib/python3.7/site-packages/Crypto /opt/fsl-imx-wayland-lite/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/lib/python3.7/site-packages/.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have found the solution.&lt;/P&gt;&lt;P&gt;please install pycryptodome==3.7 on host opensuse mechine:&lt;/P&gt;&lt;P&gt;pip install pycryptodome==3.7&lt;BR /&gt;----&lt;BR /&gt;Before I played the old board maaxboard, the python is 2.6, but now it's 3.7. so need to install it.&lt;BR /&gt;sometimes ,I am confuse that the pycryptodome should be install in yocto toolcains (DEPENDS += "python3-pycryptodome-native python3-pyelftools-native") or in host machine.&lt;/P&gt;&lt;P&gt;I can find DEPENDS += "python3-pycryptodome-native python3-pyelftools-native" in optee_os.bb file,&lt;BR /&gt;so I installed my toolchains in my another ubuntu 18.or host machine. the compilation is passed ! so I thought the error was not in toolchain itself. it should be in host machine.&lt;BR /&gt;so I installed : pip install pycryptodome==3.7 on opensuse host. solved it!&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 15:08:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/yocto-toolchains-compile-optee-example-code-ModuleNotFoundError/m-p/1227184#M169024</guid>
      <dc:creator>gonewithwind-peter</dc:creator>
      <dc:date>2021-05-06T15:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: yocto toolchains compile optee_example code ,ModuleNotFoundError: No module named 'Crypto'</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/yocto-toolchains-compile-optee-example-code-ModuleNotFoundError/m-p/1273115#M173687</link>
      <description>&lt;P&gt;finally, I have found the solutions. I did it 2 years ago for imx7 board. I remember again.&lt;BR /&gt;do not need to modify the recipe.&lt;BR /&gt;the toolchain does not include the Crypto package&lt;BR /&gt;just manually copy Crypto to toolchain(I do not know how to modify somewhere in the compilation process to copy directly to make it, if someone knows how to do .please tell me ,thank you)&lt;/P&gt;&lt;P&gt;sudo cp -r /home/rnd2/work/maaxboard/zeus/imx-yocto-bsp/maaxboard/build/tmp/sysroots-components/x86_64/python3-pycrypto-native/usr/lib/python3.7/site-packages/Crypto /opt/fsl-imx-wayland-lite/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/lib/python3.7/site-packages/.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 15:07:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/yocto-toolchains-compile-optee-example-code-ModuleNotFoundError/m-p/1273115#M173687</guid>
      <dc:creator>gonewithwind-peter</dc:creator>
      <dc:date>2021-05-06T15:07:59Z</dc:date>
    </item>
  </channel>
</rss>

