CyberSource / CyberSource/cybersource-rest-samples-python

Running samples: ModuleNotFoundError: No module named 'Crypto'

Open
#42 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
29
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Hi trying to follow the basic instructions to test the sample code.

From: https://github.com/CyberSource/cybersource-rest-samples-python

trying to run: Running the Samples From the Command Line

git clone https://github.com/CyberSource/cybersource-rest-samples-python.git

pip3 install cybersource-rest-client-python

# Install the Sample Codes (required for running Authentication samples only)
cd cybersource-rest-samples-python
pip3 install -e .


python3 samples/RiskManagement/DecisionManager/mark-as-suspect.py

Traceback (most recent call last):
  File "samples/RiskManagement/DecisionManager/mark-as-suspect.py", line 1, in <module>
    from CyberSource import *
  File "C:\Users\agawronski\AppData\Local\Programs\Python\Python37\lib\site-packages\CyberSource\__init__.py", line 686, in <module>
    from .utilities.flex.token_verification import TokenVerification
  File "C:\Users\agawronski\AppData\Local\Programs\Python\Python37\lib\site-packages\CyberSource\utilities\__init__.py", line 4, in <module>
    from .flex.token_verification import TokenVerification
  File "C:\Users\agawronski\AppData\Local\Programs\Python\Python37\lib\site-packages\CyberSource\utilities\flex\__init__.py", line 4, in <module>
    from .token_verification import TokenVerification
  File "C:\Users\agawronski\AppData\Local\Programs\Python\Python37\lib\site-packages\CyberSource\utilities\flex\token_verification.py", line 1, in <module>
    from . import rsa_verify
  File "C:\Users\agawronski\AppData\Local\Programs\Python\Python37\lib\site-packages\CyberSource\utilities\flex\rsa_verify.py", line 1, in <module>
    from Crypto.PublicKey import RSA
ModuleNotFoundError: No module named 'Crypto'

All of the commands prior to running mark-as-suspect.py were successful.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Running the Samples From the Command Line instructions and the samples/RiskManagement/DecisionManager/mark-as-suspect.py entry point. Follow the traceback through CyberSource/utilities/flex/token_verification.py and rsa_verify.py, then verify the documented installation steps allow the sample to run without ModuleNotFoundError: No module named 'Crypto'.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.