0
votes

I am about to give up - I've been racking my brain and searching the web for too long....every time I think I have a solution, I end up back at the same place. It might just be that I have to have an administrator on my corporate laptop install things....as I cannot change the system path. Although, it does appear to have python in the path as illustrated below.

enter image description here

I also feel like my corporate set up is creating confusion between where the python executable is stored and where the modules, etc are saved. For example, my python 3.5 executable is saved here: C:\Program Files\Python35 and there is a scripts subfolder by everything in the is a shortcut to another network location...

In the Scripts folder, there are 3 pip shortcuts, pip, pip3.5, and pip3. Not sure why there are 3 - maybe there are 3 due to all my attempts to get it to work.

As an example, I am trying to install pyodbc and am getting the following errors:

C:\Users\n909858>python

Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

python -m pip install pyodbc

Defaulting to user installation because normal site-packages is not writeable Collecting pyodbc Using cached pyodbc-4.0.30.tar.gz (266 kB) Building wheels for collected packages: pyodbc Building wheel for pyodbc (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'C:\Program Files\Python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\n909858\AppData\Local\Temp\pip-install-6ewnhgp2\pyodbc\setup.py'"'"'; file='"'"'C:\Users\n909858\AppData\Local\Temp\pip-install-6ewnhgp2\pyodbc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\n909858\AppData\Local\Temp\pip-wheel-eswyhvq9' cwd: C:\Users\n909858\AppData\Local\Temp\pip-install-6ewnhgp2\pyodbc
Complete output (5 lines): running bdist_wheel running build running build_ext building 'pyodbc' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

ERROR: Failed building wheel for pyodbc Running setup.py clean for pyodbc Failed to build pyodbc Installing collected packages: pyodbc Running setup.py install for pyodbc ... error ERROR: Command errored out with exit status 1: command: 'C:\Program Files\Python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\n909858\AppData\Local\Temp\pip-install-6ewnhgp2\pyodbc\setup.py'"'"'; file='"'"'C:\Users\n909858\AppData\Local\Temp\pip-install-6ewnhgp2\pyodbc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\n909858\AppData\Local\Temp\pip-record-gsl37vue\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\n909858\AppData\Roaming\Python\Python35\Include\pyodbc' cwd: C:\Users\n909858\AppData\Local\Temp\pip-install-6ewnhgp2\pyodbc
Complete output (5 lines): running install running build running build_ext building 'pyodbc' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\Program Files\Python35\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\n909858\AppData\Local\Temp\pip-install-6ewnhgp2\pyodbc\setup.py'"'"'; file='"'"'C:\Users\n909858\AppData\Local\Temp\pip-install-6ewnhgp2\pyodbc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\n909858\AppData\Local\Temp\pip-record-gsl37vue\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\n909858\AppData\Roaming\Python\Python35\Include\pyodbc' Check the logs for full command output.

1
I’ve also tried the wheel file explicitly and the visual studio download to no avail.BuJay

1 Answers

0
votes

Current versions of pyodbc do not have official pre-compiled wheel files for Python 3.5. Therefore, if you are unable to upgrade Python to a more current version (Python 3.5 reaches End of Life [EOL] two months from now: September 2020) then you will need to compile pyodbc from source. Details on that here:

https://github.com/mkleehammer/pyodbc/wiki/Building-pyodbc-from-source#windows

p.s. If you are okay with a slightly older version of pyodbc (4.0.28) then you can get wheel files here.