Category : pycharm

I am trying to make a discord bot change to online status I have been using pycharm and terminal. I have tried reordering the code multiple different ways, but here is what I have right now import discord from discord.ext import commands client = commands.Bot(command_prefix=".") @client.event async def on_ready(): print(‘Bot is ready.’) await client.run(bot token) ..

Read more

I have some env vars which should be loaded when the the specific func triggers, but when I run the main.py in Pycharm it does not work and gives the below error: ‘Error Message’: ‘the parameter apikey is invalid or missing’ I have exported the env var in terminal: $ export ALPHAVANTAGE_API_KEY=1qa2ws3ed4rf5t and checked the ..

Read more

I was doing a project on pycharm. I can’t get the filepath if I print ‘filename’ there. But I get in while in jupyter notebook. class module11(): def __init__(self, root): self.root = root self.root.title("Solution Sheet") global filename filename = filedialog.askopenfilename(initialdir=os.getcwd(), title="Select file", filetypes=(("jpeg images", "jpeg"), ("all files", "*.*"))) if not filename: return image = ImageTk.PhotoImage(Image.open(filename)) ..

Read more

When I use try/except and run it, it shows Process finished with exit code 0. I use it on main.py and every function except for try/except functions properly. import speech_recognition as sr listener = sr.Recognizer() try: with sr.Microphone() as source: print(‘listening..’) voice = listener.listen(source) command = listener.recognize_google(voice) print(command) except: pass Screen shot of the page ..

Read more

Traceback (most recent call last): File "C:Program FilesJetBrainsPyCharm Community Edition 2020.3.2pluginspython-cehelperspydevpydevconsole.py", line 5, in <module> from _pydev_comm.pydev_rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client File "C:Program FilesJetBrainsPyCharm Community Edition 2020.3.2pluginspython-cehelperspydev_pydev_commpydev_rpc.py", line 1, in <module> import socket File "C:UsersAgniva RoyPycharmProjectslibsocket.py", line 49, in <module> import _socket ImportError: DLL load failed while importing _socket: %1 is not a valid Win32 ..

Read more

I’m currently learning Django through ‘real python’ website and in the tutorial it asks to add an environmental variable in the terminal like this, (venv) $ export EMAIL_HOST_USER=your_email_host_user (for Linus or macOS) C:> set EMAIL_HOST_USER=your_email_host_user (for Windows) but I’m using PyCharm to code these and these doesn’t work in the terminal that PyCharm provides. How ..

Read more

When I import pygame, I get the above error message. When I pip install and pip3 install pygame in PyCharm, Sublime, and my computer terminal, I get this message: Requirement already satisfied: pygame in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (2.0.1) and yet I continuously get the error message when I try running a pygame program. How should I troubleshoot? ..

Read more