运行“altinstall”ed python2.4 进行 Nodejs 安装

发布于 2024-11-01 22:43:32 字数 617 浏览 5 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冧九 2024-11-08 22:43:33

我查看了源代码,节点源代码中的 ./configure --help 没有提到指定您的 python,因此您可以尝试这些稍微有点黑客的技巧:

An alias python= /usr/local/bin/python2.4 在执行 configure 之前可以工作。

它不起作用,自定义 ~/bin 目录(或类似名称,如果已经存在)中的符号链接到所需的 Python:

尝试创建一个 bin/ 目录在您的 $HOME 路径中:

~$ mkdir bin     # <- in your home path

然后将 Python 2.4 可执行文件链接到此目录:

~$ cd bin
~/bin$ ln -s /usr/local/bin/python2.4 python

然后在节点源代码树中,与您一起运行 configure ~/bin 目录作为 $PATH 中的第一个目录:

[your node.js source path]$ PATH=$HOME/bin:$PATH ./configure

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 execute configure 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:

~$ mkdir bin     # <- in your home path

Then link the Python 2.4 executable into this directory:

~$ cd bin
~/bin$ ln -s /usr/local/bin/python2.4 python

Then at the node source tree, run configure with you ~/bin directory as the first directory in your $PATH:

[your node.js source path]$ PATH=$HOME/bin:$PATH ./configure
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文