LudovicRousseau/pyscard

Unable to install 2.0.5

amingilani opened this issue · 2 comments

Your system information

  • Operating system used: MacOS Darwin computer.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 29 04:31:06 PDT 2022; root:xnu-7195.141.39~2/RELEASE_X86_64 x86_64
  • pyscard version: 2.0.5
  • Python version:Python 3.11.1

Please describe your issue in as much detail as possible:

Describe what you expected should happen.

pip install pyscard would install pyscard

Describe what did happen.

pip install pyscard did not install pyscard

Steps for reproducing this issue:

  1. Run pip install pyscard
  2. See error

Alternatively

  1. Run poetry add pyscard
  2. See error

Debug log

$ pip install pyscard
Collecting pyscard
  Using cached pyscard-2.0.5.tar.gz (150 kB)
  Preparing metadata (setup.py) ... done
Installing collected packages: pyscard
  DEPRECATION: pyscard is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for pyscard ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pyscard did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      running install
      /Users/username/.pyenv/versions/3.11.1/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      running build_ext
      building 'smartcard.scard._scard' extension
      swigging smartcard/scard/scard.i to smartcard/scard/scard_wrap.c
      swig -python -outdir smartcard/scard -DPCSCLITE -D__APPLE__ -o smartcard/scard/scard_wrap.c smartcard/scard/scard.i
      error: command 'swig' failed: No such file or directory
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pyscard

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
$

Closing this, I needed to run brew install swig first and then use pip to install.

$ pip install pyscard
Collecting pyscard
  Using cached pyscard-2.0.5.tar.gz (150 kB)
  Preparing metadata (setup.py) ... done
Installing collected packages: pyscard
  DEPRECATION: pyscard is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for pyscard ... done
Successfully installed pyscard-2.0.5

Note that poetry install still fails.

I am not sure that poetry is the way to go.
But I created #146
Thanks