Python Forum
VS2017 Enterprise, Python 3.6 Virutal Environment and .whl file installation. pip
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VS2017 Enterprise, Python 3.6 Virutal Environment and .whl file installation. pip
#1
Hi Python Guru's,
 I use Windows 10 and Visual Studio2017 64bit.I try to install pymssql but the corporate network ensures
that a network connection cant be established.
So I downloaded pymssql-2.1.3-cp36-cp36m-win_amd64.whl manually.
When I now go in VS 2017 to my virtual environment, right click to install
packages and type: 
pip install C:\Users\xxxx\Downloads\pymssql-2.1.3-cp36-cp36m-win_amd64.whl
I get the message:
 Requirement already satisfied: pip in c:\users\xxxxx\downloads\iwt_django\iwt_django\iwt_django\env_iwt\lib\site-packages
Collecting install
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor....
Could not find a version that satisfies the requirement install (from versions: )
No matching distribution found for install
----- Failed to install 'pip install C:\Users\xxxx\Downloads\pymssql-2.1.3-cp36-cp36m-win_amd64.whl' -----

 I read on Stackoverflow I can do the following to install into my virtual environment: 
py -m pip install C:\Users\xxxxx\Downloads\pymssql-2.1.3-cp36-cp36m-win_amd64.whl
But that just does not work.
 Question:
 I would like to install pymssql in the virtual environment that I set up with Visual Studio, not for the basic python environment on my PC.
Can I use the whl file to install into my virtual python environment?
Reply
#2
Can take how it's done.
Virtual environment is now build into 3.6.
# Make vir-enviroment
C:\1
λ python -m venv my_env

# cd in
λ cd my_env
C:\1\my_env

# Activate vir-enviroment
λ C:\1\my_env\Scripts\Activate
(my_env) C:\1\my_env

# check that pip in vir-enviroment is used
(my_env) C:\1\my_env
λ pip -V
pip 9.0.1 from c:\1\my_env\lib\site-packages (python 3.6)

# Place wheel file in folder my_env
(my_env) C:\1\my_env
λ pip install pymssql-2.1.3-cp36-cp36m-win32.whl
Processing c:\1\my_env\pymssql-2.1.3-cp36-cp36m-win32.whl
Installing collected packages: pymssql
Successfully installed pymssql-2.1.3

# Test
(my_env) C:\1\my_env
λ python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymssql
>>> pymssql.__version__
'2.1.3'
>>>
I have tutorial about it here.
Reply
#3
Hi snippsat,

thanks for your reply!

OK. So I am using windows and already have a virtual environment set up, just need to add pmssql.
So I open Python 3.6, and see my command prompt.
Now if I want to cd.. to

C:\Users\mybame\Downloads\iwt_django\iwt_django\iwt_django\env_iwt

I just get ...

I am very new to python.
Reply
#4
(Oct-25-2017, 03:33 PM)metalray Wrote: So I open Python 3.6, and see my command prompt.
Now if I want to cd.. to
You shall not open Python,only cmd and cd into env_iwt folder.
When in folder env_iwt,if shall install need to activate environment.
C:\Users\mybame\Downloads\iwt_django\iwt_django\iwt_django\env_iwt\Scripts\Activate
You see (env_iwt) when activated.
If already installed what you want,you use python.exe in env_iwt/Scripts folder.
And there is no need to use a annoying long path,as vir-environment can be made anywhere as you see in my example.
Reply
#5
Hi snippsat,

many thanks for your help.

I opend cmd, went to the \Scripts directory of my virtual environment and typed activate.

Now I see the following line in the cmd.

(env_iwt) C:\Users\myname\Downloads\iwt_django\iwt_django\iwt_django\env_iwt\Sc
ripts>

Pip is in the subfolder .ptvs\pip

but when I follow your steps and type "pip list" I get an error saying "Unable to create process using '"'.

Eventually I want to do a

pip install C:\Users\myname\Downloads\pymssql-2.1.3-cp36-cp36m-win_amd64.whl
Reply
#6
You are messing this up,you shall not activate when in Script folder but env_iwt folder.
metalray Wrote:Pip is in the subfolder .ptvs\pip
pip shall not be in this folder,it's in Script folder.
All shall be used from your env_iwt when active,not active use python.exe in script folder.
Just start from scratch and follow what i have posted,and look at link with tutorial.
Reply
#7
OK. Awesome I got it now.

I opened cmd and went to

C:\Users\myname\Downloads\iwt_django\iwt_django\iwt_django\env_iwt\Scripts\

I typed in "activate" and then

pip install C:\Users\myname\Downloads\pymssql-2.1.3-cp27-cp27m-win_amd64.whl

But now I read

pymssql-2.1.3-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform

Why is that? I got a Windows 10 64 Bit System and run a 64bit Python 3.6 virtual environment.
Reply
#8
(Oct-26-2017, 01:27 PM)metalray Wrote: cp27

This says the wheel is for Python 2.7,


(Oct-26-2017, 01:27 PM)metalray Wrote: win_amd64

This says it's for Windows 64 bit.

So this is the file you want: pymssql‑2.1.3‑cp36‑cp36m‑win_amd64.whl
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#9
Hi sparkz_alot,
Thanks for the reply. Now I understand what the cp36 stands for :)
I found a wheel pymssql‑2.1.3‑cp36‑cp36m‑win_amd64.whl  but the error still says
that it is a not supported wheel on this platform.
Reply
#10
Are you just using pip install pymssql , you should install as pip install c:\users\metalray\downloads\ pymssql‑2.1.3‑cp36‑cp36m‑win_amd64.whl (or what ever directory you downloaded it to).
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  White Screen Issue with Toolbar After Python Installation evelynfreya 3 1,248 Apr-30-2025, 06:43 AM
Last Post: encore
  I cannot create a virtual environment on visual studio code using python Willem_Aucamp316 2 3,890 Nov-27-2024, 02:20 PM
Last Post: menator01
  Install a module to a specific to Python Installation (one of many)) tester_V 2 2,284 Oct-29-2024, 03:25 PM
Last Post: snippsat
  Shrink Python installation? Extract site-packages from .zip only on demand? pstein 4 1,727 Oct-28-2024, 04:29 PM
Last Post: snippsat
  Troubleshooting Jupyter Notebook installation with Python using pip and a venv Drone4four 1 2,457 Jun-04-2024, 10:55 PM
Last Post: Drone4four
  Python installation for old MacOS Yonix 1 1,111 Sep-21-2023, 03:32 PM
Last Post: menator01
  Installing python packages in a virtual environment Led_Zeppelin 1 1,671 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  Installation of packages to newest Python version from previous one Andrzej_Andrzej 3 4,836 Jul-15-2023, 11:32 AM
Last Post: snippsat
  Understanding venv; How do I ensure my python script uses the environment every time? Calab 1 5,161 May-10-2023, 02:13 PM
Last Post: Calab
  Python development environment standenman 3 3,620 May-04-2023, 07:24 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020