python版本:3.8.6

问题:

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

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

学习爬虫时,安装pycrypto库(用于AES、RAS等多种加密)出现问题,是因为python版本较高,pycrypto在新版本中可能已经失效,所以无法安装,使用pycryptodome替代就可以解决这个问题

解决:

如果已经安装了,需要先卸载(两个包会发生冲突):

pip uninstall pycrypto

安装:

pip install pycryptodome

安装完毕:

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐