安装Numpy编译VS2010为嵌入式解释器 [英] Install Numpy compiled for VS2010 for an embedded interpreter
问题描述
我在Windows上对嵌入式Python 2.7.3解释器的另一个疑问。我需要在Visual Studio 2010中编译的C ++程序中安装numpy和matplotlib作为嵌入解释器的支持包。
一些背景: / p>
我一直在努力使这个工作几个月。主要的问题是,针对Python 2.7的numpy是针对早期版本的MS C库(VS2008)编译的,而我的应用程序是针对2010版本编译的(这是我无法控制的事实 - 即Office编译器)。
我通过摆弄我的应用程序的清单,让它加载正确的C库为numpy这个工作,这让它导入。
我目前的状态:
>我将其中的一些固定在Python 2.7.3源代码中的一个不好的编译中,特别是依赖关系(很多崩溃似乎与matplotlib的Tkinter有关)。所以我重新开始Python编译,现在有一个干净的编译版本的所有核心和依赖的Python 2.7.3。现在我在看numpy / matplotlib。
我的问题
它是值得尝试编译numpy VS2010或者是我早期的清单修整解决方案的唯一方法?
如果前者,我可能遇到什么问题,
在后面的例子中,我如何在我的嵌入的intepreter的lib / site-packages文件夹中安装numpy?
使用cygwin在windows上构建numpy。
我在windows-xp
它对我工作很好.. ..
cygwin python2.6作为默认python。我已经安装python2.7,但没有安装numpy在python2.7。
要在python2.7上使用它,我已运行 python2.7 setup.py build
您可以在我的终端的屏幕截图中看到。和在文件夹'namit'我放置了'numpy'dir我编译cygwin。
当我导入numpy当我在那个dir ..它工作...你可以看到,在globals()从它导入的地方。
Another of my queries about an embedded Python 2.7.3 interpreter on Windows. I need to install numpy and matplotlib as support packages for an embedded interpreter in a C++ program compiled in Visual Studio 2010.
Some background:
I've been trying to make this work for a few months. The main issue is that numpy for Python 2.7 is compiled against an earlier version of the MS C library (VS2008) whereas my application is compiled against the 2010 version (a fact beyond my control - that is the office compiler). I worked around this by fiddling with the manifest for my application to let it load the correct C library for numpy and this got it to import. As an end-user has tried out new features, bugs have started to appear, including untraceable crashes.
My current state:
I pinned some of these down to a poor compilation on my part of the Python 2.7.3 source, in particular the dependencies (lots of the crashes seemed associated with Tkinter from matplotlib). So I started afresh on the Python compilation and now have a clean compiled version of all the core and dependencies of Python 2.7.3. Now I'm looking at numpy/matplotlib.
My questions
Is it worth attempting to compile numpy against VS2010 or is my earlier manifest mangling solution the only way?
If the former, what problems might I encounter in doing so (i.e. what should I watch ou for)?
In the latter, how do I get numpy to install in the lib/site-packages folder of my embedded intepreter?
use cygwin to build numpy on windows. I am on windows-xp
Its working fine for me.. .!
In cygwin python2.6 comes as a default python. I have installed python2.7 but not installed numpy in python2.7.
To use it on python2.7 i have run python2.7 setup.py build
You can see that in screen-shot of my terminal. and in folder 'namit' i have placed 'numpy' dir that i have compiled on cygwin.
when i have imported numpy when i am in that dir.. it worked...you can see that in globals() from where it has imported.
这篇关于安装Numpy编译VS2010为嵌入式解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!