0

I installed lasted version of python. And I tried to install the python module called selenium. And pip install doesn't work. How can I fix it? I really want to fix it Error message follows like

>pip install selenium

Traceback (most recent call last):
  File "c:\users\hym\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\hym\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\hym\AppData\Local\Programs\Python\Python39\Scripts\pip.exe\__main__.py", line 4, in <module>
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\main.py", line 8, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 22, in <module>
    from pip._internal.cli.progress_bars import BAR_TYPES
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\progress_bars.py", line 9, in <module>
    from pip._internal.utils.logging import get_indentation
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\utils\logging.py", line 14, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\utils\misc.py", line 29, in <module>
    from pip._internal.locations import get_major_minor_version, site_packages, user_site
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\locations\__init__.py", line 9, in <module>
    from . import _distutils, _sysconfig
  File "c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\locations\_sysconfig.py", line 8, in <module>
    from pip._internal.exceptions import InvalidSchemeCombination, UserInstallationInvalid
ImportError: cannot import name 'InvalidSchemeCombination' from 'pip._internal.exceptions' (c:\users\hym\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\exceptions.py)
BOT_bkcd
  • 321
  • 3
  • 12

1 Answers1

1

There are two solutions to this problem:-

  1. You can use this command by adding -m flag. The -m flag stands for module name and allows you to pass a module at the time of invoking Python.:-

    python -m pip install selenium

  2. Or you can directly download the source distribution from here according to your requirement , unarchive and then run it using this command:-

    python setup.py install

  • 1
    Two solution do not work Is there other way? I install anaconda but i try to install by cmd(window) I don't want to use anaconda – yeongmin hong Jun 13 '21 at 16:28