element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum yocto zeus branch toolchains compile optee_example code ,ModuleNotFoundError: No module named 'Crypto'
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Single-Board Computers requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1 reply
  • Subscribers 56 subscribers
  • Views 1254 views
  • Users 0 members are here
Related

yocto zeus branch toolchains compile optee_example code ,ModuleNotFoundError: No module named 'Crypto'

gonewtinwind
gonewtinwind over 4 years ago

Hi all,

yocto zeus branch toolchains compile optee_example code ,ModuleNotFoundError: No module named 'Crypto'

(maaxbaord sumo branch worked well).

 

I use yocto toolchains to cross compile optee_example code,

error happened:

from Crypto.Signature import PKCS1_v1_5

ModuleNotFoundError: No module named 'Crypto'

but I find in toolchain folder, the Crypto folder is there:

./sysroots/aarch64-poky-linux/usr/lib/python3.7/site-packages/Crypto

It seems the compiler can not find it ?

I have added :

IMAGE_INSTALL_append +=" python3-pycryptodome " in local.conf

any help?

About 2 year ago,I posted a similar question #3441 but that was in yocto bitbake process in early, could not generate the yocto image.
Today I play another board, I can build the image and the toolchain, the new issue is the toolchain compiler can not find the 'Crypto'

Thank you.

error:

aarch64-poky-linux-gcc -fstack-protector-strong -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

make[1]: Leaving directory '/opt/oe/iw/iw-5.4.24/optee_examples/aes/host'

make -C ta CROSS_COMPILE="aarch64-poky-linux-" LDFLAGS=""

make[1]: Entering directory '/opt/oe/iw/iw-5.4.24/optee_examples/aes/ta'

CC aes_ta.o

CC user_ta_header.o

CPP ta.lds

LD 5dbac793-f574-4871-8ad3-04331ec17f24.elf

OBJDUMP 5dbac793-f574-4871-8ad3-04331ec17f24.dmp

OBJCOPY 5dbac793-f574-4871-8ad3-04331ec17f24.stripped.elf

SIGN 5dbac793-f574-4871-8ad3-04331ec17f24.ta

Traceback (most recent call last):

File "/usr/local/optee/sysroots/aarch64-poky-linux/usr/include/optee/export-user_ta_arm64//scripts/sign.py", line 78, in

main() 

File "/usr/local/optee/sysroots/aarch64-poky-linux/usr/include/optee/export-user_ta_arm64//scripts/sign.py", line 31, in main

from Crypto.Signature import PKCS1_v1_5 

ModuleNotFoundError: No module named 'Crypto'

/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

make[1]: *** [5dbac793-f574-4871-8ad3-04331ec17f24.ta] Error 1

make[1]: Leaving directory '/opt/oe/iw/iw-5.4.24/optee_examples/aes/ta'

Makefile:9: recipe for target 'all' failed

make: *** [all] Error 2

  • Sign in to reply
  • Cancel
Parents
  • gonewtinwind
    gonewtinwind over 4 years ago

    finally, I have found the solutions. I did  it 2 years ago for imx7 board. I remember again.

    do not need to modify the recipe.

    the toolchain does not include the Crypto package

    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)

     

     

     

     

    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/.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • gonewtinwind
    gonewtinwind over 4 years ago

    finally, I have found the solutions. I did  it 2 years ago for imx7 board. I remember again.

    do not need to modify the recipe.

    the toolchain does not include the Crypto package

    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)

     

     

     

     

    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/.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube