安装“简易安装”使用虚拟 python 和 setuptool

发布于 2025-01-07 17:49:52 字数 1719 浏览 1 评论 0原文

我正在尝试在没有 root 访问权限的 Linux 服务器上安装 virtual-python。我已经阅读了自定义安装的 PEAK 开发手册,但是我仍然不知道我做错了什么。

这是我的配置:

在.bashrc中创建了.pythdisutils.cfg

 [install]
 install_lib  = /home2/me/lib
 install_scripts = /home2/me/bin

Python env路径:

 export  PYTHONPATH="${PYTHONPATH}:~/lib/"

虚拟python安装在:

 ~/lib/python2.4/site-packages
 ~/bin/python

我尝试了这些代码但没有成功:

 sh setuptools-0.6c11-py2.4.egg
 sh setuptools-0.6c11-py2.4.egg --prefix=~
 ...

我得到的错误:

 TEST FAILED: /home2/me/lib/ does NOT support .pth files
 error: bad install directory or PYTHONPATH

 You are attempting to install a package to a directory that is not
 on PYTHONPATH and which Python does not read ".pth" files from.  The
 installation directory you specified (via --install-dir, --prefix, or
 the distutils default setting) was:

/home2/me/lib/

and your PYTHONPATH environment variable currently contains:

':~/lib/python2.4/site-packages/:~/lib/python2.4/site-packages/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
variable.  (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:

http://peak.telecommunity.com/EasyInstall.html#custom-installation-locations

Please make the appropriate changes for your system and try again.

I'm trying to install virtual-python on linux server which I don't have root access. I have read PEAK development manual for custom installation however I still can't figure out what I'm doing wrong.

Here are my configurations:

created .pythdisutils.cfg

 [install]
 install_lib  = /home2/me/lib
 install_scripts = /home2/me/bin

Python env path in .bashrc:

 export  PYTHONPATH="${PYTHONPATH}:~/lib/"

virtual python installed in:

 ~/lib/python2.4/site-packages
 ~/bin/python

I tried these codes but not successful:

 sh setuptools-0.6c11-py2.4.egg
 sh setuptools-0.6c11-py2.4.egg --prefix=~
 ...

error I get:

 TEST FAILED: /home2/me/lib/ does NOT support .pth files
 error: bad install directory or PYTHONPATH

 You are attempting to install a package to a directory that is not
 on PYTHONPATH and which Python does not read ".pth" files from.  The
 installation directory you specified (via --install-dir, --prefix, or
 the distutils default setting) was:

/home2/me/lib/

and your PYTHONPATH environment variable currently contains:

':~/lib/python2.4/site-packages/:~/lib/python2.4/site-packages/'

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
variable.  (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:

http://peak.telecommunity.com/EasyInstall.html#custom-installation-locations

Please make the appropriate changes for your system and try again.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

世界和平 2025-01-14 17:49:52

您的 PYTHONPATH 似乎设置不正确。尝试“exec bash”,并验证输出

echo $PYTHONPATH

是否包含预期值。将 ~ 替换为 $HOME

哦,你真的使用 bash 作为 shell 吗?除非您重新启动 shell 并且正在使用 bash,否则修改 .bashrc 当然不会改变任何内容。

Your PYTHONPATH doesn't seem to be setup correctly. Try "exec bash", and verify the output of

echo $PYTHONPATH

to contain the expected values. Replace ~ with $HOME.

Oh, and are you actually using bash as shell? Unless you restart your shell and you are using bash, modifying .bashrc of course will not change anything.

梦里泪两行 2025-01-14 17:49:52
export PYTHONPATH="${PYTH/home2/me/lib"

这似乎……要么是拼写错误,要么是错误的。也许你的意思是...

export PYTHONPATH="$PYTHONPATH:/home2/me/lib"

export PYTHONPATH="${PYTH/home2/me/lib"

This seems... either a typo or wrong. Perhaps you meant...

export PYTHONPATH="$PYTHONPATH:/home2/me/lib"

?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文