Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot won't start #31

Closed
ImASadBoy opened this issue Nov 15, 2022 · 6 comments
Closed

Bot won't start #31

ImASadBoy opened this issue Nov 15, 2022 · 6 comments
Assignees

Comments

@ImASadBoy
Copy link

ImASadBoy commented Nov 15, 2022

Hello! I got this problem: https://pastebin.com/Gywr4pLK
Bot won't start, I'm using Python 3.10.06, installed every dependency, I'm on Ubuntu 22.04, I don't know how to set the .env file so I just replaced the tokens in the Config.py file and all tests seem to work.

@RafaelSolVargas RafaelSolVargas self-assigned this Nov 15, 2022
@RafaelSolVargas
Copy link
Owner

Hi @ImASadBoy
I'm pretty sure this error has something to do with your installed packages.
Can you type the command pip list in the terminal and show us what was printed?
Probably the pycord version is out of date or has been replaced by another discord.py library.

On top of the .env file, you can create a file literally called ".env", it will be like a .txt file, and then put your information there like this:

BOT_TOKEN=Your_Own_Bot_Token
SPOTIFY_ID=Your_Own_Spotify_ID
SPOTIFY_SECRET=Your_Own_Spotify_Secret
BOT_PREFIX=Your_Wanted_Prefix_For_Vulkan

This is the project in my own computer, here you can see where the .env is located:
image

@ImASadBoy
Copy link
Author

Here is the result of pip list: https://pastebin.com/VY1iMaYU
Thanks for the help on .env

@RafaelSolVargas
Copy link
Owner

Probably the discord.py 2.2.0 package is in conflict with the pycord 2.2.2.
Let's fix this in the best way, using virtual environments.
You can search in others places to get a better understanding but i'll try my best.
Virtual Environments is a separate environment from the others, it contains its own pip and python executable and installed packages, so it is good practice to create a specific virtual environment for each project you have on your machine.

To do that go to any folder and type the commands:

python3 -m venv ./Vulkan
cd ./Vulkan
git clone https://github.com/RafaelSolVargas/Vulkan.git
./Scripts/Activate.bat
cd ./Vulkan
pip install -r requirements.txt
python main.py

To avoid activating the virtual enviroment each time, if you are using VSCode you can change the Python Interpreter to the python executable that is in ./Vulkan/Scripts/python.exe and in that way every time you open a terminal in VSCode the virtual environment will be activate.

For this type Ctrl + Shift + P and then in Python: Select Interpreter and then you will see a window like this:
image

More information:
https://docs.python.org/pt-br/3/library/venv.html
https://code.visualstudio.com/docs/python/environments#:~:text=your%20User%20Settings.-,To%20do%20so%2C%20open%20the%20Command%20Palette%20(Ctrl%2BShift,Settings%2C%20with%20the%20appropriate%20interpreter.

Let me know if you could fix this issue!

@ImASadBoy
Copy link
Author

Hello again, I followed the steps above mentioned by you for the virtual environment, but it still doesn't work, I skipped the ./Scripts/Activate.bat since I got a "No such file or directory" error

@ImASadBoy
Copy link
Author

I fixed it by uninstalling discord.py, I'll move all my projects on pycord

@RafaelSolVargas
Copy link
Owner

Hello again, I followed the steps above mentioned by you for the virtual environment, but it still doesn't work, I skipped the ./Scripts/Activate.bat since I got a "No such file or directory" error

As you can see in this photo:
image

I'm inside a folder called Vulkan and inside it a folder called Scripts, inside it there are some files, the first three start with activate.*, if you run any of them the environment will activate, you can for example access the Scripts folder and type :
./activate.

Not sure if you have those three files because I'm in Windows and in Linux it might be a little different but I'm pretty sure you have something like activate.

But uninstalling discord.py is also a possible solution :)
I'm closing this issue as resolved.
Thanks for your time, if you can, leave a star in this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants