I get a syntax error when I import discord in the cmd but not in vs code

◇◆丶佛笑我妖孽 提交于 2021-02-08 11:44:16

问题


I get a syntax error when I try to import discord, everything works in vscode but not in cmd

C:\Users\anselm_lothar\Documents\Python\pythonProject\Event bot>main.py Traceback (most recent call last): File "C:\Users\anselm_lothar\Documents\Python\pythonProject\Event bot\main.py", line 4, in import discord File "C:\Users\anselm_lothar\AppData\Local\Programs\Python\Python38\lib\site-packages\discord_init_.py", line 25, in from .client import Client File "C:\Users\anselm_lothar\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 959 """ ^ SyntaxError: (unicode error) \N escapes not supported (can't load unicodedata module)

and my code is just

import discord

回答1:


I first oppened the discord module and changed the code where the error occured, there was an issue with the '\N' not being in a substring,but I also got a new error :/(that had nothing to do with discord module).The _socket module was nowhere to be found so just reinstall python.



来源:https://stackoverflow.com/questions/64491461/i-get-a-syntax-error-when-i-import-discord-in-the-cmd-but-not-in-vs-code

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!