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}
随机推荐
- NPOI OFFICE 2007 文件格式不被支持,读取异常
在使用public XSSFWorkbook(FileInfo file) 时报文件格式不被支持,(读取异常/格式错误),根目录少了 ICSharpCode.SharpZipLib.dll . NPO ...
- jvm(5)---垃圾回收(回收算法和垃圾收集器)
1.垃圾回收算法 1.1 标记-清除算法 算法分为“标记”和“清除”阶段:首先标记出所有需要回收的对象,在标记完成后统一回收所有被标记的对象.它是最基础的收集算法,效率也很高,但是会带来两个明显的问题 ...
- java-socket-demo的实现
目录 前言 IO通讯模型 IO通讯模型简介 1. 阻塞式同步IO 2. 非阻塞式同步IO 3. 多路复用IO(阻塞+非阻塞) 4. 异步IO Java对IO模型的支持 注意点及实现方案 TCP粘包/拆 ...
- Sap MM 定义物料号码范围
Sap里面的物料编号可以设置内部给号或者外部给号,外部的意思就是通过手动输入,内部就是系统自动根据号码段分配. 物料号是根据物料类型定义范围的. 笔记 作者:明光烁亮 出处:http://www.cn ...
- element组件 MessageBox不能显示确认和取消按钮,记录正确使用方法!
这里是局部引入 调用方式:
- noip2019集训测试赛(二十一)Problem B: 红蓝树
noip2019集训测试赛(二十一)Problem B: 红蓝树 Description 有一棵N个点,顶点标号为1到N的树.N−1条边中的第i条边连接顶点ai和bi.每条边在初始时被染成蓝色.高桥君 ...
- RHEL 6.5 安装Docker
一,配置远程yum源二,下载依赖包1.安装downloadonly插件使用yum下载rpm包2.下载docker需要的依赖包三,安装docker(离线节点)1. 依次执行docker的安装包2. 启动 ...
- golang使用一个二叉树来实现一个插入排序
思路不太好理解,请用断点 package main import "fmt" type tree struct { value int left, right *tree } fu ...
- Android—网络请求
import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.net.HttpURLConnection; ...
- SqlServer中Index Seek的匹配规则(一)
我们知道在SqlServer中,索引对查询语句的优化起着巨大的作用,一般来说在执行计划中出现了Index Seek的步骤,我们就认为索引命中了.但是Index Seek中有两个部分是值得我们注意的,我 ...