Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'Cryptodome' #1294

Closed
1 of 6 tasks
pal7769 opened this issue Jan 7, 2022 · 9 comments
Closed
1 of 6 tasks

No module named 'Cryptodome' #1294

pal7769 opened this issue Jan 7, 2022 · 9 comments
Labels
Resolution: External The bug was not in the code, caused by external factors

Comments

@pal7769
Copy link

pal7769 commented Jan 7, 2022

Bug report

Your Environment

  • Netflix add-on version: 1.18.3+matrix.1
  • Operating system version/name: Kodi 19.3
  • Device model: Raspberry Pi 3 Model B+

Used Operating system:

  • Android
  • iOS
  • Linux
  • OSX
  • Raspberry-Pi
  • Windows

Describe the bug

Opening Netflix Add-on leads to the following screen :
Netflix Add-on Error

The add-on encountered the following error:
The background services cannot be started due to this problem:
In you system is missing some required library to run Netflix.
Read how to install the add-on in the GitHub Readme.
Error details: cannot import name 'Padding' from 'Crypto.Util'
(/usr/lib/python3:dist-packages/Crypto/Util/init/py)

Expected behavior

Netflix add-on opening.

Actual behavior

Error page displayed

Steps to reproduce the behavior

Following CastagnaIT installation guidance and launch add-on from Add-on browser.

Debug log

The debug log can be found here:
kodi.old.log

Additional context or screenshots (if appropriate)

Thanks a lot for your help !

@github-actions github-actions bot added the Triage: Needed Issue that was just created and needs someone looking at it label Jan 7, 2022
@mattiasdh
Copy link

I confirm this bug, on a fresh install of the latest OSMC version, 2021-12.1.

The OSMC log files can be found here: https://paste.osmc.tv/popagoqevu

Previously the Netflix plugin worked on this setup (installed on previous version, upgraded to 2021-12.1).

PS: Building pycryptodomex gives an error, but completes succesfully:
`sudo pip3 install pycryptodomex
Collecting pycryptodomex
Using cached https://files.pythonhosted.org/packages/f6/06/e2ad9e93210790be86d36c6e2d5524ba54928c3ed27dd0be9b2ced7c57f1/pycryptodomex-3.12.0.zip
Building wheels for collected packages: pycryptodomex
Running setup.py bdist_wheel for pycryptodomex ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-wnyjtklo/pycryptodomex/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-pz0u3xes --python-tag cp37:
Testing support for clang
Target does not support clang
Testing support for gcc
Target does support gcc
Testing support for stdint.h header
Target does support stdint.h header
Testing support for 128-bit integer
Target does not support 128-bit integer
Testing support for cpuid.h header
Target does not support cpuid.h header
Testing support for intrin.h header
Target does not support intrin.h header
Testing support for posix_memalign
Target does support posix_memalign
Testing support for SSE2(intrin.h)
Target does not support SSE2(intrin.h)
Testing support for SSE2(x86intrin.h)
Target does not support SSE2(x86intrin.h)
Testing support for SSE2(emmintrin.h)
Target does not support SSE2(emmintrin.h)
Testing support for gcc
Target does support gcc
Warning: compiler does not support AESNI instructions
Warning: compiler does not support CLMUL instructions
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help

error: invalid command 'bdist_wheel'


Failed building wheel for pycryptodomex
Running setup.py clean for pycryptodomex
Failed to build pycryptodomex
Installing collected packages: pycryptodomex
Running setup.py install for pycryptodomex ... done
Successfully installed pycryptodomex`

@JarCme
Copy link

JarCme commented Jan 13, 2022

I also confirm this bug. I received the same output as @mattiasdh during the pycryptodomex build on the latest OSMC.

@CastagnaIT CastagnaIT added Resolution: External The bug was not in the code, caused by external factors and removed Triage: Needed Issue that was just created and needs someone looking at it labels Jan 13, 2022
@CastagnaIT
Copy link
Owner

this is not an addon bug is a problem of the python module or something on OSMC
the only thing that i could suggest is uninstall the installed pycryptodomex, then try install an older version

to see versions: pip3 install pycryptodomex==
then first uninstall pycryptodomex
after install an older version by specifing the version e.g. pip3 install pycryptodomex==x.y.z

@hirolala
Copy link

Had the same issue today on my Raspverry Pi 4 after an upgrade to Kodi 19.3 and Castagna's Netflix 1.18.3.
This is how I was able to fix it:

  • sudo pip install pycryptodome
    followed by
  • sudo pip3 install pycryptodomex
  • reboot

Hope that helps in your case too.

@mattiasdh
Copy link

Had the same issue today on my Raspverry Pi 4 after an upgrade to Kodi 19.3 and Castagna's Netflix 1.18.3. This is how I was able to fix it:

  • sudo pip install pycryptodome
    followed by
  • sudo pip3 install pycryptodomex
  • reboot

Hope that helps in your case too.

I confirm this worked. Had to install setuptools for python2 first, so pycryptodome could install. There must still be some python2 dependencies..
Thanks!

@pal7769
Copy link
Author

pal7769 commented Jan 24, 2022

Had the same issue today on my Raspverry Pi 4 after an upgrade to Kodi 19.3 and Castagna's Netflix 1.18.3. This is how I was able to fix it:

  • sudo pip install pycryptodome
    followed by
  • sudo pip3 install pycryptodomex
  • reboot

Hope that helps in your case too.

Workfing fine, thanks so much !

@pal7769 pal7769 closed this as completed Jan 24, 2022
@PackElend
Copy link

PackElend commented Dec 13, 2022

how do you get pip to work?
I get

osmc@osmc:~$ pip 
-bash: pip: command not found
osmc@osmc:~$ pip3
-bash: pip3: command not found

OSMC 10.0.3
Python is installed but how to use it?
image

playing around with the input from sudo apt install python-pycryptodome it has to be sudo apt install python3-pycryptodome but why?

osmc@osmc:~$ sudo apt install python3-pycryptodome
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  python3-pycryptodome
Progress: [ 80%] [##############################################............]
Need to get 9899 kB of archives.
After this operation, 35.7 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main armhf python3-pycryptodome armhf 3.9.7+dfsg1-1+b2 [9899 kB]
Fetched 9899 kB in 5s (2003 kB/s)

by the way that was my error, in case anyone else googles it:

2022-12-11 17:30:38.291 T:2917    ERROR <general>: [plugin.video.netflix (0)] Traceback (most recent call last):
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/default_crypto.py", line 16, in <module>
                                                       from Cryptodome.Random import get_random_bytes
                                                   ModuleNotFoundError: No module named 'Cryptodome'
                                                   
                                                   During handling of the above exception, another exception occurred:
                                                   
                                                   Traceback (most recent call last):
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/run_service.py", line 38, in init_servers
                                                       self.nf_server_instance = NFThreadedTCPServer((self.HOST_ADDRESS, select_port('NF_SERVER')))
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/services/http_server.py", line 68, in __init__
                                                       self.netflix_session = NetflixSession()
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/nfsession.py", line 28, in __init__
                                                       self.msl_handler = MSLHandler(self.nfsession)
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/msl_handler.py", line 47, in __init__
                                                       self._init_msl_handler()
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/msl_handler.py", line 62, in _init_msl_handler
                                                       self.msl_requests = MSLRequests(msl_data, self.nfsession)
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/msl_requests.py", line 42, in __init__
                                                       super().__init__(nfsession)
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/msl_request_builder.py", line 38, in __init__
                                                       from .default_crypto import DefaultMSLCrypto as MSLCrypto
                                                     File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/services/nfsession/msl/default_crypto.py", line 23, in <module>
                                                       from Crypto.Random import get_random_bytes
                                                   ModuleNotFoundError: No module named 'Crypto'

I also confirm this bug. I received the same output as @mattiasdh during the pycryptodomex build on the latest OSMC.

is that reported to OSMC?

@PackElend
Copy link

is a problem of the python module or something on OSMC

is that reported to the upstream projects as it still exists?

@TimeScience
Copy link

From a clean OSMC/Kodi install, I first had to install pip and then gcc before that worked, so the full command list is:

sudo apt-get update
sudo apt-get install python3-pip
sudo apt-get install gcc python3-dev
sudo pip3 install pycryptodome
sudo pip3 install pycryptodomex
reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: External The bug was not in the code, caused by external factors
Projects
None yet
Development

No branches or pull requests

7 participants