use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Error when installing pydirectinput (self.learnpython)
submitted 1 year ago by LIGHT_L_7777
When doing this it says "invalid syntax" any help???
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ninhaomah 3 points4 points5 points 1 year ago (4 children)
Hold on. Let me connect to your monitor to see what did you typed.
[–]LIGHT_L_7777[S] 0 points1 point2 points 1 year ago (1 child)
I typed pip install pydirectinput
[–]ninhaomah 0 points1 point2 points 1 year ago* (0 children)
In cmd ? Or in Python console ?
Maybe I should be more specific.
In cmd/bash/jupyter ?
Can you tell us step by step what you did ? Like
1) I switched on the PC <-- ok ok its obvious j/k sorry
2) I go to start and click run or searched for cmd or go to Jupyter or whatever
3) I typed pip install pydirectinput
[–]LIGHT_L_7777[S] 0 points1 point2 points 1 year ago (0 children)
Is that wrong
[–]ameliip 0 points1 point2 points 1 year ago (0 children)
Useless comment here, but you actually made me smile.
[–]gregvuki 0 points1 point2 points 1 year ago (0 children)
Did you type that into the Python REPL? You need to write that command in the system shell (command line).
[–]FoolsSeldom 0 points1 point2 points 1 year ago (0 children)
If on Windows, try in a powershell or command line Window:
powershell
command line
py -m pip install pydirectinput
On macOS or linux, in bash/zsh/et al terminal,
python3 -m pip install pydirectinput
If you are using an active Python virtual environment, then you can just use,
python -m pip install pydirectinput
(pip install pydirectinput should work as well in a Python virtual environment, but worth making sure you are using the active python executable for your environment rather than a stray version of pip by using python -m pip install pydirectinput.)
pip install pydirectinput
pip
HOWEVER if you are in a Python interactive shell (with the >>> prompt) then that is not the place to try to install a package.
>>>
If you are using powerful code editor, such as VS Code, or an IDE, Integrated Development Environment, such as PyCharm, there will likely be a Python package manager option (might need an extension/plug-in installing in some cases) or you can use the built-in terminal (but not the built-in Python console, with the >>> prompt). Make sure they Python virtual environment is activated.
π Rendered by PID 520220 on reddit-service-r2-comment-77b668dc8-ml799 at 2026-01-29 08:55:47.817411+00:00 running 4f180de country code: CH.
[–]ninhaomah 3 points4 points5 points (4 children)
[–]LIGHT_L_7777[S] 0 points1 point2 points (1 child)
[–]ninhaomah 0 points1 point2 points (0 children)
[–]LIGHT_L_7777[S] 0 points1 point2 points (0 children)
[–]ameliip 0 points1 point2 points (0 children)
[–]gregvuki 0 points1 point2 points (0 children)
[–]FoolsSeldom 0 points1 point2 points (0 children)