(I suspect this has something to do with the fact that I created a virtual environment on my external usb drive but I don’t know how to solve the problem since it was working fine last night)
My VS Code python script suddenly isn't working anymore when I try to debug it the next day. It was working all fine, I saved the sccript and went to sleep. Woke up the next day and restarted VS code and suddenly the script no longer runs. I am not even able to select the environment in VS Code anymore for some reason in the interpertor menu.
Here is the error that seems to be thrown up in a new tab called "setup.py" for some reason:
Exception has occurred: AssertionError (note: full exception trace is shown but execution is paused at: <module>)
b'No module named C\r\n'
File "C:\Users\Yaseen Ahammed\AppData\Local\Temp\pip-install-qafef280\psutil_3bb3fb77c9f54c76acc10f29c92e88d3\setup.py", line 109, in get_description
assert not stderr, stderr
File "C:\Users\Yaseen Ahammed\AppData\Local\Temp\pip-install-qafef280\psutil_3bb3fb77c9f54c76acc10f29c92e88d3\setup.py", line 337, in main
long_description=get_description(),
File "C:\Users\Yaseen Ahammed\AppData\Local\Temp\pip-install-qafef280\psutil_3bb3fb77c9f54c76acc10f29c92e88d3\setup.py", line 442, in <module>
main()
File "<string>", line 1, in <module> (Current frame)
An here is what the terminal window outputs:
& e:/E_ProgramData/Python/Python391/Othello/Scripts/Activate.ps1
& : File E:\E_ProgramData\Python\Python391\Othello\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ & e:/E_ProgramData/Python/Python391/Othello/Scripts/Activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
and
ERROR: Command errored out with exit status 1:
command: 'e:\E_ProgramData\Python\Python391\Othello\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Yaseen Ahammed\\AppData\\Local\\Temp\\pip-install-qafef280\\psutil_3bb3fb77c9f54c76acc10f29c92e88d3\\setup.py'"'"'; __file__='"'"'C:\\Users\\Yaseen Ahammed\\AppData\\Local\\Temp\\pip-install-qafef280\\psutil_3bb3fb77c9f54c76acc10f29c92e88d3\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Yaseen Ahammed\AppData\Local\Temp\pip-pip-egg-info-xonu1kkr'
cwd: C:\Users\Yaseen Ahammed\AppData\Local\Temp\pip-install-qafef280\psutil_3bb3fb77c9f54c76acc10f29c92e88d3\
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
main()
File "C:\Users\Yaseen Ahammed\AppData\Local\Temp\pip-install-qafef280\psutil_3bb3fb77c9f54c76acc10f29c92e88d3\setup.py", line 337, in main
long_description=get_description(),
File "C:\Users\Yaseen Ahammed\AppData\Local\Temp\pip-install-qafef280\psutil_3bb3fb77c9f54c76acc10f29c92e88d3\setup.py", line 109, in get_description
assert not stderr, stderr
AssertionError: b'No module named C\r\n'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I don't understand what's changed and why VS Code suddenly doesn't want to work anymore.
I did create a new virtual environment on my external USB hard drive called "Othello" which you can see it's trying to access but can't do it. The weird thing is this was working fine last night so I don't get why it stopped working after restarting VS Code.
Another new thing I noticed is the fact that the VS Code Python Interpretor no longer says "Othello" when I select the exe from the environment folder that I created on my external drive, it used to say Othello next to the Python version name indicating it had selected the correct environment last night.
Thanks in advance.