Posts: 93
Threads: 38
Joined: Feb 2017
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?
Posts: 7,324
Threads: 123
Joined: Sep 2016
Oct-25-2017, 09:04 AM
(This post was last modified: Oct-25-2017, 09:04 AM by snippsat.)
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.
Posts: 93
Threads: 38
Joined: Feb 2017
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.
Posts: 7,324
Threads: 123
Joined: Sep 2016
Oct-25-2017, 04:35 PM
(This post was last modified: Oct-25-2017, 04:35 PM by snippsat.)
(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.
Posts: 93
Threads: 38
Joined: Feb 2017
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
Posts: 7,324
Threads: 123
Joined: Sep 2016
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.
Posts: 93
Threads: 38
Joined: Feb 2017
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.
Posts: 1,298
Threads: 38
Joined: Sep 2016
(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
Posts: 93
Threads: 38
Joined: Feb 2017
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.
Posts: 1,298
Threads: 38
Joined: Sep 2016
Oct-27-2017, 02:43 PM
(This post was last modified: Oct-27-2017, 02:44 PM by sparkz_alot.)
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
|