Windows 上的 Python - 编译 [英] Python on Windows - compiling

查看:31
本文介绍了Windows 上的 Python - 编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像我之前的许多人一样,我没有成功在 Windows 上安装一些 Python 包(mysql、pycld2 等).我有一台 64 位的 Windows 8 机器和 Python 3.4.起初,我收到了众所周知的错误找不到 vcvarsall.bat - 安装 VS C++ 10.0".我试图通过安装 MinGW 并将其用作编译器来解决这个问题.这没有用.然后最后我在这里找到了这个 VS C++ 10.0 的安装程序 http://microsoft-visual-cpp-express.soft32.com/free-download/.这也不太好.现在它似乎找到了 vcvarsall 文件,但给了我几个新错误

Like many before me I don´t succeed in installing a few Python packages (mysql, pycld2, etc.) on Windows. I have a Windows 8 machine, 64-bit, and Python 3.4. At first I got the well-known error "can´t find vcvarsall.bat - install VS C++ 10.0". This I tried to solve by installing MinGW and use that as compiler. This did not work. Then finally I found an installer for this VS C++ 10.0 here http://microsoft-visual-cpp-express.soft32.com/free-download/. This doesn´t work too good either. Now it seems to find the vcvarsall file but instead gives me a couple of new errors

nclude -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.
obj /Zl_mysql.c_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':
No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

还有:

pycldmodule.cc
bindings\pycldmodule.cc(16) : fatal error C1083: Cannot open include file: '
strings.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

所以现在它没有找到 strings.h 和 config-win.h,我对这些类型的问题太陌生了,不知道该找什么.有谁知道我应该怎么做?

So now it doesn´t find strings.h and config-win.h and I´m too new to these sorts of problems to know what to look for. Anyone knows what I should do?

问题是我不能使用 Windows 而转而使用 Ubuntu,因为据我所知,使用 python 可以轻松工作.但是,我必须使用 Ubuntu 上不存在的 win32com 包(我理解对吗?).如果我无法在 Windows 上解决这些安装麻烦,那么解决方案是将 Windows 虚拟机用于 win32com 部分,然后在主机 Ubuntu(或其他方式)上完成其余工作吗?在这种情况下,两者之间是否可以进行通信?IE.发送字符串或数据数组.

The thing is that I could just not use Windows and go over to Ubuntu as, for what I´ve understood, works painlessly with python. However, I have to use the win32com package which doesn´t exist on Ubuntu (have I understood that right?). If I can´t solve these installing hassles on Windows, would a solution be to use a Windows virtual machine for the win32com part and do the rest on a host Ubuntu (or the other way around)? Would there be anyway to communicate between the two in that case? I.e. sending strings or arrays of data.

推荐答案

我在 64 位 Windows 上尝试安装 pycld2 时遇到了与 Python 2.7 完全相同的问题.

I have faced the exact same issues for Python 2.7 on 64 bit Windows trying to install pycld2.

尝试了很多方法,例如安装 VS express 2008、MingW 等,但都不起作用.

Tried many methods like installing VS express 2008, MingW, etc and it just doesnt work.

拯救我的是这个链接:https://github.com/aboSamoor/polyglot/issues/11

建议的解决方案是从 http://www.lfd.uci 下载二进制文件.edu/~gohlke/pythonlibs/ 和 pip install .whl

The proposed solution is to download the binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and pip install .whl

cpXX 表示 python 的版本.所以就我而言,我使用了 cp27.

The cpXX denotes the version of python. So in my case, I used cp27.

希望能帮到你

这篇关于Windows 上的 Python - 编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆