首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    python爬取主播信息

    执行的时候报错 Traceback (most recent call last): File "e:/personal/vscode/pameinv.py", line 9, in <module> print(a()) File "e:/personal/vscode/pameinv.py", line 8, in a return html.json() File "D:\python\Python37\lib\site-packages\requests\models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "D:\python\Python37\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "D:\python\Python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "D:\python\Python37\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 于是开始各种调试 最后换了一个地址行了,可能是微博的api不让调用了 于是修改了一下程序

    01

    python基础6

    *******************             *  异常处理与调式         *             ******************* ***常见错误:*** 1) 名字没有定义,NameError In [1]: print a --------------------------------------------------------------------------- NameError                                 Traceback (most recent call last) <ipython-input-1-9d7b17ad5387> in <module>() ----> 1 print a NameError: name 'a' is not defined 2) 分母为零,ZeroDivisionError In [2]: 10/0 --------------------------------------------------------------------------- ZeroDivisionError                         Traceback (most recent call last) <ipython-input-2-242277fd9e32> in <module>() ----> 1 10/0 ZeroDivisionError: integer division or modulo by zero 3) 文件不存在,IOError In [3]: open("westos") --------------------------------------------------------------------------- IOError                                   Traceback (most recent call last) <ipython-input-3-2778d2991600> in <module>() ----> 1 open("westos") IOError: [Errno 2] No such file or directory: 'westos' 4) 语法错误,SyntaxError In [4]: for i in [1,2,3]   File "<ipython-input-4-ae71676907af>", line 1     for i in [1,2,3]                     ^ SyntaxError: invalid syntax 5) 索引超出范围,IndexError In [5]: a = [1,2,3] In [6]: a[3] --------------------------------------------------------------------------- IndexError                                Traceback (most recent call last) <ipython-input-6-94e7916e7615> in <module>() ----> 1 a[3] IndexError: list index out of range In [7]: t =(1,2,3) In [8]: t[3] --------------------------------------------------------------------------- IndexError                                Traceback (most recent call last) <ipython-input-8-7d5cf04057c5> in <module>() ----> 1 t[3] IndexError: tuple index out of range In [9]: t[1:9]            ###切片的时候,若超出范围,则默认为全部,不报错 Out[9]: (2, 3) ####python异常处理机制:try......except......finally###### 例: #!/usr/bin/env python #coding:utf-8 try:                ###将可能发生错误的部分放在try下###     print "staring......"     li = [1,2,3]     print a     pri

    02

    树莓派4B安装tensorflow2.0[通俗易懂]

    这个GitHub上可以下载到tensorflow2.x:https://github.com/lhelontra/tensorflow-on-arm/releases 我就拿我下载的举例子吧:我下载的是这个版本的:tensorflow-2.0.0-cp37-none-linux_armv7l.whl 1、把下载的这个tensorflow-2.0.0-cp37-none-linux_armv7l.whl文件放进树莓派里边,cd到你拖进的那一目录下(我是拖到Desktop,所以是:cd Desktop),命令行输入:sudo pip3 install tensorflow-2.0.0-cp37-none-linux_armv7l.whl (注意:一定要cd进到这个目录才行!否则报错) 2、然后就会自动安装,安装过程中还需下载其他模块,会自动在国外源下载,就算你换源了还是会启动外国源下载,就有可能会中断导致下载不了。我是下载这3个模块下载不了:

    03

    win10中anaconda安装tensorflow时报错Traceback (most recent call last): File “E:\Anaconda3\lib\site-packag[通

    windows系统anaconda安装tensorflow时报错解决办法。 报错: Traceback (most recent call last): File “E:\Anaconda3\lib\site-packages\pip_vendor\urllib3\response.py”, line 360, in _error_catcher yield File “E:\Anaconda3\lib\site-packages\pip_vendor\urllib3\response.py”, line 442, in read data = self._fp.read(amt) File “E:\Anaconda3\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py”, line 62, in read data = self.__fp.read(amt) File “E:\Anaconda3\lib\http\client.py”, line 447, in read n = self.readinto(b) File “E:\Anaconda3\lib\http\client.py”, line 491, in readinto n = self.fp.readinto(b) File “E:\Anaconda3\lib\socket.py”, line 589, in readinto return self._sock.recv_into(b) File “E:\Anaconda3\lib\ssl.py”, line 1052, in recv_into return self.read(nbytes, buffer) File “E:\Anaconda3\lib\ssl.py”, line 911, in read return self._sslobj.read(len, buffer) socket.timeout: The read operation timed out

    01
    领券