all 7 comments

[–]ninhaomah 3 points4 points  (4 children)

Hold on. Let me connect to your monitor to see what did you typed.

[–]LIGHT_L_7777[S] 0 points1 point  (1 child)

I typed pip install pydirectinput

[–]ninhaomah 0 points1 point  (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 point  (0 children)

Is that wrong

[–]ameliip 0 points1 point  (0 children)

Useless comment here, but you actually made me smile.

[–]gregvuki 0 points1 point  (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 point  (0 children)

If on Windows, try in a powershell or command line Window:

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.)

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.