python 安装模块报错

环境: ubuntu 17.04
安装模块:M2Crypto
错误error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
猜想:这可能是 linux 的 gcc(c++)的问题
尝试sudo apt-get install c++
sudo apt-get install gc++
重新运行,依然失败,向上追寻错误:
发现许多地方错误与 swig 相关
尝试sudo apt-get install swig
结果: 安装成功
google: swig 是什么

SWIG是一种软件开发工具。它能让一些脚本语言调用C/C++语言的接口。它实现的方法是,通过编译程序将C/C++的声明文件(.i文件)编译成C/C++的包装器源代码(.c或.cxx)。通过直接调用这样的包装器接口,脚本语言可以间接调用C/C++语言的程序接口。SWIG支持的语言有:Perl, Python, Tcl, Ruby, Guile, and Java。使用SWIG通常不需要修改被包装的源程序代码,并且只需要几分钟就能生成你所需要的包装器源代码文件。SWIG使用的场景包括:
1 将C语言的程序包装成解释性语言的接口。
2 快速原型开发
3 可交互式的DEBUG
4 将代码重构成脚本语言

环境: deepin 15.5
安装模块:dateutil
错误ImportError: No module named dateutil.relativedelta
猜想:dateutil 模块没有安装
尝试sudo apt-get install dateutil
结果: 失败 Could not find a version that satisfies the requirement dateutil (from versions: )
No matching distribution found for dateutil

google: sudo apt-get install python-dateutil
结果:安装成功
错误:SWIG/_m2crypto.i:54: Error: Unable to find 'openssl/opensslv.h'
SWIG/_m2crypto.i:60: Error: Unable to find 'openssl/safestack.h'
SWIG/_evp.i:12: Error: Unable to find 'openssl/opensslconf.h'
SWIG/_rc4.i:5: Error: Unable to find 'openssl/opensslconf.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'
error: command 'swig' failed with exit status 1

执行: sudo apt-get install libssl-dev

开始在虚拟环境中安装:
source 后:pip install python-dateutil

模块:rest_framework_jwt
pip install djangorestframework-jwt

模块: corsheaders
pip install django-cors-headers

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值