macos 如何在 Mac OS X 上安装 scons

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1207702/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:18:07  来源:igfitidea点击:

How to install scons on Mac OS X

macosscons

提问by n179911

Can you please tell me how can I install scons on MacOSX?

你能告诉我如何在 MacOSX 上安装 scons 吗?

I don't see a mac specified download from http://www.scons.org/

我没有看到从http://www.scons.org/指定的 mac 下载

Thank you.

谢谢你。

回答by Joseph Wright

An alternative to MacPorts would be to use HomeBrew, where you'd just to

MacPorts 的替代方法是使用HomeBrew,您只需在其中

brew install scons

回答by Rob Kennedy

Download the tarballand then refer to the first chapter of the user guide, Building and Installing SCons. In short:

下载 tarball,然后参考用户指南的第一章构建和安装 SCons。简而言之:

# cd scons-1.2.0
# python setup.py install

回答by Michael Aaron Safyan

Install MacPorts, then at the Terminal (Applications > Utilities > Terminal.app), type:

安装MacPorts,然后在终端(应用程序 > 实用工具 > Terminal.app),输入:

sudo port install scons

This command will automatically download and install scons for you. MacPorts requires that you have the developer tools installed, so if you don't, you will need to download and install the Xcode 3 DVD.

此命令将自动为您下载并安装 scon。MacPorts 要求您安装开发人员工具,因此如果您没有安装,则需要下载并安装Xcode 3 DVD

NOTE 1: Xcode 2.5is the last version of Xcode that will work on Mac OS X Tiger.

注意 1:Xcode 2.5是适用于 Mac OS X Tiger 的最后一个 Xcode 版本。

NOTE 2: This may seem awfully painful if you don't already have MacPorts installed. However, you really should go this route, as MacPorts makes it easy to update installed software, it automatically manages dependencies between software, and it makes it easier to install other packages in the future.

注意 2:如果您还没有安装 MacPorts,这可能看起来非常痛苦。但是,您确实应该走这条路,因为 MacPorts 可以轻松更新已安装的软件,它会自动管理软件之间的依赖关系,并且可以更轻松地在将来安装其他软件包。

回答by ken

If you have the Python setuptools, the following will install scons-1.2.0 from sourceforge:

如果你有 Python setuptools,下面将从 sourceforge 安装 scons-1.2.0:

easy_install scons

But bear in mind the issues people raisewith setuptools.

但请记住人们使用 setuptools提出问题

Also, keep in mind this questionand the answers about virtualenv and pip for isolating Python environments.

另外,请记住这个问题以及有关用于隔离 Python 环境的 virtualenv 和 pip 的答案。

回答by Richard Viney

There is also a GUI installer for SCons on Mac OS X that I wrote available for download here:

我编写的 Mac OS X 上的 SCons 也有一个 GUI 安装程序,可在此处下载:

https://github.com/rviney/scons-mac-installer

https://github.com/rviney/scons-mac-installer

回答by anatoly techtonik

Since version 2.3.0 SCons should work without installing:

由于版本 2.3.0 SCons 无需安装即可运行:

# get the source and switch to stable 2.3.0 version
hg clone https://bitbucket.org/scons/scons/ -r 2.3.0

# make sure to use Python 2 for now
python scons/src/scripts/scons.py

When running 2.3.0 from source, the SCons.__version__is not set correctly, so EnsureSConsVersion() will likely to fail if that's ok for you.

从源代码运行 2.3.0 时,SCons.__version__未正确设置,因此如果对您来说没问题,EnsureSConsVersion() 可能会失败。

回答by Aaron Smith

pull down SCons source and put it in /Library/Python/X.X/. Make sure you have the dir structure like this: /Library/Python/X.X/SCons/init.py

拉下 SCons 源并将其放在 /Library/Python/XX/ 中。确保你有这样的目录结构:/Library/Python/XX/SCons/ init.py

remember, import searches for modules, and /Library/Python/XXX is by default in the search path.

请记住,导入搜索模块,默认情况下 /Library/Python/XXX 位于搜索路径中。