python3.6安装包报错_通过离线安装包解决了 from cryptography.hazmat.bindings._openssl import ffi, lib ImportError: /u...

场景:内网服务器不能上外网(代理也不通!),

之前安装了PYTHON的几个安装包,但不是知道为什么无法使用PARAMIKO这个模块

在导入 from cryptography.hazmat.bindings._openssl import ffi, lib 的时候会

报错:

from cryptography.hazmat.bindings._openssl import ffi, lib

ImportError: /usr/local/python36/lib/python3.6/site-packages/cryptography-2.2.2-py3.6-linux-x86_64.egg/cryptography/hazmat/bindings/_openssl.abi3.so: undefined symbol: d2i_DHxparams

找了好多资料都没有解决,没办法只好放弃原有的安装方式,之前是一个个手动下载模块,传到内网服务器后 通过PYTHON SETUP.PY INSTALL 安装。

现在打算在外网通过PIP 下载模块,再打包到内网服务器,然后利用pip安装,这样可以避免模块之间依赖的问题

注:以下步骤是安装单个包的,下例子以安装paramiko包(较多依赖)说明

步骤说明:

1、使用pip download 命令下载wheel文件至下载目录~/pippackage目录下

pip install paramiko --download ~/pippackage/

或者

[root@master pippackage]# pip download paramiko --src ./

[djuser@localhost ~]$ mkvirtualenv py3test

New python executable in /home/djuser/.virtualenvs/py3test/bin/python2

Also creating executable in /home/djuser/.virtualenvs/py3test/bin/python

Installing setuptools, pip, wheel...done.

virtualenvwrapper.user_scripts creating /home/djuser/.virtualenvs/py3test/bin/predeactivate

virtualenvwrapper.user_scripts creating /home/djuser/.virtualenvs/py3test/bin/postdeactivate

virtualenvwrapper.user_scripts creating /home/djuser/.virtualenvs/py3test/bin/preactivate

virtualenvwrapper.user_scripts creating /home/djuser/.virtualenvs/py3test/bin/postactivate

virtualenvwrapper.user_scripts creating /home/djuser/.virtualenvs/py3test/bin/get_env_details

(py3test) [djuser@localhost ~]$ lssitepackages

easy_install.py pip pkg_resources s

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值