Import Error: No module named Keys with AnyCloud_OTA_Using_HTTPS

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BiM_4640481
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Hi,

I modified AnyCloud_OTA_Using_HTTPS in MTB2.2 to use external flash for OTA and its working properly. Now I am trying to run this project on another laptop with MTB 2.2. I copied the project and imported it in MTB. When I tried to build it is throwing the following error: 

Import Error: No module named Keys

 

Following is the snippet of error log:

  File "C:\USER\Work\mtb_shared\anycloud-ota\release-v2.0.0\source\mcuboot\scripts\imgtool\main.py", line 21, in <module>

    import imgtool.keys as keys

ImportError: No module named keys

make[1]: *** [../mtb_shared/core-make/release-v1.7.2/make/core/build.mk:556: CY_BUILD_app_postbuild] Error 1

make: *** [../mtb_shared/core-make/release-v1.7.2/make/core/main.mk:426: secondstage_build] Error 2

"C:/Users/USER/ModusToolbox/tools_2.2/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_MAKE_IDE_VERSION=2.2 CY_IDE_TOOLS_DIR=C:/Users/USER/ModusToolbox/tools_2.2 -j4 all" terminated with exit code 2. Build might be incomplete.

Can anyone help me with the correct steps to be followed?

Thanks,

Binsy M S

 

 

 

 

0 Likes
1 Solution

Hello Dheeraj,

Thanks for the reply.

I used the code you suggested from command prompt. This alone didn't solve my issue as MTB was referring to the default python present in my laptop.  So I added a new PATH environment variable pointing to the python present in ModusToolBox/Tools folder (\ModusToolbox\tools_2.2\python). And kept this newly added one as the top most one in the list of PATH environment variables. With all these changes now its working .

Thanks,

Binsy M S

View solution in original post

0 Likes
2 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @BiM_4640481 ,

I believe one or more modules were not installed when installing cysecuretools using pip. The error you are facing is because of the cryptography module not being installed. 

Please run the following code in your command prompt:

>> pip install cryptography --force-reinstall

After running this, it should work properly. In case you see any other module related error, follow the same process to reinstall the modules.

Let me know if it works 🙂

Regards,
Dheeraj

0 Likes

Hello Dheeraj,

Thanks for the reply.

I used the code you suggested from command prompt. This alone didn't solve my issue as MTB was referring to the default python present in my laptop.  So I added a new PATH environment variable pointing to the python present in ModusToolBox/Tools folder (\ModusToolbox\tools_2.2\python). And kept this newly added one as the top most one in the list of PATH environment variables. With all these changes now its working .

Thanks,

Binsy M S

0 Likes