最近在公司配置JCF的环境,碰到了一些杂七杂八的问题,所以在这里进行下总结。
【1】 Python的安装
在MAC下,python是默认安装好的,但根据说明,又重新下载了一份,进行了安装,导致系统中Python版本过多。如何删除过多的版本?
[A]
删除Python框架
sudo rm -rf /Library/Frameworks/Python.framework/Versions/x.x
删除Python程序
sudo rm -rf “/Applications/Python x.x”
删除/usr/local/bin目录下的Python连接
【2】安装python tool ,可以执行命令easy_install
Python Setup Tools http://pypi.python.org/pypi/setuptools
安装完成之后,
sudo easy_install scons 这个命令应该可以运行。
|
【3】Scons
到官网下载Scons,解压,然后运行命令python setup.py install, 安装scons;
或者用:sudo easy_install scons 安装。
安装完成之后,scons命令可以运行;
[B]出现问题:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/scons", line 5, in <module>
pkg_resources.run_script('scons==2.2.0', 'scons')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1207, in run_script
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scons-2.2.0-py2.7.egg/EGG-INFO/scripts/scons", line 188, in <module>
import SCons.Script
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/scons", line 5, in <module>
pkg_resources.run_script('scons==2.2.0', 'scons')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1207, in run_script
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scons-2.2.0-py2.7.egg/EGG-INFO/scripts/scons", line 188, in <module>
import SCons.Script
解决方式:export SCONS_DIR变量; 为能很好解决。查看路径设置。
|