热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ubuntu14.04.5安装paramiko模块pipinstallparamiko出现一堆问题的解决过程

为什么80%的码农都做不了架构师?根据paramiko官网的指示,可以使用pip安装paramiko模块默认安装最新的稳定版本的paramiko使

为什么80%的码农都做不了架构师?>>>   hot3.png

根据paramiko官网的指示,可以使用pip安装paramiko模块默认安装最新的稳定版本的paramiko
使用pip安装paramiko

sudo pip3 install paramiko

出现一堆错误信息:

liuxin@sunshine-virtual-machine:~/work/python/python/socket/socketserver/ftp_client$ sudo pip3 install paramiko
[sudo] password for liuxin:
对不起,请重试。
[sudo] password for liuxin:
对不起,请重试。
[sudo] password for liuxin:
Downloading/unpacking paramikoDownloading paramiko-2.4.0-py2.py3-none-any.whl (192kB): 192kB downloaded
Downloading/unpacking bcrypt>=3.1.3 (from paramiko)Downloading bcrypt-3.1.4.tar.gz (42kB): 42kB downloadedRunning setup.py (path:/tmp/pip_build_root/bcrypt/setup.py) egg_info for package bcryptwarning: no previously-included files found matching 'requirements.txt'warning: no previously-included files found matching 'tasks.py'warning: no previously-included files found matching '.travis.yml'warning: no previously-included files found matching 'wheel-scripts'warning: no previously-included files found matching 'Jenkinsfile'warning: no previously-included files found matching '.jenkins'warning: no previously-included files matching '*' found under directory '.jenkins'warning: no previously-included files matching '*' found under directory 'wheel-scripts'no previously-included directories found matching '.travis'
Downloading/unpacking pynacl>=1.0.1 (from paramiko)Downloading PyNaCl-1.2.1.tar.gz (3.3MB): 3.3MB downloadedRunning setup.py (path:/tmp/pip_build_root/pynacl/setup.py) egg_info for package pynaclPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundc/_cffi_backend.c:15:17: fatal error: ffi.h: 没有那个文件或目录#include ^compilation terminated.Traceback (most recent call last):File "/usr/lib/python3.4/distutils/unixccompiler.py", line 116, in _compileextra_postargs)File "/usr/lib/python3.4/distutils/ccompiler.py", line 909, in spawnspawn(cmd, dry_run=self.dry_run)File "/usr/lib/python3.4/distutils/spawn.py", line 36, in spawn_spawn_posix(cmd, search_path, dry_run=dry_run)File "/usr/lib/python3.4/distutils/spawn.py", line 162, in _spawn_posix% (cmd, exit_status))distutils.errors.DistutilsExecError: command 'i686-linux-gnu-gcc' failed with exit status 1During handling of the above exception, another exception occurred:Traceback (most recent call last):File "/usr/lib/python3.4/distutils/core.py", line 148, in setupdist.run_commands()File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commandsself.run_command(cmd)File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 185, in runcmd = self.call_command('install_lib', warn_dir=0)File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 171, in call_commandself.run_command(cmdname)File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 21, in runself.build()File "/usr/lib/python3.4/distutils/command/install_lib.py", line 109, in buildself.run_command('build_ext')File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 49, in run_build_ext.run(self)File "/usr/lib/python3.4/distutils/command/build_ext.py", line 339, in runself.build_extensions()File "/usr/lib/python3.4/distutils/command/build_ext.py", line 448, in build_extensionsself.build_extension(ext)File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 178, in build_extension_build_ext.build_extension(self,ext)File "/usr/lib/python3.4/distutils/command/build_ext.py", line 503, in build_extensiondepends=ext.depends)File "/usr/lib/python3.4/distutils/ccompiler.py", line 574, in compileself._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)File "/usr/lib/python3.4/distutils/unixccompiler.py", line 118, in _compileraise CompileError(msg)distutils.errors.CompileError: command 'i686-linux-gnu-gcc' failed with exit status 1During handling of the above exception, another exception occurred:Traceback (most recent call last):File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1025, in run_setuprun_setup(setup_script, args)File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 50, in run_setuplambda: execfile(File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 100, in runreturn func()File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 52, in {'__file__':setup_script, '__name__':'__main__'}File "/usr/lib/python3/dist-packages/setuptools/compat.py", line 78, in execfileexec(compile(source, fn, 'exec'), globs, locs)File "setup.py", line 236, in cmdclass={File "/usr/lib/python3.4/distutils/core.py", line 163, in setupraise SystemExit("error: " + str(msg))SystemExit: error: command 'i686-linux-gnu-gcc' failed with exit status 1During handling of the above exception, another exception occurred:Traceback (most recent call last):File "", line 17, in File "/tmp/pip_build_root/pynacl/setup.py", line 251, in "Programming Language :: Python :: 3.6",File "/usr/lib/python3.4/distutils/core.py", line 108, in setup_setup_distribution = dist = klass(attrs)File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 239, in __init__self.fetch_build_eggs(attrs.pop('setup_requires'))File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 264, in fetch_build_eggsreplace_conflicting=TrueFile "/usr/lib/python3/dist-packages/pkg_resources.py", line 620, in resolvedist = best[req.key] = env.best_match(req, ws, installer)File "/usr/lib/python3/dist-packages/pkg_resources.py", line 858, in best_matchreturn self.obtain(req, installer) # try and download/installFile "/usr/lib/python3/dist-packages/pkg_resources.py", line 870, in obtainreturn installer(requirement)File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 314, in fetch_build_eggreturn cmd.easy_install(req)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 616, in easy_installreturn self.install_item(spec, dist.location, tmpdir, deps)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 646, in install_itemdists = self.install_eggs(spec, download, tmpdir)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggsreturn self.build_and_install(setup_script, setup_base)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_installself.run_setup(setup_script, setup_base, args)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1028, in run_setupraise DistutilsError("Setup script exited with %s" % (v.args[0],))distutils.errors.DistutilsError: Setup script exited with error: command 'i686-linux-gnu-gcc' failed with exit status 1Complete output from command python setup.py egg_info:Package libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variableNo package 'libffi' foundc/_cffi_backend.c:15:17: fatal error: ffi.h: 没有那个文件或目录#include ^compilation terminated.Traceback (most recent call last):File "/usr/lib/python3.4/distutils/unixccompiler.py", line 116, in _compileextra_postargs)File "/usr/lib/python3.4/distutils/ccompiler.py", line 909, in spawnspawn(cmd, dry_run=self.dry_run)File "/usr/lib/python3.4/distutils/spawn.py", line 36, in spawn_spawn_posix(cmd, search_path, dry_run=dry_run)File "/usr/lib/python3.4/distutils/spawn.py", line 162, in _spawn_posix% (cmd, exit_status))distutils.errors.DistutilsExecError: command 'i686-linux-gnu-gcc' failed with exit status 1During handling of the above exception, another exception occurred:Traceback (most recent call last):File "/usr/lib/python3.4/distutils/core.py", line 148, in setupdist.run_commands()File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commandsself.run_command(cmd)File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 185, in runcmd = self.call_command('install_lib', warn_dir=0)File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 171, in call_commandself.run_command(cmdname)File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 21, in runself.build()File "/usr/lib/python3.4/distutils/command/install_lib.py", line 109, in buildself.run_command('build_ext')File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_commandself.distribution.run_command(command)File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_commandcmd_obj.run()File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 49, in run_build_ext.run(self)File "/usr/lib/python3.4/distutils/command/build_ext.py", line 339, in runself.build_extensions()File "/usr/lib/python3.4/distutils/command/build_ext.py", line 448, in build_extensionsself.build_extension(ext)File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 178, in build_extension_build_ext.build_extension(self,ext)File "/usr/lib/python3.4/distutils/command/build_ext.py", line 503, in build_extensiondepends=ext.depends)File "/usr/lib/python3.4/distutils/ccompiler.py", line 574, in compileself._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)File "/usr/lib/python3.4/distutils/unixccompiler.py", line 118, in _compileraise CompileError(msg)distutils.errors.CompileError: command 'i686-linux-gnu-gcc' failed with exit status 1During handling of the above exception, another exception occurred:Traceback (most recent call last):File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1025, in run_setuprun_setup(setup_script, args)File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 50, in run_setuplambda: execfile(File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 100, in runreturn func()File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 52, in {'__file__':setup_script, '__name__':'__main__'}File "/usr/lib/python3/dist-packages/setuptools/compat.py", line 78, in execfileexec(compile(source, fn, 'exec'), globs, locs)File "setup.py", line 236, in cmdclass={File "/usr/lib/python3.4/distutils/core.py", line 163, in setupraise SystemExit("error: " + str(msg))SystemExit: error: command 'i686-linux-gnu-gcc' failed with exit status 1During handling of the above exception, another exception occurred:Traceback (most recent call last):File "", line 17, in File "/tmp/pip_build_root/pynacl/setup.py", line 251, in "Programming Language :: Python :: 3.6",File "/usr/lib/python3.4/distutils/core.py", line 108, in setup_setup_distribution = dist = klass(attrs)File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 239, in __init__self.fetch_build_eggs(attrs.pop('setup_requires'))File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 264, in fetch_build_eggsreplace_conflicting=TrueFile "/usr/lib/python3/dist-packages/pkg_resources.py", line 620, in resolvedist = best[req.key] = env.best_match(req, ws, installer)File "/usr/lib/python3/dist-packages/pkg_resources.py", line 858, in best_matchreturn self.obtain(req, installer) # try and download/installFile "/usr/lib/python3/dist-packages/pkg_resources.py", line 870, in obtainreturn installer(requirement)File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 314, in fetch_build_eggreturn cmd.easy_install(req)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 616, in easy_installreturn self.install_item(spec, dist.location, tmpdir, deps)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 646, in install_itemdists = self.install_eggs(spec, download, tmpdir)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggsreturn self.build_and_install(setup_script, setup_base)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_installself.run_setup(setup_script, setup_base, args)File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1028, in run_setupraise DistutilsError("Setup script exited with %s" % (v.args[0],))distutils.errors.DistutilsError: Setup script exited with error: command 'i686-linux-gnu-gcc' failed with exit status 1----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pynacl
Storing debug log for failure in /home/liuxin/.pip/pip.log

 

查看错误日志时发现一条信息:

No package 'libffi' found

所以使用下面安装libffi:

sudo apt-get install libffi-dev

再次使用pip3安装paramiko模块又提示如下错误:

error in cryptography setup command: Invalid environment marker: python_version <&#39;3&#39;

别灰心&#xff0c;出现别的错误说明有进展
上网搜了一下这个错误找到一个解决方案&#xff1a;https://github.com/ansible/ansible/issues/31741
121255_aFaq_2683971.png
看到没&#xff1f;它也在安装libffi&#xff0c;至少说明我们的方向没有错&#xff0c; 按照大神的提示执行一下指令&#xff1a;

sudo pip3 install --upgrade setuptools
sudo apt-get install libffi-dev libssl-dev

再次安装paramiko

sudo pip3 install paramiko

安装成功&#xff0c;打开python3解释器测试模块&#xff1a;

Successfully installed paramiko pyasn1 bcrypt cryptography pynacl cffi idna asn1crypto pycparser
Cleaning up...
liuxin&#64;sunshine-virtual-machine:~/work/python/python/socket/socketserver/ftp_client$ python3
Python 3.4.3 (default, Nov 28 2017, 16:40:41)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
>>>

ok&#xff0c; 搞定

 

总结&#xff1a;
    在使用pip3安装paramiko模块执行以下指令&#xff1a;

sudo pip3 install --upgrade setuptools
sudo apt-get install libffi-dev libssl-dev
sudo pip3 install paramiko

 


转载于:https://my.oschina.net/enfp/blog/1607243


推荐阅读
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • 树莓派语音控制的配置方法和步骤
    本文介绍了在树莓派上实现语音控制的配置方法和步骤。首先感谢博主Eoman的帮助,文章参考了他的内容。树莓派的配置需要通过sudo raspi-config进行,然后使用Eoman的控制方法,即安装wiringPi库并编写控制引脚的脚本。具体的安装步骤和脚本编写方法在文章中详细介绍。 ... [详细]
  • 本文介绍了在Ubuntu下制作deb安装包及离线安装包的方法,通过备份/var/cache/apt/archives文件夹中的安装包,并建立包列表及依赖信息文件,添加本地源,更新源列表,可以在没有网络的情况下更新系统。同时提供了命令示例和资源下载链接。 ... [详细]
  • 本文介绍了在Android Studio中使用命令行build gradle的方法,并解决了一些常见问题,包括手动配置gradle环境变量和解决External Native Build Issues的方法。同时提供了相关参考文章链接。 ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • Android源码深入理解JNI技术的概述和应用
    本文介绍了Android源码中的JNI技术,包括概述和应用。JNI是Java Native Interface的缩写,是一种技术,可以实现Java程序调用Native语言写的函数,以及Native程序调用Java层的函数。在Android平台上,JNI充当了连接Java世界和Native世界的桥梁。本文通过分析Android源码中的相关文件和位置,深入探讨了JNI技术在Android开发中的重要性和应用场景。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • 基于dlib的人脸68特征点提取(眨眼张嘴检测)python版本
    文章目录引言开发环境和库流程设计张嘴和闭眼的检测引言(1)利用Dlib官方训练好的模型“shape_predictor_68_face_landmarks.dat”进行68个点标定 ... [详细]
  • CEPH LIO iSCSI Gateway及其使用参考文档
    本文介绍了CEPH LIO iSCSI Gateway以及使用该网关的参考文档,包括Ceph Block Device、CEPH ISCSI GATEWAY、USING AN ISCSI GATEWAY等。同时提供了多个参考链接,详细介绍了CEPH LIO iSCSI Gateway的配置和使用方法。 ... [详细]
  • python3 nmap函数简介及使用方法
    本文介绍了python3 nmap函数的简介及使用方法,python-nmap是一个使用nmap进行端口扫描的python库,它可以生成nmap扫描报告,并帮助系统管理员进行自动化扫描任务和生成报告。同时,它也支持nmap脚本输出。文章详细介绍了python-nmap的几个py文件的功能和用途,包括__init__.py、nmap.py和test.py。__init__.py主要导入基本信息,nmap.py用于调用nmap的功能进行扫描,test.py用于测试是否可以利用nmap的扫描功能。 ... [详细]
  • 本文介绍了在Ubuntu系统中清理残余配置文件和无用内容的方法,包括清理残余配置文件、清理下载缓存包、清理不再需要的包、清理无用的语言文件和清理无用的翻译内容。通过这些清理操作可以节省硬盘空间,提高系统的运行效率。 ... [详细]
  • 本文介绍了在Ubuntu 11.10 x64环境下安装Android开发环境的步骤,并提供了解决常见问题的方法。其中包括安装Eclipse的ADT插件、解决缺少GEF插件的问题以及解决无法找到'userdata.img'文件的问题。此外,还提供了相关插件和系统镜像的下载链接。 ... [详细]
  • tcpdump 4.5.1 crash 深入分析
    tcpdump 4.5.1 crash 深入分析 ... [详细]
  • Ubuntu 用户安装 Linux Kernel 3.15 RC1
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
author-avatar
mobiledu2502920795
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有