代码: sql = 'insert into book(book_name,book_desc,origin_price,publish_id,tag_id,book_img) values(%s,%s,%d,%d,%d,%s)' insert_data = save_df.values.tolist() commit_data = tuple([tuple([str(x[0]),str(x[1]),float(x[2]),int(x[3]),int(x[4]),str(x[5])]) for…
python在安装时,默认的编码是ascii, 当程序中出现非ascii编码时,python的处理常常会报这样的错 'ascii' codec can't encode characters python没办法处理非ascii编码的, 此时需要自己设置将python的默认编码,一般设置为utf8的编码格式. 查看python的默认编码 print sys.getdefaultencoding() 解决方法一(已通过验证,顺带也解决了我之前字符前一直加u的问题) 在python安装目录下,进入\P…
mac 上python编译报错No module named MySQLdb You installed python You did brew install mysql You did export PATH=$PATH:/usr/local/mysql/bin And finally, you did pip install MySQL-Python 出现 Collecting mysql-python Downloading MySQL-python-1.2.5.zip (108kB)…
一.调用python脚本报错 /usr/bin/env: python: No such file or directory 二.解决方法 原因是在windows上编写的脚本,使用dos2unix对脚本格式化一下 # yum install dos2unix -y # dos2unix sendSMS.py…
前面没有细讲,这里细述一下安装pycharm后,第一次打开pycharm运行python文件报错"No Python interpreter selected"问题的解决办法. 出现这个问题的原因目前知道的有两个: 1. 本地环境中没有安装Python,或者远程设置也没有: 2. 安装的pycharm的版本和你当前Python的版本不匹配也会出现这个问题: 如果是第一种情况,就去安装python 安装步骤详见我的博客安装python和pycharm,以及常见安装问题 ~ 如果是第二种情…
MongoDB解压报错gzip: stdin: not in gzip format的解决方法 在安装MongoDB时出现如下报错: [root@vm172--- mongodb]# tar -zxvf mongodb-linux-x86_64-.tgz gzip: stdin: not in gzip format tar: Child returned status tar: Error is not recoverable: exiting now 出现这种错误的排查方法如下: 1.用重命…
excel第一次打开报错 向程序发送命令时出错 多种解决办法含终极解决方法 office2007应该遇到“向程序发送命令时出现 问题”,设置为以管理员运行也不好用,重装office也不好用,下面介绍下解决办法. 击左上角的OFFICE图示,选择--Excel选项 选择--高级,并向下拖动滚动条 找到“忽略使用动态数据交换(DDE)的其他应用程序”,将前面的勾去掉,单击--确定 修改完毕,重新打开文件正常显示 些朋友们的excel表使用上述方法不好用,下面再介绍下另一种方法: 依次选中--加载项-…
CocoaPods pod install的时候报错:invalid byte sequence in UTF-8 (ArgumentError)解决办法: 基本可以确定是Podfile中的内容编码有问题,可以尝试用Xcode打开podfile ,然后再安装,如果还不行的话,直接找一个可用的podfile文件,用xcode打开后修改合格即可.…
原因:  真机调试IOS支付宝功能GDB出现 rsa_private read error : private key is NULL提示 调试iOS 支付宝SDK的时候,执行demo.把 Partner(合作商户 ID) Seller(账户 ID) RSA public key(支付宝公钥) RSA private key(商户私钥) 执行的时候,报错 rsa_private read error : private key is NULL 解决方法:  A.将私钥转成PKCS8替换一下原私钥…
转:Apache启动报错:could not bind to address [::]:443 解决办法 安装Apache服务器的时候,报如下错误: Installing the 'apache' service The 'apache' service is successfully installed.Testing httpd.conf....Errors reported here must be corrected before the service can be started.(…