Setting up python environment
I already have conda installed, along with various IDEs like pycharm and MS visual studio code.
As per instruction, I opened the Ex_LinearRegression_start.py file and tried to run part of the code (importing of packages). So first, I had the error message stating this:
PS C:\Users\User\Documents\PythonProjects\MicrosoftPython> & c:/Users/User/Documents/PythonProjects/MicrosoftPython/venv/Scripts/Activate.ps1
& : File C:\Users\User\Documents\PythonProjects\MicrosoftPython\venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at
I googled around and it seems like I had to run some other commands in conda prompt to allow scripts to run. (can someone confirm that this is supposed to be the case?)
Next, I tried to run the script again after allowing scripts to run. I got the following:
PS C:\Users\User\Documents\PythonProjects\MicrosoftPython> & c:/Users/User/Documents/PythonProjects/MicrosoftPython/venv/Scripts/python.exe "c:/Users/User/Documents/PythonProjects/AISG Python/5 - Supervised Learning/Regression/learnai_regression2/learnai_regression2/Exercises/RegressionProject/Ex_LinearRegression_start.py"
No Python at 'C:\Users\User\AppData\Local\Programs\Python\Python37-32\python.exe'
I went to check the file path and indeed I think I have a different python version. It shouldve been Python38-32\python.exe.
Can someone tell me how I should make this change?
In order to set up python environment in vscode, you will have to select the interpreter via the command palette (ctrl+shift+p)
For the error, you might want to consider looking at this solution on their github: