Discord.py: Coding with python

Created on 26 Jan 2018  路  17Comments  路  Source: Rapptz/discord.py

every code I put it in it always says either Invalid Syntax or there isn't a module named "discord".
I tried so many codes and different versions of python and it never works.

All 17 comments

Are you sure you have followed all steps in #Installing?

The first few steps just have an error for me. I do all the steps needed and they all have error in python.

SyntaxError: multiple statements found while compiling a single statement

import discord import asyncio
SyntaxError: invalid syntax
import discord
Traceback (most recent call last):
File "", line 1, in
import discord
ModuleNotFoundError: No module named 'discord'
import discord import asyncio
SyntaxError: invalid syntax
python3 -m pip install -U discord.py
SyntaxError: invalid syntax

Can you provide here on the first step you get an error during install what you entered to get that error, and what that error was.

Are you trying to install python using python? That's interesting.

You are meant to install the discord.py in the shell, not in the interpreter.

ok let me try that

Last login: Fri Jan 26 12:46:31 on ttys001
Gordys-iMac:~ gsiers$ import discord
-bash: import: command not found
Gordys-iMac:~ gsiers$ import asyncio : I tried it in terminal but this is what happened. Not sure how to launch python shell with a Mac

You seem to not know that discord.py isn't a built in library - you need to install it first prior to using it. Using your terminal, not python.

For getting the basics of setting up your libraries and interpreter, you should look on proper sites, not really in the issues page of a project.

Hey, I think it might be an idea first to get familiar with the fundamentals of using both python and command line by going over some beginner materials first. It seems you might be quite new to programming and python, so here's two resources to check out maybe:
https://automatetheboringstuff.com/ < lots of beginner friendly stuff here
http://www.codeabbey.com/ < exercises here are quite beginner friendly and worth checking out after the above.

Gordys-iMac:~ gsiers$ install discord.py
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...
Gordys-iMac:~ gsiers$ import discord
-bash: import: command not found
Gordys-iMac:~ gsiers$ import discord import asyncio
-bash: import: command not found

Please - begin with trying to make at least a working Hello World before trying to make something with an external library. Get around the basics. It's third time you are trying to mix terminal commands with python code.

mate, please stop sending your console output lol. this isn't an issue with the library, so this is the wrong place to continue your enquiry. we've tried helping a bit and tried making suggestions that will help you on your road to learning python. since it's obvious you're pretty green, and making a bot requires the minimum expected foundation knowledge, you're best to check those links.

Ok sorry, I just don't know much about this stuff. I really want to make this work so sorry for being stubborn.

Without knowing the basics you are nowhere close of making a properly working bot - this is at least an intermediate level stuff, if one can grade it like this.

We know, we noticed, hence why I sent those links so you can get familiar. Trust us, it's best to start on something a bit easier for now. If you can also, please close this issue since it's not actually a lib issue :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

imayhaveborkedit picture imayhaveborkedit  路  58Comments

VoxelPrismatic picture VoxelPrismatic  路  16Comments

downloadpizza picture downloadpizza  路  14Comments

0x78f1935 picture 0x78f1935  路  20Comments

rektile picture rektile  路  18Comments