Timothy Lawman
Timothy Lawman

Reputation: 2312

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?

Upvotes: 8

Views: 19078

Answers (2)

Chad Kennedy
Chad Kennedy

Reputation: 1736

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".

Upvotes: 2

Ryan Joy
Ryan Joy

Reputation: 3039

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

Upvotes: 15

Related Questions