运行“altinstall”ed python2.4 进行 Nodejs 安装
我是 Linux 新手,请耐心等待。
我试图让nodejs在我的服务器上运行,但是因为默认的python版本是2.3,而nodejs需要至少2.4才能安装,所以我已经完成了python2.4的“altinstall”。
python应该正确安装,我可以像这样运行它 /usr/local/bin/python2.4,当我进行版本检查-V时,它显示Python 2.4。
好的,现在我尝试在 ./configure
步骤继续安装 Nodejs。问题是我不确定如何实际让脚本使用 altinstall-ed python2.4 二进制文件。
我已经尝试过
./configure --prefix=$HOME/local/node -with-python=/usr/local/bin/python2.4
./configure --with-python=/usr/local/bin/python2.4
,但它们不起作用。我仍然不断收到此错误,
NameError: name 'set' is not defined
如何强制脚本使用此“altinstall”ed python2.4?
i'm new to linux, please bear with me.
i'm trying to get nodejs running on my server, but because the default python version is 2.3, and nodejs requires at least 2.4 to install, i have done a "altinstall" of python2.4.
the python should be installed correctly, i can run it like this /usr/local/bin/python2.4, and when i do a version check -V, it shows Python 2.4.
okay so now i'm trying to continue with the nodejs installation, at the ./configure
step. the problem is i'm not sure how to actually get the script to use the altinstall-ed python2.4 binary.
i've tried
./configure --prefix=$HOME/local/node -with-python=/usr/local/bin/python2.4
./configure --with-python=/usr/local/bin/python2.4
but they don't work. i still keep getting this error
NameError: name 'set' is not defined
how do i force the script to use this "altinstall"ed python2.4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我查看了源代码,节点源代码中的
./configure --help
没有提到指定您的 python,因此您可以尝试这些稍微有点黑客的技巧:An
alias python= /usr/local/bin/python2.4
在执行configure
之前可以工作。它不起作用,自定义
~/bin
目录(或类似名称,如果已经存在)中的符号链接到所需的 Python:尝试创建一个
bin/
目录在您的$HOME
路径中:然后将 Python 2.4 可执行文件链接到此目录:
然后在节点源代码树中,与您一起运行
configure
~/bin
目录作为$PATH
中的第一个目录:I had a look at the sources, and a
./configure --help
in the node sources said nothing about specifying your python, so you could try these slightly hackier tricks:An
alias python=/usr/local/bin/python2.4
before you executeconfigure
could work.It that doesn't work, a symlink in a custom
~/bin
directory (or similarly named if it already exists) to the desired Python:Try creating a
bin/
directory in your$HOME
path:Then link the Python 2.4 executable into this directory:
Then at the node source tree, run
configure
with you~/bin
directory as the first directory in your$PATH
: