![](/img/trans.png)
[英]How can I update Python version when working on JGRASP on mac os?
[英]How can I update Python on Mac OS and have RubyGems use the new version?
我在嘗試下載“ therubyracer” gem時遇到嚴重問題。 我認為問題是我沒有可以使用的libv8
庫來創建gem。
我想我沒有一個libv8
因為我的RubyGems一直嘗試使用“ Python 2.5.6”,因為它太舊了,無法gem install libv8
。 我嘗試了無數種方法來更新RubyGems使用的Python,但是,我無法弄清楚。
到目前為止,這是我所做的。 我轉到http://www.python.org/download/releases/3.3.2/並下載了“(針對Mac OS X 10.6及更高版本的Mac OS X 64位/ 32位安裝程序(3.3.2)。 )”。
下載完成后,我運行了:
gem install libv8 --version 3.11.8.17
但是,我仍然收到相同的錯誤。 我注意到輸出仍然說:
"Using Python 2.5.4"
盡管下載了更新的Python版本,但仍未使用它。 那么,如何更改“ gem”命令使用的Python版本? 我搜索並發現了“ virtualenv”,它似乎是一個不錯的Python管理器,但是現在我有點死胡同了。 有什么幫助或建議嗎?
如果libv8從命令行使用python命令,則應適用:
如果您不關心安裝了什么python2,則可以在命令行中執行此操作:
type python # this gives you the path of the python command
python is /usr/bin/python
type python2.7
python is /usr/bin/python2.7
然后,您可以將一個復制到另一個
cp /usr/bin/python2.7 /usr/bin/python
您可以安全地在其中復制python2.7,因為它與舊版本兼容。
有什么建議嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.