简体   繁体   English

如何在Mac OS上更新Python并让RubyGems使用新版本?

[英]How can I update Python on Mac OS and have RubyGems use the new version?

I am having serious issues trying to download the "therubyracer" gem. 我在尝试下载“ therubyracer” gem时遇到严重问题。 I think the problem is that I do not have a working libv8 library to create the gem. 我认为问题是我没有可以使用的libv8库来创建gem。

I think I do not have a working libv8 because my RubyGems keeps trying to use "Python 2.5.6", which is too old to gem install libv8 . 我想我没有一个libv8因为我的RubyGems一直尝试使用“ Python 2.5.6”,因为它太旧了,无法gem install libv8 I tried countless ways to update the Python that RubyGems uses, however, I cannot figure it out. 我尝试了无数种方法来更新RubyGems使用的Python,但是,我无法弄清楚。

Here is what I have done thus far. 到目前为止,这是我所做的。 I went to http://www.python.org/download/releases/3.3.2/ and downloaded "(Mac OS X 64-bit/32-bit Installer (3.3.2) for Mac OS X 10.6 and later 2.)". 我转到http://www.python.org/download/releases/3.3.2/并下载了“(针对Mac OS X 10.6及更高版本的Mac OS X 64位/ 32位安装程序(3.3.2)。 )”。

Upon completion of the download, I ran: 下载完成后,我运行了:

gem install libv8 --version 3.11.8.17

Yet, I still received the same error. 但是,我仍然收到相同的错误。 I noticed the output still said: 我注意到输出仍然说:

"Using Python 2.5.4"

Despite downloading a newer Python version, it is not being used. 尽管下载了更新的Python版本,但仍未使用它。 So how do I change the version of Python that the "gem" command uses? 那么,如何更改“ gem”命令使用的Python版本? I searched and discovered "virtualenv," which appears to be a good Python manager, however I am a bit at a dead end now. 我搜索并发现了“ virtualenv”,它似乎是一个不错的Python管理器,但是现在我有点死胡同了。 Any help or suggestion? 有什么帮助或建议吗?

If libv8 uses the python command from the command line, this should apply: 如果libv8从命令行使用python命令,则应适用:

If you do not care what python2 is installed, you can do this in the command line: 如果您不关心安装了什么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

Then you can copy one over the other 然后,您可以将一个复制到另一个

cp /usr/bin/python2.7 /usr/bin/python

You can safely copy python2.7 there because it is compatible with older versions. 您可以安全地在其中复制python2.7,因为它与旧版本兼容。

Suggestions? 有什么建议吗?

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

相关问题 在Mac OS上使用JGRASP时,如何更新Python版本? - How can I update Python version when working on JGRASP on mac os? 如何更新我的 Mac 以使用最新版本的 Python? - How do I update my Mac to use the latest version of Python? 我可以将enthought python重新连接到Mac OS X上的新版openssl吗? - Can I relink enthought python to new version of openssl on Mac OS X? 我的 Mac 上有两个 python 3 版本。 如何使用新版本和/删除旧版本? - I have two python 3 versions on my Mac. How do I use the new version and/remove the old one? 如何在 mac os x 上将 gunicorn 与 python3.8 而不是 python3.9 一起使用? - How can I use gunicorn with python3.8 instead of python3.9 on mac os x? 如何使用Python检测Mac OS版本? - How to detect Mac OS version using Python? 如何接收 Mac 的操作系统版本? 对于 Python 3.7 - How to receive OS version for Mac? For Python 3.7 如何将 mac os x en1 接口置于监视模式以与 python3 scapy 一起使用? - How can I put mac os x en1 interface into monitor mode to use with python3 scapy? 如何使用OpenCV(Python)读取视频文件而无需循环(Mac OS)? - How can I use OpenCV (Python) to read a video file WITHOUT looping (Mac OS)? 如何在Mac OS X上的PyCharm中使用Tensorflow调试器? - How can I use the Tensorflow debugger in PyCharm on Mac OS X?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM