简体   繁体   English

在Windows 8.1上安装Boost Python,正确设置工具链

[英]Installing Boost Python on Windows 8.1, Setting up the toolchain correctly

I am trying to install Boost Python, however http://www.boost.org/doc/libs/1_55_0/libs/python/doc/tutorial/doc/html/python/hello.html is too compressed for me. 我正在尝试安装Boost Python,但http://www.boost.org/doc/libs/1_55_0/libs/python/doc/tutorial/doc/html/python/hello.html对我来说太压缩了。 I am switchig to Windows from Linux, setting up all the technical stuff drives me crazy :) 我从Linux切换到Windows,设置所有技术的东西让我疯狂:)

So when I follow the instructions http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html#prepare-to-use-a-boost-library-binary and try to execute bootstrap.bat it complains about a missing VCVARS32.BAT and it does not recognice the "cl" command - I have however both MS VS Express 2012 and 2013 installed, both boost versions (32, 64) are installed in C:/local/, documentations says that both should work. 因此,当我按照说明http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html#prepare-to-use-a-boost-library-binary并尝试执行bootstrap.bat时它抱怨缺少VCVARS32.BAT并且它没有识别“cl”命令 - 但我安装了MS VS Express 2012和2013,两个升级版本(32,64)都安装在C:/ local /中,文档说两者都应该有效。 So why does it not find the compiler? 那么为什么找不到编译器呢?

Update: So http://msdn.microsoft.com/en-us/library/9s7c9wdw%28v=vs.110%29.aspx says that you cannot use the compiler from the command line... how do I build my bjam then? 更新:所以http://msdn.microsoft.com/en-us/library/9s7c9wdw%28v=vs.110%29.aspx说您不能从命令行使用编译器...如何构建我的bjam然后? This must be something totally trivial and stupid... :/ 这必须是一件非常琐碎和愚蠢的事情......:/

Update: Okay, one step further. 更新:好的,更进一步。 vcvars32.bat actually sets all environment variables to go, so i can invoke the command line compiler now! vcvars32.bat实际上设置了所有环境变量,所以我现在可以调用命令行编译器! Also there are actually prebuild binaries of bjam from the official boost site http://sourceforge.net/projects/boost/files/ , I got it and copied it to by boost_xxx/tools folder and added the site to the path, so i can invoke bjam from command line as well. 实际上还有来自官方提升网站http://sourceforge.net/projects/boost/files/的bjam预构建二进制文件,我得到了它并将其复制到boost_xxx / tools文件夹并将网站添加到路径中,所以我也可以从命令行调用bjam。 Next I put a user-config.jam in my home folder, it only says: 接下来我将user-config.jam放在我的主文件夹中,它只说:

#  MSVC configuration
using msvc : 11.0 ;

#  Python configuration
using python : : C:/Users/me/Anaconda ;

In the Jamroot file provided with C:\\local\\boost_1_55_0\\libs\\python\\example\\tutorial, I only edited 在随C:\\ local \\ boost_1_55_0 \\ libs \\ python \\ example \\ tutorial提供的Jamroot文件中,我只编辑过

use-project boost
: C:/local/boost_1_55_0 ;

then I call bjam from the very same directory which gives my some cryptic output 然后我从同一个目录调用bjam,这给了我一些神秘的输出

C:\local\boost_1_55_0\libs\python\example\tutorial>bjam
warning: mismatched versions of Boost.Build engine and core
warning: Boost.Build engine (bjam) is 03.1.18
warning: Boost.Build core (at C:/local/boost_1_55_0/tools/build/v2) is 2011.12-s
vn
link.jam: No such file or directory
C:/local/boost_1_55_0/tools/build/v2/util\path.jam:458: in path.makedirs
rule MAKEDIR unknown in module path.
C:/local/boost_1_55_0/tools/build/v2/build\configure.jam:233: in configure.set-l
og-file
C:/local/boost_1_55_0/tools/build/v2\build-system.jam:695: in load
C:\local\boost_1_55_0\libs\python\example\..\..\..\tools\build\v2/kernel\modules
.jam:289: in import
C:\local\boost_1_55_0\libs\python\example\..\..\..\tools\build\v2\kernel\bootstr
ap.jam:139: in boost-build
C:\local\boost_1_55_0\libs\python\example\boost-build.jam:7: in module scope

C:\local\boost_1_55_0\libs\python\example\tutorial>

Now, can you give me any hints as to what went wrong and where to go from here? 现在,你能否给我一些关于出了什么问题以及从哪里出发的提示? I really want a stable, robust working copy of boost.python - it doesn't make sense to me if I need to hack something together. 我真的想要一个稳定,健壮的boost.python工作副本 - 如果我需要一起破解某些东西,对我来说没有意义。 I thought it was quite standard/reliable, isn't there something like "boost.python for guys who did not study computer science"? 我认为这是非常标准/可靠的,对于没有学习计算机科学的人来说,有没有“boost.python”这样的东西? Can I ignore the warnings? 我可以忽略这些警告吗?

Perhaps you can use the binary from http://www.lfd.uci.edu/~gohlke/pythonlibs/#boost.python 也许你可以使用http://www.lfd.uci.edu/~gohlke/pythonlibs/#boost.python中的二进制文件

Regarding your compiler problems: there is a bunch of questions on this on SO already. 关于你的编译器问题:在SO上已经有很多问题了。 Basically, the compiler you need depends on your version of python. 基本上,您需要的编译器取决于您的python版本。 You will probably need to install some Windows SDK and setup some stuff manually. 您可能需要安装一些Windows SDK并手动设置一些东西。 It has always been a pain in the ass for me and in the end you might be better of with using some python distribution like Canopy (there are a few others out there). 对我来说,这对我来说一直是个痛苦,最后你可能会更好地使用像Canopy这样的python发行版(那里有一些其他版本)。

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

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