'Virtual Environment Activation from Command Prompt Returns "The system cannot find the path specified" but Activates Venv Anyway?

I created a virtual environment in a Windows terminal using the standard:

python -m venv {venv name}

Everything works as far as I can tell, but when I change into the "Scripts" directory and run "activate" (or even ".\activate"), I get the message "The system cannot find the path specified." The resulting command prompt seems to indicate the venv is activated:

enter image description here

Using pip list indicates that I'm indeed in the virtual environment, so it seems the message is erroneous or referring to some other process going on behind the scenes.

The main reason I ask this question is because I've been trying to use the venv in VSCode but am unable to execute Python code in the Python Interactive window ("Stderr from shellexec, the system cannot find the path specified..." is a message I get followed by a reference to two Python files VSCode cannot seem to locate -- although they are indeed in the folder the message indicates).

I'm thinking this might have something to do with it, and have searched for days online and on SO for an answer to no avail.



Solution 1:[1]

It looks like a registry reference to an old Anacoda installation was causing this issue. See here:

https://superuser.com/questions/727316/error-in-command-line-the-system-cannot-find-the-path-specified.

Essentially, clearing out the values for the "AutoRun" registry entry (which was referencing an Anaconda folder) cleared up both the original issue (i.e. "The system cannot find..." message when activating the venv from the CMD) and the ongoing issue of executing the Python Interactive session in a VSCode venv I created.

Solution 2:[2]

*There is no script folder for windows,use bin

    SpiderX\bin\activate

Replace the SpiderX using your username

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John Sukup
Solution 2 SpiderX