How to download python modules in visual studio code? I have tried to download using pip but vs-code uses windows cmd/PowerShell therefore pip didn't work.
-
2"but vs-code uses windows cmd/PowerShell therefore pip didn't work" that is not truejuanpa.arrivillaga– juanpa.arrivillaga2019-08-02 15:35:05 +00:00Commented Aug 2, 2019 at 15:35
-
@juanpa.arrivillaga so how do I do?Dhruvik– Dhruvik2019-08-02 15:37:37 +00:00Commented Aug 2, 2019 at 15:37
-
vs-code simply opens a terminal console for your convenience. What terminal is totally up to the operating system you are using. Aside from that, pip works also on cmd. Please refer to these step: docs.python.org/3/installing/index.html and if you get stuck try to update your question with more details relevant to the specific step in which errors occur.aviya.developer– aviya.developer2019-08-02 16:44:53 +00:00Commented Aug 2, 2019 at 16:44
-
See How to use pip with Visual Studio CodeGino Mempin– Gino Mempin2019-08-03 00:59:48 +00:00Commented Aug 3, 2019 at 0:59
1 Answer
Your best solution is to create a virtual environment for your project and then install into that. So if you're on Windows and don't have access to pip then you probably used the python.org installer and don't have python3 on your path either. In that case you can do py -m venv .venv to create a virtual environment (this is assuming you're using Python 3). Once that's created you will want to select the virtual environment (see the environments documentation on how to do that).
That gets you a proper environment to develop in. From there you can open a terminal with Python: Create Terminal and that will automatically activate the virtual environment, putting python on your path so you can use python -m pip install to install your dependencies (pip will also be there, but it's better to use python -m pip to help make sure you're installing into the Python interpreter you expect).