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

Installation of prerequisites ... but scripts do not find the libraries. #249

Closed
henrygab opened this issue May 6, 2024 · 1 comment
Closed

Comments

@henrygab
Copy link

henrygab commented May 6, 2024

Related to #216 .

Example run with the error:
https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606


Install clearly shows sslcrypto version 5.3 installed....

Run py-actions/py-dependency-install@v4
[*] Updating wheel package...
/Library/Frameworks/Python.framework/Versions/Current/bin/python -m pip install --upgrade wheel
Collecting wheel
  Downloading wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Downloading wheel-0.43.0-py3-none-any.whl (65 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.8/65.8 kB 4.4 MB/s eta 0:00:00
Installing collected packages: wheel
Successfully installed wheel-0.43.0
[*] Updating setuptools package...
/Library/Frameworks/Python.framework/Versions/Current/bin/python -m pip install --upgrade setuptools
Collecting setuptools
  Downloading setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB)
Downloading setuptools-69.5.1-py3-none-any.whl (894 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 894.6/894.6 kB 21.5 MB/s eta 0:00:00
Installing collected packages: setuptools
Successfully installed setuptools-69.5.1
[*] Updating pip package...
/Library/Frameworks/Python.framework/Versions/Current/bin/python -m pip install --upgrade pip
Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (24.0)
[*] Installing Python dependencies...
/Library/Frameworks/Python.framework/Versions/Current/bin/python -m pip install -r tools/requirements.txt
Collecting ansicolors==1.1.8 (from -r tools/requirements.txt (line 1))
  Downloading ansicolors-1.1.8-py2.py3-none-any.whl.metadata (9.0 kB)
Collecting sslcrypto==5.3 (from -r tools/requirements.txt (line 2))
  Downloading sslcrypto-5.3-py3-none-any.whl.metadata (6.0 kB)
Collecting pexpect==4.8.0 (from -r tools/requirements.txt (line 3))
  Downloading pexpect-4.8.0-py2.py3-none-any.whl.metadata (2.2 kB)
Collecting bitstring==4.1.2 (from -r tools/requirements.txt (line 4))
  Downloading bitstring-4.1.2-py3-none-any.whl.metadata (5.6 kB)
Collecting base58==1.0.3 (from sslcrypto==5.3->-r tools/requirements.txt (line 2))
  Downloading base58-1.0.3-py3-none-any.whl.metadata (565 bytes)
Collecting pyaes==1.6.1 (from sslcrypto==5.3->-r tools/requirements.txt (line 2))
  Downloading pyaes-1.6.1.tar.gz (28 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting ptyprocess>=0.5 (from pexpect==4.8.0->-r tools/requirements.txt (line 3))
  Downloading ptyprocess-0.[7](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:8:8).0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting bitarray<3.0.0,>=2.[8](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:8:9).0 (from bitstring==4.1.2->-r tools/requirements.txt (line 4))
  Downloading bitarray-2.9.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (34 kB)
Downloading ansicolors-1.1.8-py2.py3-none-any.whl (13 kB)
Downloading sslcrypto-5.3-py3-none-any.whl (34 kB)
Downloading pexpect-4.8.0-py2.py3-none-any.whl (5[9](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:8:10) kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.0/59.0 kB 16.7 MB/s eta 0:00:00
Downloading bitstring-4.1.2-py3-none-any.whl (59 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.0/60.0 kB 19.9 MB/s eta 0:00:00
Downloading base58-1.0.3-py3-none-any.whl (3.1 kB)
Downloading bitarray-2.9.2-cp312-cp312-macosx_[11](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:8:12)_0_arm64.whl (124 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [12](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:8:13)4.5/124.5 kB 12.4 MB/s eta 0:00:00
Downloading ptyprocess-0.7.0-py2.py3-none-any.whl ([13](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:8:14) kB)
Building wheels for collected packages: pyaes
  Building wheel for pyaes (setup.py): started
  Building wheel for pyaes (setup.py): finished with status 'done'
  Created wheel for pyaes: filename=pyaes-1.6.1-py3-none-any.whl size=26347 sha256=aaa41ba92f582c6cdcfc6df7c401bf9564451366fbc488f074076985cebfe394
  Stored in directory: /Users/runner/Library/Caches/pip/wheels/d9/43/32/ec313dd557e88e419489b9df40c04dad7b99576bde[16](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:8:17)2496f8
Successfully built pyaes
Installing collected packages: pyaes, ptyprocess, bitarray, base58, ansicolors, sslcrypto, pexpect, bitstring
Successfully installed ansicolors-1.1.8 base58-1.0.3 bitarray-2.9.2 bitstring-4.1.2 pexpect-4.8.0 ptyprocess-0.7.0 pyaes-1.6.1 sslcrypto-5.3

[*] The environment contains the following Python packages:
/Library/Frameworks/Python.framework/Versions/Current/bin/python -m pip list
Package    Version
---------- --------
ansicolors 1.1.8
base58     1.0.3
bitarray   2.9.2
bitstring  4.1.2
certifi    [20](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:8:21)24.2.2
pexpect    4.8.0
pip        24.0
ptyprocess 0.7.0
pyaes      1.6.1
setuptools 69.5.1
sslcrypto  5.3
wheel      0.43.0


But later step running python script cannot import the module

Run make check

===================================================================
Version info:      Iceman/fix_github_actions_python_install/757818f
Platform name:     Proxmark3 RDV[4](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:11:5)
PLATFORM:          PM3RDV4
PLATFORM_FPGA:     xc2s30
PLATFORM_SIZE:     [5](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:11:6)12
Platform extras:   No extra selected
Included options:  SMARTCARD FLASH -DRDV4 LF HITAG EM4x50 EM4x70 ZX8211 GENERAL_HF ISO15[6](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:11:7)93 LEGICRF ISO14443b ISO14443a ICLASS FELICA NFCBARCODE HFSNIFF HFPLOT
Standalone mode:   LF_SAMYRUN
===================================================================
[*] CHECK common

Iceman Proxmark3 test tool 

work directory: /Users/runner/work/proxmark3/proxmark3
git branch: heads/fix_github_actions_python_install
git sha: [7](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:11:8)57818f8aeb3ec30522d9980042a24cf7fd4f27e


Testing common:
hardnested tables exists                [ OK ] ✔️
simmodule fw file exists                [ OK ] ✔️
iCLASS dictionary exists                [ OK ] ✔️
MFC dictionary exists                   [ OK ] ✔️
MFDES dictionary exists                 [ OK ] ✔️
MFP dictionary exists                   [ OK ] ✔️
MFULC dictionary exists                 [ OK ] ✔️
T55XX dictionary exists                 [ OK ] ✔️

Testing tools:
xorcheck test                           [ OK ] ✔️ 
findbits test                           [ OK ] ✔️ 
findbits_test test                      [ OK ] ✔️ 
pm3_eml_mfd test                        [ OK ] ✔️ 
recover_pk test                         [ FAIL ] ❌ 
Execution trace:
Traceback (most recent call last):
  File "/Users/runner/work/proxmark3/proxmark3/tools/recover_pk.py", line [10](https://github.com/henrygab/proxmark3/actions/runs/8962240419/job/24610839606#step:11:11), in <module>
    import sslcrypto
ModuleNotFoundError: No module named 'sslcrypto'


The script in question starts as follows:

#!/usr/bin/env python3
import binascii
import sys
import sslcrypto
from colors import color

From what I understand, the above #!/usr/bin/env python3 is the preferred way to load up the current python interpreter. However, I'm not very knowledgable about how this GH Action installs, and have very limited exposure to MacOS.

Can you help me understand how your python installation Action "should" work, when the modules the action installs are later expected to be imported in python scripts?

e.g., do you setup and activate a named virtual environment, and if so, why doesn't it apply to the other steps?

@henrygab
Copy link
Author

henrygab commented May 8, 2024

Moved to official actions/setup-python instead.

@henrygab henrygab closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant