python2.7 安装pycrypto库报错
windows + python2.7
先安装VC包
https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi
再执行命令
pip install pycrypto
linux + python2.7
python安装pycrypto报错
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
查看gcc已经安装,最后找到解决办法安装python-dev库就可以
sudo apt-get install python-dev
安装完之后再安装pycrypto正常了。
~$ sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation: The following packages have unmet dependencies:
python-dev : Depends: libpython-dev (= 2.7.-) but it is not going to be installed
Depends: python2.-dev (>= 2.7.-~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
用aptitude 工具可以搞定
先:
sudo apt-get install aptitude
然后:
sudo aptitude install python-dev
之后会出现:
sudo aptitude install python-dev
The following NEW packages will be installed:
libexpat1-dev{ab} libpython-dev{a} libpython2.-dev{ab} python-dev
python2.-dev{ab}
packages upgraded, newly installed, to remove and not upgraded.
Need to get 28.1 MB of archives. After unpacking 42.1 MB will be used.
The following packages have unmet dependencies:
python2.-dev : Depends: python2. (= 2.7.-) but 2.7.-1ubuntu0~16.04. is installed.
Depends: libpython2. (= 2.7.-) but 2.7.-1ubuntu0~16.04. is installed.
libexpat1-dev : Depends: libexpat1 (= 2.1.-) but 2.1.-7ubuntu0.16.04. is installed.
libpython2.-dev : Depends: libpython2.-stdlib (= 2.7.-) but 2.7.-1ubuntu0~16.04. is installed.
Depends: libpython2. (= 2.7.-) but 2.7.-1ubuntu0~16.04. is installed.
open: ; closed: ; defer: ; conflict: .The following actions will resolve these dependencies: Keep the following packages at their current version: ) libexpat1-dev [Not Installed]
) libpython-dev [Not Installed]
) libpython2.-dev [Not Installed]
) python-dev [Not Installed]
) python2.-dev [Not Installed] Accept this solution? [Y/n/q/?] n 这里一定要n,因为给的solution是保持现在的状态,即不安装 The following actions will resolve these dependencies: Downgrade the following packages: ) libexpat1 [2.1.-7ubuntu0.16.04. (now) -> 2.1.- (xenial)]
) libpython2. [2.7.-1ubuntu0~16.04. (now) -> 2.7.- (xenial)]
) libpython2.-minimal [2.7.-1ubuntu0~16.04. (now) -> 2.7.- (xenial)]
) libpython2.-stdlib [2.7.-1ubuntu0~16.04. (now) -> 2.7.- (xenial)]
) python2. [2.7.-1ubuntu0~16.04. (now) -> 2.7.- (xenial)]
) python2.-minimal [2.7.-1ubuntu0~16.04. (now) -> 2.7.- (xenial)] Accept this solution? [Y/n/q/?] y 接受新状态就可以安装了
python2.7 安装pycrypto库报错的更多相关文章
- pip安装第三方库报错Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))...
pip安装第三方库时报错Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))...,详细报错见下 ...
- python安装第三方库报错visual c++ 14.0 is required
使用python安装第三方库时报错如下: error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ ...
- pycharm 安装第三方库报错:AttributeError: 'module' object has no attribute 'main'
pip升级到 10.0.1 之后 老版的pycharm 使用pip安装第三方库的时候会报错,报错如上图所示: 其主要原因是 新版的 pip 更改了 部分api 将其中 pip.main() 改为 pi ...
- 解决pycharm安装python库报错问题
最近在玩微信图灵机器人,不过我安装有一些库,安装报错,上网找了很久,总结有两种方法,记录一下 方法一: 手动安装,直接到官网你需要的python库下载到本地, 放在安装python路径,C:\User ...
- Python3.7安装pyaudio库报错问题及修复
本人今天在使用python编写语音相关项目是需要引用pyaudio库,结果发现引用失败,刚开始报错内容如下: 说让我升级pip,然后我就按照提示升级了pip,然后又再次尝试安装pyaudio库,然后还 ...
- CocoaPods升级安装三方库报错
CocoaPods升级后(最新版本1.0.1),安装第三方库的时候会报如下错误: The dependency `AFNetworking (~> 3.1.0)` is not used in ...
- 使用pip安装第三方库报错记录
今天在使用pycharm导入第三方库的时候,报了好多超时错误,还有标题中的找不到版本,应该是网络的原因,记录下解决的办法: raise ReadTimeoutError(self._pool, Non ...
- python安装wordcloud库报错
pip install wordcloud 安装成了这样 红彤彤的一片 解决方法 https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud 下载对应版 ...
- python安装第三方库报错:Cannot uninstall '***'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
pip install --ignore-installed ${PACKAGE_NAME}
随机推荐
- [lodop]css样式after、before添加content内容之前和之后
css样式可以在内容之前和之后加内容.格式是:css类名:before{content:在之前加的内容}css类名:after{content:在之后加的内容}这种写法在LODOP里直接测试是不行的, ...
- 欧姆龙PLC_CP1H_CRC校验
1.简介 欧姆龙CP1H PLC的CRC校验.CP1H没有CRC校验指令或者功能块,在串口自由协议通信中,如果涉及到CRC校验,需要手动计算CRC值,本程序是一个输入数据,自动计算CRC校验码的程序. ...
- Spring 消息转换器和注解控制器
目录 1.什么是消息转换器? 2.消息转换器结构:HttpMessageConverter 3.Spring 调用逻辑 3.1 HandlerMethodArgumentResolver 接口 和 H ...
- Mac下安装VirtualBox并在VirtualBox中安装CentOS7
VirtualBox (百科)VirtualBox 是一款开源虚拟机软件.VirtualBox 是由德国 Innotek 公司开发,由Sun Microsystems公司Sun Microsystem ...
- 基于java的简单Socket编程
1TCP协议与UDP协议 1.1 TCP TCP是(Tranfer Control Protocol)的简称,是一种面向连接的保证可靠传输的协议.通过TCP协议传输 ...
- shiro 的session持久化
对于分布式系统,一般都牵扯到Session共享问题,而想实现Session共享,就要实现Session的持久化操作,即是将内存中的Session持久化至缓存数据库. SessionDAO是Shiro提 ...
- SQL Server 数据库清空ldf日志文件
USE [master] ALTER DATABASE [DB_Develop] SET RECOVERY SIMPLE WITH NO_WAIT ALTER DATABASE [DB_Develop ...
- hexo 个人博客搭建
Hexo 小插曲介绍 虽然标题是第一次写博客. 但是我这个困难户至少挣扎了1年多了, 一直下不去手.今天可算是开了个头. 贵在坚持吧 抽时间介绍我的hexo安装历程吧,今天实在是有点困了,要睡觉了. ...
- jpa简单demo调试druid
Druid连接池配置见https://www.cnblogs.com/blindjava/p/11504524.html pom <dependency> <groupId>m ...
- Java 发送http GET/POST请求
最近项目里面需要用到Java发送http请求,由于发送https请求有点复杂,暂时不考虑 HttpURLConnection HttpURLConnection是一种多用途.轻量极的HTTP客户端,使 ...