I tried this pip install
:
pip install https://github.com/rapptz/discord.py
I get the error 'SyntaxError: Invalid Syntax'.
Can I install from GitHub using pip
?
I tried this pip install
:
pip install https://github.com/rapptz/discord.py
I get the error 'SyntaxError: Invalid Syntax'.
Can I install from GitHub using pip
?
This package seems to be only for python 3.x. so just type the following command:
sudo python3 -m pip install git+https://github.com/rapptz/discord.py
The meaning of this command:
python3 -m
is to specify the python version.pip install git+https:[URL]
is for git repos.pip install git+git:[URL]
or pip install --upgrade https:[URL]
.pip
is a command line utility outside of python.
Run pip install https://github.com/rapptz/discord.py
on your terminal, not inside a python REPL.
You asked how to install python packages from GitHub using pip, whereas the real question is why bash commands don't work in python console.
These two languages have different syntax, so you can't do that. There are two simple solutions for this:
import os
os.system("pip install https://github.com/rapptz/discord.py")
This solution has a downside: This is unnecessary complex. The second solution solves it:
Close python terminal/console/file you have open. Open bash (or any other installed console) and then run
pip install https://github.com/rapptz/discord.py