Traceback (most recent call last): File "E:/PC/sql.py", line 15, in <module> cur.execute("INSERT INTO student.csv VALUES (1234567,abc,计算机,2001/6/6,4,4500);"); File "F:\Python\envs\PC\lib\site-packages\pymysql\cursors.py", line 148, in execute result = self._query(query) File "F:\Python\envs\PC\lib\site-packages\pymysql\cursors.py", line 310, in _query conn.query(q) File "F:\Python\envs\PC\lib\site-packages\pymysql\connections.py", line 548, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "F:\Python\envs\PC\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result result.read() File "F:\Python\envs\PC\lib\site-packages\pymysql\connections.py", line 1156, in read first_packet = self.connection._read_packet() File "F:\Python\envs\PC\lib\site-packages\pymysql\connections.py", line 725, in _read_packet packet.raise_for_error() File "F:\Python\envs\PC\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data) File "F:\Python\envs\PC\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.ProgrammingError: (1146, "Table 'student.csv' doesn't exist")
时间: 2023-07-21 19:46:16 浏览: 169
根据报错信息可以看出,你在执行SQL语句时访问了一个名为"student.csv"的表,但是该表并不存在,所以会抛出"Table 'student.csv' doesn't exist"的异常。你需要确认一下表的名字是否正确,以及该表是否已经被创建。如果表名正确,但是表不存在,那么你需要先创建该表,然后再执行插入数据的操作。
相关问题
Traceback (most recent call last): File "C:/Python38/pythonProject/poi.py", line 60, in <module> jsonf = urllib.urlopen(url) Traceback (most recent call last): File "C:/Python38/pythonProject/poi.py", line 60, in <module> jsonf = urllib.urlopen(url) AttributeError: module 'urllib' has no attribute 'urlopen'
您遇到的错误是因为urllib模块中没有urlopen这个属性。Python 3中urllib模块被分为了urllib.request、urllib.parse、urllib.error等子模块。
要解决这个问题,您可以将代码中的urllib替换为urllib.request。请尝试以下修改:
```python
import urllib.request
url = "your_url_here"
jsonf = urllib.request.urlopen(url)
```
这样应该可以解决您的问题。如果还有其他问题,请随时提问。
Here is the output from the autograder: --- Autodriver: Job exited with status 0 Exception checked Traceback (most recent call last): File "/home/autograde/autolab/judge/stu.py", line 1, in <module> a,b=input().split() EOFError: EOF when reading a line [[question]] 1101111001101 1000001001100 [[answer]] 10110000011001 Exception checked Traceback (most recent call last): File "/home/autograde/autolab/judge/stu.py", line 1, in <module> a,b=input().split() EOFError: EOF when reading a line [[question]] 1111000101000 1000101100110 [[answer]] 10111110001110 Exception checked Traceback (most recent call last): File "/home/autograde/autolab/judge/stu.py", line 1, in <module> a,b=input().split() EOFError: EOF when reading a line [[question]] 1110110100100 10100001001 [[answer]] 10001010101101 Exception checked Traceback (most recent call last): File "/home/autograde/autolab/judge/stu.py", line 1, in <module> a,b=input().split() EOFError: EOF when reading a line [[question]] 1000101010001 10011001111 [[answer]] 1011000100000 Exception checked Traceback (most recent call last): File "/home/autograde/autolab/judge/stu.py", line 1, in <module> a,b=input().split() EOFError: EOF when reading a line [[question]] 1111101001001 1000010000111 [[answer]] 10111111010000 {"scores": {"Correctness": 0}}
看起来你的程序在运行时遇到了一个输入错误,导致输出了一个异常。这个异常是 EOFError,它表示程序在尝试读取输入时已经到达了文件的末尾。你需要确保你的程序在接收输入时,能够正确处理输入结束的情况。建议你检查你的程序并确保它能够正确地处理输入和输出。此外,你还需要检查一下你的程序是否按照要求输出了正确的答案。最后,你可以再次运行自动评分器以检查你的程序是否已经修复了这个问题。
阅读全文