Python3.6 初次体验所遇的一些问题记录

我使用的是anaconda3,系统版本为window10 64位。项目中使用到了阿里云mqtt以及人工智能相关的东西,python打包exe时使用的是 pyinstaller 3.3.1版本。

使用anaconda在安装项目需要的各种包时非常方便,使用conda或者pip install xxx(包名)直接安装就可以了。这里主要记录下在打包exe时所遇到的主要问题:

1、pyinstaller打包exe文件时,递归太深:RecursionError: maximum recursion depth exceeded。

解决方法:在对应打包的.py 文件对应的.spec文件内,加入一下代码

  1. import sys

  2. sys.setrecursionlimit(5000)#5000这个数字可以随便设

2、OSError:Cannot load native module 'Crypto.Cipher._raw_ecb':Trying '_raw_ecb.cp36-win_amd64.pyd':cannot load library 'C:\Users\admin\AppData\Local\Temp\_MEI160382\Crypto\Util\..\Cipher\_raw_ecb.cp36-win_amb64.pyd':这个问题卡了我很久,前前后后尝试了很多中方法,粘出其中两种的链接

https://github.com/Legrandin/pycryptodome/issues/155

https://github.com/pyinstaller/pyinstaller/issues/2881

最后经过多次尝试和查找资料发现 Crypto对应的是pycryptodome包,所以出现这个问题。具体操作为pip list 查看当前安装包中是否有pycryptodome包,若有 则pip uninstall pycryptodome,卸载pycryptodome包,安装原包 pip install pycrypto(若失败使用 conda install pycrypto)。

3、pyinstaller打包AttributeError:type object pandas._TSObject has no attribute _reduce_cython_

python3.6的安装pandas==0.20.3

参考链接https://blog.csdn.net/qq_41185868/article/details/80601983

4、AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython

python3.6安装scipy-0.19.1

参考链接https://blog.csdn.net/qq_41185868/article/details/80903651

解决问题的过程很痛苦,但雨后的彩虹真的很美丽。希望对你有帮助。不足之处,请多指教。

猜你喜欢

转载自blog.csdn.net/u010664527/article/details/81094096