• 解决安装PyMySQL一直停在Building wheels for collected package:cryptography, cffi, pycparser的问题


    我的运行环境为:

    硬件:树莓派3b

    系统:ubuntu_meta_16.04.2

      因为项目需要,我在树莓派上搭建了基于python编程的Django的web框架,需要从MySQL中读取树莓派以及传感器的数据,而Python3是不带PyMySQL的,所以就需要我们自行安装。

      在安装过程中我一直卡在Building wheels for collected package:cryptography, cffi, pycparser


      经过1天的各种查找问题,最后终于还是被幸运女神眷顾!!!

    下面是我的解决办法:

    1、首先出现这个问题是因为在安装cryptography之前,缺少必要的包,这里我采取cryptography, cffi, pycparser单独安装的策略

    1)、安装 pycparser:

    pip3 install pycparser

    安装pycparser成功!!!

    2)、安装 cffi:

    pip3 install cffi

    这个时候安装失败,提示安装cryptography和cffi

    3)、安装 cryptography:

    pip3 install cryptography

     这时候一直卡在Building wheels for collected package:cryptography, cffi

     

    问题还是没有解决!

    2、经过各种查找资料,在官网中看到发现安装cryptography前需要安装:build-essential、libssl-dev、libffi-dev、python-dev 这四个包

    附上官网大大的地址:https://cryptography.io/en/latest/installation/#supported-platforms

    1)、cryptography需要使用OpenSSL,更新OpenSSL:

    sudo apt-get install openssl

     2)、安装build-essential、libssl-dev、libffi-dev、python-dev 这四个包

    sudo apt-get install build-essential libssl-dev libffi-dev python3-dev

    3)、安装 cffi:

    pip3 install cffi

    安装cffi成功!!!

     4)、安装 cryptography:

    pip3 install cryptography

     这时候也还是一直卡在Building wheels for collected package:cryptography

    难道幸运女神还没到!!!

    3、并没有放弃,有网上找了些资料,继续干

    1)、重新安装过 libffi:

    1.wget ftp://sourceware.org/pub/libffi/libffi-3.0.11.tar.gz
    2.tar zxvf libffi-3.0.11.tar.gz
    3.cd libffi-3.0.11/    
    4../configure
    5.make  
    6.sudo make install (这里需要注意一定要在sudo下进行安装,如果直接make install的话不会安装好)

    2)、重新安装过 PyMySQL:

    #使用 git 命令下载安装包安装(你也可以手动下载):
    $ git clone https://github.com/PyMySQL/PyMySQL
    $ cd PyMySQL/
    $ python3 setup.py install

    这个时候又一直卡在Building wheels for collected package:cryptography, cffi, pycparser

     3)、重新安装build-essential、libssl-dev、libffi-dev、python-dev 这四个包

    sudo apt-get install build-essential libssl-dev libffi-dev python-dev

     4)、重新安装 cryptography

    提示找不到合适的cryptography包

    5)、更新 pip:

    pip install --upgrade pip

     

    6)、重新安装 cryptography

    pip3 install cryptography

     

    还是一直卡在Building wheels for collected package:cryptography, cffi, pycparser

     7)、重新安装 pycparser:

    pip3 install pycparser

     

    这个时候 pycparser 完全成功!!!!

    8)、重新安装 cffi:

    pip3 install cffi

     

    这个时候 cffi 完全成功!!!!

     9)、重新安装 cryptography

    pip3 install cryptography

     

     这个时候 cryptography 完全成功!!!!

     10)、安装 PyMySQL:

    pip3 install PyMySQL

     

    成功!!!!赶快关个机,备份下

    天啊,鬼知道我经历了什么,一顿瞎操作终于是好了

    参考资料:https://www.cnblogs.com/xiaoli2018/p/4661604.html

            http://www.cnblogs.com/iOS-mainstay/p/5596608.html

             

  • 相关阅读:
    获取窗口句柄
    人生路上要懂得“刹车”(转)
    关于打开外部程序并且发送一个按键消息 (转)
    CString 和 char * 的相互转换
    iOS开发之了解iPhone中Get和Post方式(转)
    一些简单的Python代码,尝尝Python啥味道 (转)
    iphone 使用委托(delegate)在不同的窗口之间传递数据(转)
    UITextView控件的用法详解 (转)
    iPhone起步1: "Hello,World!" in iPhone Development (转)
    【引用】iphone xml解析流程
  • 原文地址:https://www.cnblogs.com/little-kwy/p/9418663.html
Copyright © 2020-2023  润新知