Possible problem with python on M1 Mac

Posted on
Tue Apr 20, 2021 10:17 am
davinci offline

Possible problem with python on M1 Mac

I am using panasonic_viera. Since I use an M1 Mac I get this error:

Code: Select all
 Script Error                    Panasonic Setup.py: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.so': cannot load library '/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecb.so': dlopen(/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecb.so, 2): no suitable image found.  Did find:
   /Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecb.so: mach-o, but wrong architecture
   /Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Cipher/_raw_ecb.so: mach-o, but wrong architecture.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecb.so', Trying '_raw_ecbmodule.so': cannot load library '/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecbmodule.so': dlopen(/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecbmodule.so, 2): image not found.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecbmodule.so'
   Script Error                    Exception Traceback (most recent call shown last):

     Panasonic Setup.py, line 6, at top level
     File "/Users/server/Library/Python/2.7/lib/python/site-packages/panasonic_viera/__init__.py", line 13, in <module>
       from Crypto.Cipher import AES
     File "/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Cipher/__init__.py", line 27, in <module>
       from Crypto.Cipher._mode_ecb import _create_ecb_cipher
     File "/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Cipher/_mode_ecb.py", line 47, in <module>
       """
     File "/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/_raw_api.py", line 297, in load_pycryptodome_raw_lib
       raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.so': cannot load library '/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecb.so': dlopen(/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecb.so, 2): no suitable image found.  Did find:
   /Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecb.so: mach-o, but wrong architecture
   /Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Cipher/_raw_ecb.so: mach-o, but wrong architecture.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecb.so', Trying '_raw_ecbmodule.so': cannot load library '/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecbmodule.so': dlopen(/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecbmodule.so, 2): image not found.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Util/../Cipher/_raw_ecbmodule.so'


Any ideas? I suspect the python version in Indigo/M1 to be the issue.
Last edited by davinci on Tue Apr 20, 2021 11:09 am, edited 1 time in total.

Posted on
Tue Apr 20, 2021 11:03 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Possible problem with python on M1 Mac

Edit that to change QUOTE to CODE tags so it's readable...

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Apr 20, 2021 11:10 am
davinci offline

Re: Possible problem with python on M1 Mac

Done :D

Posted on
Tue Apr 20, 2021 11:11 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Possible problem with python on M1 Mac

Much better. Did this work on a previous Mac? Have you tried installing the Crypto library?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Apr 20, 2021 11:21 am
davinci offline

Re: Possible problem with python on M1 Mac

Yes it worked before.
Crypto is generated in the python folder by pycryptodome.

Posted on
Tue Apr 20, 2021 11:35 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Possible problem with python on M1 Mac

Yeah, sounds like it hasn't been updated for Apple Silicon.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Apr 20, 2021 7:40 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Possible problem with python on M1 Mac

Copy/paste the result of this Terminal command into a reply for me:

Code: Select all
lipo -detailed_info /Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Cipher/_raw_ecb.so

Image

Posted on
Tue Apr 20, 2021 11:36 pm
davinci offline

Re: Possible problem with python on M1 Mac

Code: Select all
input file /Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Cipher/_raw_ecb.so is not a fat file
Non-fat file: /Users/server/Library/Python/2.7/lib/python/site-packages/Crypto/Cipher/_raw_ecb.so is architecture: arm64

Posted on
Thu Apr 22, 2021 11:45 am
davinci offline

Re: Possible problem with python on M1 Mac

Do you have any idea what it is?

Posted on
Thu Apr 22, 2021 5:59 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Possible problem with python on M1 Mac

I'm not sure about the specifics of the file, but the problem is that it is compiled for the M1 processor (arm64) but Indigo starts all plugins under the emulation mode (Rosetta) so it fails when that file is loaded. If that file was compiled as a universal binary (arm64 and x86_64) then it would work.

I believe it will also work in an upcoming release of Indigo which will be compiled for the M1 processor. No firm ETA yet, but we are actively working on it.

Image

Posted on
Fri Apr 23, 2021 1:36 am
davinci offline

Re: Possible problem with python on M1 Mac

That's it. I installed pycrpytodome with Terminal in Rosetta-Mode.
It works now. :)

I'm excited for the April(ish)-Release.


Thank you

Posted on
Sun Jun 20, 2021 4:23 am
davinci offline

Re: Possible problem with python on M1 Mac

Well it took us to late June but it is now working without Rosetta.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests