Project

General

Profile

Actions

Bug #5878

open

pySim shell: version fails with DistributionNotFound

Added by lynxis about 1 year ago. Updated 7 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
01/26/2023
Due date:
% Done:

0%

Spec Reference:

Description

I'm running into a DistributionNotFound error when running pysim.

  • debian bullseye
  • pcsclite
  • pipenv
  • swig
  • simcard congster prepaid sim

I would guess the dependencies aren't right or the pySim scripts needs to be installed by the setup.py.

git clone https://gitea.osmocom.org/sim-card/pysim.git
cd pysim
pipenv install -r requirements.txt
pipenv shell
./pySim-shell.py
version
(pysim-wiDMH_1-) lynxis@pysim:~/pysim$ ./pySim-shell.py  -p 0
Using PC/SC reader interface
Waiting for card...
Autodetection failed
Warning: Could not detect card type - assuming a generic card type...
Info: Card is of type: UICC-SIM
AIDs on card:
 USIM: a0000000871002ff4994208903100000 (EF.DIR)
Welcome to pySim-shell!
pySIM-shell (MF)> help

Documented commands (use 'help -v' for verbose/'help <topic>' for details):

ISO7816 Commands
================
activate_file  deactivate_file  open_channel  suspend_uicc
change_chv     disable_chv      select        unblock_chv 
close_channel  enable_chv       status        verify_chv  

pySim Commands
==============
bulk_script  dir   equip   intro  tree        version
desc         echo  export  reset  verify_adm

TS 102 222 Administrative Commands
==================================
create_df  delete_file           terminate_df
create_ef  terminate_card_usage  terminate_ef

pySim-shell built-in commands
=============================
alias  edit  history  py    run_pyscript  set    shortcuts
apdu   help  macro    quit  run_script    shell

pySIM-shell (MF)> version
EXCEPTION of type 'DistributionNotFound' occurred with message: 'The 'pySim' distribution was not found and is required by the application'
To enable full traceback, run the following command: 'set debug true'
pySIM-shell (MF)> set debug true
debug - was: False
now: True
pySIM-shell (MF)> version
Traceback (most recent call last):
  File "/home/lynxis/.local/share/virtualenvs/pysim-wiDMH_1-/lib/python3.9/site-packages/cmd2/cmd2.py", line 2129, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
  File "/home/lynxis/.local/share/virtualenvs/pysim-wiDMH_1-/lib/python3.9/site-packages/cmd2/cmd2.py", line 2559, in onecmd
    stop = func(statement)
  File "/home/lynxis/pysim/./pySim-shell.py", line 457, in do_version
    self.poutput(pkg_resources.get_distribution('pySim'))
  File "/home/lynxis/.local/share/virtualenvs/pysim-wiDMH_1-/lib/python3.9/site-packages/pkg_resources/__init__.py", line 481, in get_distribution
    dist = get_provider(dist)
  File "/home/lynxis/.local/share/virtualenvs/pysim-wiDMH_1-/lib/python3.9/site-packages/pkg_resources/__init__.py", line 357, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/home/lynxis/.local/share/virtualenvs/pysim-wiDMH_1-/lib/python3.9/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/lynxis/.local/share/virtualenvs/pysim-wiDMH_1-/lib/python3.9/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pySim' distribution was not found and is required by the application
EXCEPTION of type 'DistributionNotFound' occurred with message: 'The 'pySim' distribution was not found and is required by the application'

Actions #1

Updated by laforge about 1 year ago

it works for me, but I certainly did instlal pysim using setup.py in the past.

If you know of a way how to achieve this without having pysim installed, feel free to send a patch.

Actions #2

Updated by laforge about 1 year ago

laforge wrote in #note-1:

it works for me, but I certainly did instlal pysim using setup.py in the past.

If you know of a way how to achieve this without having pysim installed, feel free to send a patch.

adding Daniel and Lynxis, maybe they have an idea...

Actions #3

Updated by laforge 7 months ago

  • Assignee set to fixeria
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)