pyodbc requires python 3.3

匿名 (未验证) 提交于 2019-12-03 01:58:03

问题:

I just downloaded installer for pyodbc from google project. I have Python 3.5 istalled and pyodbc requires 3.3. Is there an easy work around? P.S. I am installing it on PC without Internet access. This is for Windows.

回答1:

Since you can't install this via the regular pip channels, you can download a prebuilt binary for Python 3.5 from Chris Gohlke's site, where he has a bunch of libraries he creates builds for.

Download either depending on the version of Python 3.5 you have installed:

  • if you have a 32-bit Python 3.5 install
  • if you have a 64-bit Python 3.5 install

Get that file over to the computer you want to install on, and then install via pip on the command line:

pip install /path/to/whl/file 

If you don't have pip in your PATH, it's usually located in:

PYTHON_INSTALL_DIRECTORY\scripts\pip.exe 

Your install directory is probably C:\Python35 unless you specified something different when you installed it.



回答2:

Don't quite have the rep to comment so had to do it this way:

The @birryree answer worked on 64 bit Win 7 Enterprise SP1 but I got this ugly traceback which seems to be noise:

C:\Python\64-bit\Scripts>pip install \temp\python-wheels\uci.pyodbc-3.0.10-cp35-none-win_amd64.whl Processing c:\temp\python-wheels\uci.pyodbc-3.0.10-cp35-none-win_amd64.whl Installing collected packages: uci.pyodbc Exception: Traceback (most recent call last):   File "c:\python\64-bit\lib\site-packages\pip\basecommand.py", line 215, in main     status = self.run(options, args)   File "c:\python\64-bit\lib\site-packages\pip\commands\install.py", line 317, in run     prefix=options.prefix_path,   File "c:\python\64-bit\lib\site-packages\pip\req\req_set.py", line 742, in install     **kwargs   File "c:\python\64-bit\lib\site-packages\pip\req\req_install.py", line 831, in install     self.move_wheel_files(self.source_dir, root=root, prefix=prefix)   File "c:\python\64-bit\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files     isolated=self.isolated,   File "c:\python\64-bit\lib\site-packages\pip\wheel.py", line 348, in move_wheel_files     assert info_dir, "%s .dist-info directory not found" % req AssertionError: uci.pyodbc==3.0.10 .dist-info directory not found 

Note that I prepended the downloaded package with "uci." (since that is where Chris Gholkes site is hosted).

I know pyodbc was installed because I ran "pip list" before and after the install and got this:

    C:\Python\64-bit\Scripts>pip list pip (8.1.2) pyodbc (3.0.10)     

BTW, tested by porting (32-bit) Python 3.2.2 code to 64-bit 3.5.1. Win 7 Enterprise SP1 in both cases, no changes needed.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!