Skip to content
Advertisement

Why is my program going from my virtual environment interpreter to a python interpreter I didnt select? [closed]

This is my output:

PS C:PythonvirtenvReorg> & c:/Python/virtenv/Scripts/Activate.ps1
(virtenv) PS C:PythonvirtenvReorg>  & 'c:PythonvirtenvScriptspython.exe' 'c:Usersscott.vscodeextensionsms-python.python-2022.14.0pythonFileslibpythondebugpyadapter/../..debugpylauncher' '63131' '--' 'c:PythonvirtenvReorgkrollgooger.py'
Traceback (most recent call last):
  File "c:Pythonvirtenvlibsite-packagesseleniumwebdrivercommonservice.py", line 71, in start    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:Pythonlibsubprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:Pythonlibsubprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Why is it starting in my virtual environment > C:PythonvirtenvScriptspython.exe and then calling module > C:Pythonlibsubprocess.py ?

Advertisement

Answer

Why is it starting in my virtual environment

Because of this – & c:/Python/virtenv/Scripts/Activate.ps1

The only interpreter being ran is c:PythonvirtenvScriptspython.exe

A module (not an interpreter) in your vitrualenv (selenium webdriver) is running a subprocess function which is a built-in module in Python, which is not need installed into your virtualenv

Regarding the error itself, Selenium requires you to have some browser executable such as Chrome/Firefox, and it is possible the error is related to not being able to find those.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement