如何在 Mac OS X 上安装 scons
Can you please tell me how can I install scons on MacOSX?
I don't see a mac specified download from http://www.scons.org/
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
MacPorts 的替代方案是使用 HomeBrew,您只需
An alternative to MacPorts would be to use HomeBrew, where you'd just to
下载 tarball,然后参阅用户指南的第一章 构建和安装 SCons。 简而言之:
Download the tarball and then refer to the first chapter of the user guide, Building and Installing SCons. In short:
安装 MacPorts,然后在终端(应用程序 > 实用程序 > Terminal.app)中键入:
此命令将自动为您下载并安装 scons。 MacPorts 要求您安装开发人员工具,因此如果没有安装,您将需要下载并安装 Xcode 3 DVD。
注 1:Xcode 2.5 是可在 Mac OS X Tiger 上运行的最新 Xcode 版本。
注意 2:如果您还没有安装 MacPorts,这可能看起来非常痛苦。 但是,您确实应该走这条路,因为 MacPorts 可以轻松更新已安装的软件,它会自动管理软件之间的依赖关系,并且可以更轻松地将来安装其他软件包。
Install MacPorts, then at the Terminal (Applications > Utilities > Terminal.app), type:
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.
NOTE 1: Xcode 2.5 is the last version of Xcode that will work on Mac OS X Tiger.
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.
如果您有Python setuptools,以下将从sourceforge安装scons-1.2.0:
但请记住人们使用安装工具提出的问题。
另外,请记住这个问题和关于用于隔离 Python 环境的 virtualenv 和 pip 的答案。
If you have the Python setuptools, the following will install scons-1.2.0 from sourceforge:
But bear in mind the issues people raise with setuptools.
Also, keep in mind this question and the answers about virtualenv and pip for isolating Python environments.
还有我编写的 Mac OS X 上 SCons 的 GUI 安装程序,可以在此处下载:
https:/ /github.com/rviney/scons-mac-installer
There is also a GUI installer for SCons on Mac OS X that I wrote available for download here:
https://github.com/rviney/scons-mac-installer
由于版本 2.3.0 SCons 无需安装即可工作:
从源代码运行 2.3.0 时,
SCons.__version__
设置不正确,因此如果您可以的话,EnsureSConsVersion() 可能会失败。Since version 2.3.0 SCons should work without installing:
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.通过 pipx
pipx
(如果尚未完成)pipx install scons
插入
到 bashrc/zshrc 中。
pipx 的优点
在隔离环境中安装和运行 Python 应用程序。 (请参阅xkcd 对 Python 依赖项的看法)。
Installation via pipx
pipx
(if not yet done)pipx install scons
Insert
into bashrc/zshrc.
Advantages of pipx
Install and run Python applications in isolated environments. (see xkcd's take on Python dependencies).
下拉 SCons 源并将其放入 /Library/Python/XX/ 中。 确保你有这样的目录结构: /Library/Python/XX/SCons/init.py
记住,导入搜索模块,并且 /Library/Python/XXX 默认在搜索路径中。
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
remember, import searches for modules, and /Library/Python/XXX is by default in the search path.