easy_install下载目录

发布于 2024-12-07 16:56:48 字数 1456 浏览 3 评论 0原文

我正在尝试使用 easy_install 安装以 Egg 格式打包的 python 脚本。问题是 easy_install 将依赖项下载到 /tmp。但是,我的 tmp 目录只有 4mb 的可用空间(我正在使用 NAS 驱动器,按此方式设置)。

有没有办法指定下载目录? --help 似乎没有给出任何有用的东西。

编辑:

更多详细信息:

我正在运行从 optware 安装的 python 2.5.6 和 setuputils 0.6c11-2。 NAS 基于 ARM(特别是安装了 fun_plug 的 DNS-320)。如果您需要更多具体信息,请告诉我。

当我使用 -b 选项时,文件仍然下载到 /tmp。实际上,提取过程使用了 tmp 中的剩余空间:

easy_install-2.5 -b /mnt/HD/HD_a2/ffp/home/root SQLAlchemy==0.7.2
搜索 SQLAlchemy==0.7.2
阅读http://pypi.python.org/simple/SQLAlchemy/
阅读http://www.sqlalchemy.org
最佳匹配:SQLAlchemy 0.7.2
下载http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.7.2.tar.gz#md5=b84a26ae2e5de6f518d7069b29bf8f72
处理 SQLAlchemy-0.7.2.tar.gz
错误:设备上没有剩余空间

我知道在下载时通过运行 ls -l /tmp/ 将文件下载到 /tmp 中:

<前><代码>ls -l /tmp/easy_install* 总计 891 -rw-r--r-- 1 root root 901120 10 月 1 日 20:35 SQLAlchemy-0.7.2.tar.gz

df -h 输出:

已使用的文件系统大小 Avail Use% Mounted on
rootfs 9.7M 4.8M 4.5M 52% /
/dev/root 9.7M 4.8M 4.5M 52% /
/dev/loop0 23M 23M 0 100% /usr/local/modules
/dev/mtdblock5 5.0M 464K 4.6M 10% /usr/local/config
/dev/sda4 485M 16M 469M 4% /mnt/HD_a4
/dev/sdb4 485M 11M 474M 3% /mnt/HD_b4
/dev/sda2 1.8T 213G 1.6T 12% /mnt/HD/HD_a2
/dev/sdb2 1.8T 69G 1.8T 4% /mnt/HD/HD_b2
/dev/sda2 1.8T 213G 1.6T 12% /opt

谢谢,

杰克

I'm trying to install a python script packaged in egg format using easy_install. The problem is that easy_install downloads dependencies to /tmp. However, my tmp dir only has 4mb of free space (I am working with a NAS drive, set up this way).

Is there a way of specifying the download directory? --help doesn't seem to throw up anything useful.

Edit:

Some more details:

I'm running python 2.5.6 and setuputils 0.6c11-2 installed from optware. The NAS is ARM based (specifically the DNS-320 with fun_plug installed). Please let me know if you'd like any more specific info.

When I use the -b option, the file is still downloaded to /tmp. It is in fact the extraction process which which uses the remaining space in tmp:

easy_install-2.5 -b /mnt/HD/HD_a2/ffp/home/root SQLAlchemy==0.7.2
Searching for SQLAlchemy==0.7.2
Reading http://pypi.python.org/simple/SQLAlchemy/
Reading http://www.sqlalchemy.org
Best match: SQLAlchemy 0.7.2
Downloading http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.7.2.tar.gz#md5=b84a26ae2e5de6f518d7069b29bf8f72
Processing SQLAlchemy-0.7.2.tar.gz
error: No space left on device

I know the file is downloaded into /tmp by running ls -l /tmp/ while the download is happening:

ls -l /tmp/easy_install*
total 891 -rw-r--r-- 1 root root 901120 Oct  1 20:35 SQLAlchemy-0.7.2.tar.gz

df -h output:

Filesystem            Size  Used Avail Use% Mounted on
rootfs                9.7M  4.8M  4.5M  52% /
/dev/root             9.7M  4.8M  4.5M  52% /
/dev/loop0             23M   23M     0 100% /usr/local/modules
/dev/mtdblock5        5.0M  464K  4.6M  10% /usr/local/config
/dev/sda4             485M   16M  469M   4% /mnt/HD_a4
/dev/sdb4             485M   11M  474M   3% /mnt/HD_b4
/dev/sda2             1.8T  213G  1.6T  12% /mnt/HD/HD_a2
/dev/sdb2             1.8T   69G  1.8T   4% /mnt/HD/HD_b2
/dev/sda2             1.8T  213G  1.6T  12% /opt

Thanks,

Jack

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

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

发布评论

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

评论(4

第几種人 2024-12-14 16:56:48

设置 TMPDIR 环境变量如下:

export TMPDIR="/opt/tmp"

我认为这是比重写 easy_install.py 更好的方法。您需要确保该路径存在。

Set TMPDIR environment variable such as following:

export TMPDIR="/opt/tmp"

I think this is a better way than rewriting the easy_install.py. You need to ensure the path exists.

只是在用心讲痛 2024-12-14 16:56:48

如果有人感兴趣的话,这就是解决方案。

将 /opt/lib/python2.5/site-packages/setuptools/command/easy_install.py 的第 412 行从: 编辑

tmpdir = tempfile.mkdtemp(prefix="easy_install-")

到:

tmpdir = tempfile.mkdtemp(prefix="easy_install-",dir="/opt/tmp")

这有效,因为 /opt 已安装到 HDD 并且有足够的可用空间。

我不是 python 专家(从来没有用它编程过),但似乎 -b 选项与文件下载到的位置无关。

Well here's the solution if anyone's interested.

Edit line 412 of /opt/lib/python2.5/site-packages/setuptools/command/easy_install.py from:

tmpdir = tempfile.mkdtemp(prefix="easy_install-")

to:

tmpdir = tempfile.mkdtemp(prefix="easy_install-",dir="/opt/tmp")

This works, as /opt is mounted to the HDD and has plenty of free space.

I'm no python expert (never programmed with it), but it seems like the -b option has no bearing on where the file is downloaded to.

醉南桥 2024-12-14 16:56:48
easy_install -b wherever

或者

easy_install --build-directory wherever
easy_install -b wherever

or

easy_install --build-directory wherever
葬シ愛 2024-12-14 16:56:48

嗯,您可以在开始该过程之前将 /tmp/easyinstall 软符号链接到另一个位置吗?
我不是这个工具的专家,所以这是一个开始的想法,而不是一个解决方案

hmmmmm, you may soft symlink that /tmp/easyinstall to another location before starting the process?
I am not a pro in the tool so it's an idea to get going, not a solution

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