如何在easy_install中更改site-packages目录的路径

时间:2012-03-26 14:49:49

标签: python windows-7-x64 easy-install

我正在尝试在windows7x64上使用easy_install并获取此信息:     c:\ Python27 \ Scripts> easy_install.exe django-piston     错误:无法在安装目录中创建或删除文件

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 2] No such file or directory: 'C:\\Python27\\Lib\\site-packages\\Lib\
\site-packages\\test-easy-install-4132.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    C:\Python27\Lib\site-packages\Lib\site-packages\

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).

在哪里可以更改easy_install的路径以更正“C:\ Python27 \ Lib \ site-packages”

谢谢。

1 个答案:

答案 0 :(得分:9)

easy_install应该在Python安装的site-packages目录中安装软件包。碰巧你不小心改变了Python的目录。 重新安装easy_install应该解决这个问题。

否则您可以使用:easy_install --install-dir C:\Python27\Lib\site-packages\Lib\site-packages\ django-piston

但是,最后一个选项有两个问题:

  1. 确保C:\Python27\Lib\site-packages\Lib\site-packages\处于PYTHONPATH
  2. 您需要为每个安装的新软件包指明一个install-dir目录