简体   繁体   English

使用python2.7在Windows中的tkinter opencv和numpy

[英]tkinter opencv and numpy in windows with python2.7

I want to use "tkinter", "opencv" (cv2) and "numpy" in windows(8 - 64 bit and x64) with python2.7 - the same as I have running perfectly well in Linux (Elementary and DistroAstro) on other machines. 我想在Windows(8-64位和x64)和python2.7中使用“ tkinter”,“ opencv”(cv2)和“ numpy”-与我在其他Linux(Elementary和DistroAstro)上运行得很好一样机器。 I've downloaded the up to date Visual Studio and C++ compiler and installed these, as well as the latest version of PIP following error messages with the first attempts with PIP and numpy 我已经下载了最新的Visual Studio和C ++编译器并安装了它们,以及在出现错误消息后首次尝试使用PIP和numpy的最新版本的PIP。

  • first I tried winpython, which already has numpy present but this comes without tkinter, although openCV would install. 首先,我尝试了winpython,它已经存在numpy了,但是尽管topen可以安装,但它没有tkinter。 I don't want to use qt. 我不想使用qt。
  • so I tried vanilla Python, which installs to Python27. 所以我尝试了香草Python,它已安装到Python27。 Numpy won't install with PIP or EasyInstall (unless it takes over an hour -same for SciPy), and the -.exe installation route for Numpy bombs becausee its looking for Python2.7 (not Python27). Numpy不会通过PIP或EasyInstall进行安装(除非花费一个多小时-与SciPy相同),并且Numpy炸弹的-.exe安装路径是因为它正在寻找Python2.7(而非Python27)。 openCV won't install with PIP ("no suitable version") openCV不会与PIP一起安装(“没有合适的版本”)
  • extensive searches haven't turned up an answer as to how to get a windows Python 2.7.x environment with all three of numpy, tkinter and cv2 working. 广泛的搜索还没有找到有关如何使numpy,tkinter和cv2都能正常运行的Windows Python 2.7.x环境的答案。

Any help would be appreciated! 任何帮助,将不胜感激!

Finally did it with .whl files. 终于用.whl文件做到了。 Download them, copy to C:\\python27\\Scripts and then open "cmd" and navigate to that folder with "cd\\" etc. Once there run: 下载它们,将其复制到C:\\ python27 \\ Scripts,然后打开“ cmd”并使用“ cd \\”等导航到该文件夹​​。一旦运行:

pip install numpy-1.10.1+mkl-cp27-none-win_amd64.whl 点安装numpy-1.10.1 + mkl-cp27-none-win_amd64.whl

for example. 例如。

In IDLE I then get: 在空闲状态下,我得到:

import numpy 导入numpy

numpy. 麻木 version

'1.10.1' '1.10.1'

小记:WinPython具有tkinter,因为它已包含在Python Interpreter中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM