V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  bob1994  ›  全部回复第 1 页 / 共 2 页
回复总数  36
1  2  
2018-08-22 10:45:56 +08:00
回复了 sdushn 创建的主题 JavaScript 四六级查分网站为何刷不出来验证码
404
2018-07-13 20:19:24 +08:00
回复了 UGLW 创建的主题 分享发现 发现新大陆,戴降噪耳机喝快乐水。
没啥子感觉呦?
2018-07-09 18:20:40 +08:00
回复了 bob1994 创建的主题 Python 小白提问 Python 问题, macos 系统
好了,在 pip3 install XXX 后面追加 --user 就行了
估计是哪个文件夹权限出了点问题吧,回头给看看
此贴总结,谢谢诸位。
2018-07-09 18:05:04 +08:00
回复了 bob1994 创建的主题 Python 小白提问 Python 问题, macos 系统
@TOUJOURSER 我感觉要重新安装 pip3 了 /摊手
2018-07-09 18:04:27 +08:00
回复了 bob1994 创建的主题 Python 小白提问 Python 问题, macos 系统
@TOUJOURSER 刚刚试着下了其他的模块,都是差不多情况,只能下载,不会安装。。
2018-07-09 17:39:19 +08:00
回复了 bob1994 创建的主题 Python 小白提问 Python 问题, macos 系统
@TOUJOURSER 不行诶,就提示找不到该库。
2018-07-09 16:59:14 +08:00
回复了 bob1994 创建的主题 Python 小白提问 Python 问题, macos 系统
好像 最后少了 Successfully installed 那句话啊,求解。
2018-07-09 16:58:41 +08:00
回复了 bob1994 创建的主题 Python 小白提问 Python 问题, macos 系统
MacBook-Pro:~ nixiabing$ pip3 install aiohttp -U
Collecting aiohttp
Using cached https://files.pythonhosted.org/packages/7b/58/1d258b6853a3ba9b6627933f53f307958932701ffb2318f89d0d077a1de1/aiohttp-3.3.2-cp36-cp36m-macosx_10_12_x86_64.whl
Collecting async-timeout<4.0,>=3.0 (from aiohttp)
Using cached https://files.pythonhosted.org/packages/96/0f/e6357458c87fb4ed8f3df215773f3caad40968f10e05552cbd8bd28415e4/async_timeout-3.0.0-py3-none-any.whl
Collecting idna-ssl>=1.0 (from aiohttp)
Collecting multidict<5.0,>=4.0 (from aiohttp)
Collecting yarl<2.0,>=1.0 (from aiohttp)
Requirement not upgraded as not directly required: chardet<4.0,>=2.0 in /usr/local/lib/python3.6/site-packages (from aiohttp) (3.0.4)
Requirement not upgraded as not directly required: attrs>=17.3.0 in /usr/local/lib/python3.6/site-packages (from aiohttp) (17.3.0)
Requirement not upgraded as not directly required: idna>=2.0 in /usr/local/lib/python3.6/site-packages (from idna-ssl>=1.0->aiohttp) (2.6)
Installing collected packages: async-timeout, idna-ssl, multidict, yarl, aiohttp
2018-07-07 14:31:56 +08:00
回复了 finian 创建的主题 云计算 阿里云上个月的事故赔付明细已经更新了
当月产品非常稳定,没有受损实例
2018-04-19 19:48:10 +08:00
回复了 DeHoo 创建的主题 程序员 请各位 V 友帮我看看,做这么一个 APP 大概是什么价格?
20w
2018-01-29 12:53:39 +08:00
回复了 MonoLogueChi 创建的主题 JavaScript 关于网站强奸剪切板那点事
华为手机,UC 浏览器和自带浏览器测试情况:复制失败,
不知道为什么。
2018-01-24 23:02:47 +08:00
回复了 xuyl 创建的主题 Python 写(抄)了几个小工(玩)具, V 友看看?
@xuyl 棒棒哒~
2018-01-24 20:56:20 +08:00
回复了 xuyl 创建的主题 Python 写(抄)了几个小工(玩)具, V 友看看?
@xuyl 好像。。还是有问题。。不知道是不是被反爬了,
还是之前的报错'NoneType' object has no attribute 'strip'。
我的测试网址: https://movie.douban.com/subject/26942674/
2018-01-23 22:39:05 +08:00
回复了 xuyl 创建的主题 Python 写(抄)了几个小工(玩)具, V 友看看?
@xuyl 新的问题出现,有些爬取正常,有些出错了。。
AttributeError Traceback (most recent call last)
<ipython-input-5-8e2fa2e30a58> in <module>()
100 print('\n================================\n\n')
101 comment_url = urljoin(url, 'comments?start=0&limit=20&sort=new_score&status=P&percent_type=')
--> 102 parse_comment(comment_url, headers)
103 generate_cloud()

<ipython-input-5-8e2fa2e30a58> in parse_comment(url, headers)
43 comment_divs = soup.find_all('div', class_='comment')
44 if comment_divs is not None:
---> 45 comments += ''.join([item.find('p').string.strip() for item in comment_divs])
46 next_page = soup.find('a', class_='next')
47 if next_page is not None and page < 30:

<ipython-input-5-8e2fa2e30a58> in <listcomp>(.0)
43 comment_divs = soup.find_all('div', class_='comment')
44 if comment_divs is not None:
---> 45 comments += ''.join([item.find('p').string.strip() for item in comment_divs])
46 next_page = soup.find('a', class_='next')
47 if next_page is not None and page < 30:

AttributeError: 'NoneType' object has no attribute 'strip'

麻烦看下这是什么错误
2018-01-23 12:03:20 +08:00
回复了 xuyl 创建的主题 Python 写(抄)了几个小工(玩)具, V 友看看?
@xuyl 好了,已解决,是缺少了 simhei.ttf 字体导致的
2018-01-23 11:51:48 +08:00
回复了 xuyl 创建的主题 Python 写(抄)了几个小工(玩)具, V 友看看?
@xuyl 我的确是在 jupyter notebook 上跑得,然后出现了这个问题。。
新手小白看不懂报错。。

OSError Traceback (most recent call last)
<ipython-input-2-8e2fa2e30a58> in <module>()
101 comment_url = urljoin(url, 'comments?start=0&limit=20&sort=new_score&status=P&percent_type=')
102 parse_comment(comment_url, headers)
--> 103 generate_cloud()

<ipython-input-2-8e2fa2e30a58> in generate_cloud()
72 word_frequence = {x[0]:x[1] for x in words_stat.head(1000).values}
73
---> 74 wordcloud = wordcloud.fit_words(word_frequence)
75 plt.imshow(wordcloud)
76

/usr/local/lib/python3.6/site-packages/wordcloud/wordcloud.py in fit_words(self, frequencies)
329 self
330 """
--> 331 return self.generate_from_frequencies(frequencies)
332
333 def generate_from_frequencies(self, frequencies, max_font_size=None):

/usr/local/lib/python3.6/site-packages/wordcloud/wordcloud.py in generate_from_frequencies(self, frequencies, max_font_size)
430 while True:
431 # try to find a position
--> 432 font = ImageFont.truetype(self.font_path, font_size)
433 # transpose font optionally
434 transposed_font = ImageFont.TransposedFont(

/usr/local/lib/python3.6/site-packages/PIL/ImageFont.py in truetype(font, size, index, encoding, layout_engine)
258
259 try:
--> 260 return FreeTypeFont(font, size, index, encoding, layout_engine)
261 except IOError:
262 ttf_filename = os.path.basename(font)

/usr/local/lib/python3.6/site-packages/PIL/ImageFont.py in __init__(self, font, size, index, encoding, layout_engine)
141
142 if isPath(font):
--> 143 self.font = core.getfont(font, size, index, encoding, layout_engine=layout_engine)
144 else:
145 self.font_bytes = font.read()

OSError: cannot open resource
2018-01-23 07:44:59 +08:00
回复了 xuyl 创建的主题 Python 写(抄)了几个小工(玩)具, V 友看看?
豆瓣那个, 报错 OSError: cannot open resource
请问这是什么意思?
1  2  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2154 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms · UTC 15:51 · PVG 23:51 · LAX 08:51 · JFK 11:51
Developed with CodeLauncher
♥ Do have faith in what you're doing.