Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get python modules into Visual studio 2015 Community edition

Simple problem, made difficult of course , by Microsoft. How do I install sqlite3 or Pmw on my Visual Studio Community version of Python. I normally place the files my self into site packages folder. With Visual studio they talk about packet manager but where is it? Can it really be this hard?

like image 631
Timothy Lawman Avatar asked Sep 23 '15 17:09

Timothy Lawman


People also ask

Does Visual Studio community support Python?

Python Tools for Visual Studio is a completely free extension, developed and supported by Microsoft with contributions from the community.


2 Answers

Hopefully you have the Python Tools for Visual Studio plugin installed. If not, go to https://github.com/Microsoft/PTVS to get v2.2. You can also check out a PTVS Getting Started tutorial series on YouTube.

Assuming you have PTVS, right click on your Python Environments in your solution. Add Virtual Environment. enter image description here

Right click on the env and choose Install Python Package. enter image description here

Install your Python package. enter image description here

For SQLite3, you place your .db or .sqlite3 file in your project. If you copied it manually in and you want Visual Studio to "see it" in the Solution Explorer, you may need to right click on the solution name and Add Existing Item...

I also recommend you go to "Tools >> Python >> Python Environments" to bring up a pane where you can explore any Python versions or virtual environments available to this solution. You can see which module are installed, if they're out of date, and search the PyPI directly from there. enter image description here

like image 171
Ryan Joy Avatar answered Sep 28 '22 08:09

Ryan Joy


Just go to your Python/Scripts folder at the command prompt and "pip install ". You may need an administrator command prompt.

If it's a package with binary components (numpy, etc), you can download and install from here (very useful site): http://www.lfd.uci.edu/~gohlke/pythonlibs/ Just be sure to get the version and 32/64 bit that matches your python.exe.

Within VS2015, Tools - Python Tools - Python Environments. Select an environment from the left side, and you'll see an entry one column to the right 'pip'. Select that. There's now a search box where you can type in the package you want. Then scroll down and select "Install package".

like image 37
Chad Kennedy Avatar answered Sep 28 '22 09:09

Chad Kennedy