I am new to Python and I am facing this confusing situation. As we know after rmoving the requests package from global installation I am not able to execute the code
and we know according to the lecture that when I run the command pipenv shell
Ok, so to be able to run it globally without running the above comman I have added the path to python entry in the settings.json file as follows after extracting the full path by another command… see as follows:
this create env if not created and also activate at the same time;
once you activated env you can import libraries which you have installed in this env using command pipenv install requests
if you work outside of this env then requests module is not be available
Thank you so much. That is exactly what I understood but confusion started when Mosh introduced the extension of (code-runner). If, we could at the the VS code, execute a program from either the Terminal or from the menu (Ctrl+F5) why should we use code-runner and even have to modify the settings.json. However, I will go back to the env topic and review it more thoroughly and I will apprreciate any other additions from you if you have.
without code runner extension you have to manually execute programming script like i did in above image for python
if you have installed code runner extension you just need to click on top right conner icon or use shortcut ctrl+f5
sometime you want to write script in a terminal like this python app.py for executing the app.py file instead of using icon or shortcut this is where you can play with setting
Thank you for having the time to answer my queries. Now i could do it. The code runner at first could not see the path to the virtual environment until i discovered that that this path contained two separated words (sarmad alsaadi) then i only surriunded them with quotes and voila it worked.
One thing remains confusing a red underline is still appearing under the word (requests)
despite the fact that the package is installed in the ve and code run normally