![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
wx_17819660359
这个作者很懒,什么都没留下…
展开
-
2018年史上最全的Eclipse安装Python编辑工具
Python是一门人工智能语言,小学生都自学Python了,你还不赶紧行动么。工欲善其事,必先利器。来吧工具/原料:EclipsePython第一步:点击Help,再点击Install New Software第二步:点击“Add”,弹出框中name栏输入:pydevLocation:http://pydev.org/updates点击ok第三步:选...原创 2018-08-27 22:53:46 · 1054 阅读 · 0 评论 -
pip install mysqlclient时报错
情境再现:提示缺失C++的编译环境分析问题:可能是少了某个安装包 解决问题:访问该网站:https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python我的是win64,python3.6版本,所以选择下载这个。...原创 2018-10-03 19:53:05 · 1070 阅读 · 0 评论 -
Eclipse下的python3.6+django 更改了urls.py 之后runserver报错的解决办法
情境再现:改动了一下源代码:from django.conf.urls import include,urlfrom django.contrib import adminadmin.autodiscover()from blog.views import archiveurlpatterns = ['', # Examples: # url(r'^$'...原创 2018-09-26 01:44:16 · 271 阅读 · 0 评论 -
使用Eclipse中的python3.7建Django项目报错
情境再现: File "D:\Python\lib\site-packages\django\contrib\admin\widgets.py", line 151 '%s=%s' % (k, v) for k, v in params.items(), ^SyntaxError: Generator expression must be parenthesized...原创 2018-09-26 00:25:59 · 550 阅读 · 0 评论 -
'gbk' codec can't decode byte 0xbf in position 2: illegal multibyte sequence
网上解决这类问题的方法很多一、设置UTF-8格式with open(filename,encoding='UTF-8') as f:二、设置‘rb',’r'with open(filename,'r')as f 我一一按照网上的方法试了试,都没有效果。我记得第一次运行的时候,是可以出来结果的,后来就开始报错了。无意中看了一篇博客,说看你的文件打开时有没有乱码,有...原创 2018-09-24 23:27:08 · 3543 阅读 · 2 评论 -
词云:FutureWarning: using a dict on a Series for aggregation is deprecated and will be removed问题
词云:FutureWarning: using a dict on a Series for aggregation is deprecated and will be removed问题 情境再现: 代码:words_stat=words_df.groupby(by=['segment'])['segment'].agg({"计数":numpy.size})...原创 2018-09-03 22:13:23 · 2461 阅读 · 0 评论 -
AttributeError: module 'pip' has no attribute 'pep425tags'
情境再现:AttributeError: module 'pip' has no attribute 'pep425tags' 分析问题:百度可知是Win32和Win64的输入命令各有所不同。 解决问题:win64import pip._internalprint(pip._internal.pep425tags.get_supported()) win...原创 2018-09-03 21:48:21 · 5068 阅读 · 1 评论 -
python生成词云时,图片中的汉字出现口字型错误
情境再现:我的代码:from wordcloud import WordCloudimport matplotlib.pyplot as pltfrom scipy.misc import imreadfrom wordcloud.color_from_image import ImageColorGeneratortext = open("text.txt",'r').re...原创 2018-09-05 18:25:49 · 4367 阅读 · 0 评论 -
最简单的python爬虫,爬新浪博客的主页
Eclipse直接运行程序:import requests # packagereq = requests.get( 'http://www.sina.com.cn/', # url, as you like params={"wd": "find", "rn": "100"}, headers={'user-agent': 'Mozilla/5.0'})...原创 2018-09-02 18:57:47 · 618 阅读 · 0 评论 -
在Windows下安装Python3.7中的requests模块(教你跳坑)
之前Import requests失败了,于是在网上找教程,发现了这篇文章,写的很详细https://blog.csdn.net/zzspc/article/details/80222109 但是我在这一步的时候就失败了于是我把python这个字眼去掉就好使了。安装成功之后,我又在编译器中输入import requests发现还是报错 我怀疑我的requests包安...原创 2018-09-02 18:41:12 · 8827 阅读 · 0 评论 -
Python的斐波那契写法
def fib(n): a, b = 0, 1 while a < n: print(a, end=' ') a, b = b, a+b print()fib(1000)原创 2018-09-02 18:02:17 · 210 阅读 · 0 评论 -
史上最简单的python爬虫程序
适用于python版本3.4以上的:import urllib.requestprint(urllib.request.urlopen("https://www.baidu.com").read())使用于python版本2.0以上的:import urllib2print(urllib.urlopen("http://www.baidu.com").read()) ...原创 2018-09-02 17:08:22 · 431 阅读 · 0 评论 -
ModuleNotFoundError: No module named 'urllib2'
历尽千辛万苦,终于在Eclipse上安装好了python的编译工具了https://blog.csdn.net/zrcshendustudy/article/details/82120397正准备来一个爬虫程序入门的时候,报了这么一个错。Traceback (most recent call last): File "D:\Users\ASUS\workspace\PaChong...原创 2018-09-02 17:05:33 · 2151 阅读 · 2 评论 -
TabError:inconsistent use of tabs and spaces in indentation
情境再现:执行这条命令时python manage.py makegrations learning_log报了这个错:TabError:inconsistent use of tabs and spaces in indentation 分析问题: 翻译过来,指空格的意思。感谢这条CSDN的指出:https://blog.csdn.net/t...原创 2018-09-26 23:50:34 · 323 阅读 · 0 评论