0

Tried to import this code to our edx site encrypt data in python but it requires a package which is pycryptodome. Tried installing it using:

pip install pycryptodome

but it still shows an error everytime I call

from Crypto.Cipher import AES

.

WARNING:enterprise.utils:Could not import Registry from third_party_auth.provider
WARNING:enterprise.utils:cannot import name EnterpriseCustomerUser
Traceback (most recent call last):
  File "./manage.py", line 120, in <module>
    startup.run()
  File "/openedx/edx-platform/cms/startup.py", line 19, in run
    django.setup()
  File "/openedx/venv/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 116, in populate
    app_config.ready()
  File "/openedx/edx-platform/cms/djangoapps/contentstore/apps.py", line 22, in ready
    from .signals import handlers  # pylint: disable=unused-variable
  File "/openedx/edx-platform/cms/djangoapps/contentstore/signals/handlers.py", line 12, in <module>
    from contentstore.proctoring import register_special_exams
  File "/openedx/edx-platform/cms/djangoapps/contentstore/proctoring.py", line 19, in <module>
    from contentstore.views.helpers import is_item_in_course_tree
  File "/openedx/edx-platform/cms/djangoapps/contentstore/views/__init__.py", line 9, in <module>
    from .course import *
  File "/openedx/edx-platform/cms/djangoapps/contentstore/views/course.py", line 101, in <module>
    from Crypto.Cipher import AES
ImportError: No module named Crypto.Cipher

Sorry for a very vague question since I'm not really a python/django/open edx developer and was just tasked to support the project and did some heavy research but still no light.

Kelvin Barsana
  • 824
  • 12
  • 28
  • Does this answer your question? [ImportError: No module named Crypto.Cipher](https://stackoverflow.com/questions/19623267/importerror-no-module-named-crypto-cipher) – Karthik Sep 15 '20 at 07:42
  • @Karthik found that one and can't see to find the app.yaml file in server – Kelvin Barsana Sep 15 '20 at 07:51
  • even tried other answers from that thread as well :( – Kelvin Barsana Sep 15 '20 at 07:53
  • If `pip install pycryptodome` didn't work, then please show the full error message, and say which operating syttem you are using. If the install was successful but you still get the import error, then perhaps you didn't install it in the correct virtual environment. – Alasdair Sep 15 '20 at 08:03
  • Try to test if everything is installed well, with this, from command prompt: python -m Cryptodome.SelfTest – Tms91 Sep 15 '20 at 13:29
  • 1
    @Tms91 python -m Cryptodome.SelfTest worked well.. – Kelvin Barsana Sep 16 '20 at 15:00
  • take a look here https://stackoverflow.com/questions/19623267/importerror-no-module-named-crypto-cipher – Tms91 Sep 16 '20 at 15:42

0 Answers0