gpt4 book ai didi

python - easy_install 下载目录

转载 作者:太空宇宙 更新时间:2023-11-03 12:12:31 26 4
gpt4 key购买 nike

我正在尝试使用 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
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

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

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 输出:

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

谢谢,

jack

最佳答案

设置 TMPDIR 环境变量如下:

export TMPDIR="/opt/tmp"

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

关于python - easy_install 下载目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7621103/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com