Python 3.5.2 安装pyscard和pycrypto包失败,解决方法

最近在搞智能卡python测试平台环境,然后需要用到两个包(pyscard跟pycrypto),结果安装不了,试了好多方法,最后终于解决。

错误信息如下:

C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\Scripts>pip3 in
stall pyscard
DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Ple
ase upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will dro
p support for Python 3.5 in January 2021. pip 21.0 will remove support for this
functionality.


Installing collected packages: pyscard
    Running setup.py install for pyscard ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\administrator\appdata\local\programs\python\python35-32\
python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\User
s\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-han1gboq\\pyscard\\setup.py'"'"';
 __file__='"'"'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-han1gboq\\
pyscard\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=
f.read().replace('"'"'
\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __fi
le__, '"'"'exec'"'"'))' install --record 'C:\Users\ADMINI~1\AppData\Local\Temp\p
ip-record-ie5fkc7c\install-record.txt' --single-version-externally-managed --com
pile --install-headers 'c:\users\administrator\appdata\local\programs\python\pyt
hon35-32\Include\pyscard'
         cwd: C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-han1gboq\pyscard\


    Complete output (14 lines):
    running install
    running build
    running build_py
    running build_ext
    building 'smartcard.scard._scard' extension



ERROR: Command errored out with exit status 1: 'c:\users\administrator\appdata\l
ocal\programs\python\python35-32\python.exe' -u -c 'import sys, setuptools, toke
nize; sys.argv[0] = '"'"'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-
han1gboq\\pyscard\\setup.py'"'"'; __file__='"'"'C:\\Users\\ADMINI~1\\AppData\\Lo
cal\\Temp\\pip-install-han1gboq\\pyscard\\setup.py'"'"';f=getattr(tokenize, '"'"
'open'"'"', open)(__file__);code=f.read().replace('"'"'
\n'"'"', '"'"'\n'"'"');
f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Us
ers\ADMINI~1\AppData\Local\Temp\pip-record-ie5fkc7c\install-record.txt' --single
-version-externally-managed --compile --install-headers 'c:\users\administrator\
appdata\local\programs\python\python35-32\Include\pyscard' Check the logs for fu
ll command output.

 

Python 3.5.2 安装pyscard和pycrypto包失败,解决方法

原因是缺少环境,从下面的链接下载环境,visualcppbuildtools_full.exe

https://download.csdn.net/download/xjs38829890/13210240

下载后解压,然后根据自己python版本号选择安装对应环境

 

安装好环境后,打开pycharm,默认已经打开智能卡工程,点击菜单File=>Settings=>Project=>python interpreter=>python interpreter选择python3.5=>点击+,添加包=>

输入pyscard,并勾上specify version=>然后点击安装包按钮,等待安装成功,如下图:

同样操作安装pycrypto,然后结束。

注意:pip跟setuptools的版本太高也可能导致不能安装模块包,安装pyscard和pycrypto包成功时,pip跟setuptools的版本如下

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值