0

I am trying to install Python Selenium, pip install selenium, but I get this error:

File "", line 1 pip3 install selenium ^^^^^^^ SyntaxError: what is the solution for invalid syntax

Snapshot:

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • 1
    It says "running scripts is disabled". You don't have permission. Ask your system administrator. – stdunbar Jan 17 '23 at 20:58
  • Please review *[Why not upload images of code/errors when asking a question?](https://meta.stackoverflow.com/questions/285551/)* (e.g., *"Images should only be used to illustrate problems that* ***can't be made clear in any other way,*** *such as to provide screenshots of a user interface."*) and [do the right thing](https://stackoverflow.com/posts/75152111/edit). Thanks in advance. – Peter Mortensen Jan 17 '23 at 22:12
  • The "`^^^^^^^`" indicates there was more than one line in the original. Was there? – Peter Mortensen Jan 17 '23 at 22:15

1 Answers1

0

This error message...

pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1
+ pip install -U PySide
+ ~~~
    + CategoryInfo          : ObjectNotFound: (pip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

...implies that system was unable to locate pip.


Solution

This error is shown on when user tries to use pip in the command prompt. To address this error on windows you need to add the path of the Python Interpreter to the system Path variable.

To see a list of things you can do with pip, you can execute the command on your terminal:

py -m pip

Additionally, you may need to upgrade pip as follows:

python -m pip install --upgrade pip

Then you can simply install or upgrade the Selenium Python bindings as follows:

pip install -U selenium
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • i am getting the same error how do i fix it >>> python -m pip install --upgrade pip File "", line 1 python -m pip install --upgrade pip ^^^ SyntaxError: invalid syntax >>> – Tayfun Kardes Jan 17 '23 at 21:29
  • Add the path of the Python Interpreter to the system Path? If so, try to restart/reboot the system. – undetected Selenium Jan 17 '23 at 21:30
  • I tried restarting and deleting python and trying to download a different version but the result is the same error – Tayfun Kardes Jan 17 '23 at 21:34