Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change path to site-packages dir in easy_install

I'm trying to use easy_install on windows7x64 and getting this:

<output>
c:\Python27\Scripts>easy_install.exe django-piston
error: can't create or remove files in install directory

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).

Where can I change easy_install's path to correct one "C:\Python27\Lib\site-packages"?

like image 582
Stqs Avatar asked Mar 26 '12 14:03

Stqs


People also ask

How do I change the path of a Python site package?

The easiest way to change it is to add a file /usr/local/lib/python2. 6/dist-packages/site-packages. pth containing ../site-packages . Alternatively, maybe you can teach the package to use site.

Where are my pip packages installed?

Python packages installed using the pip command are stored under the /usr/local/lib/<version>/dist-packages/pip/ directory.

Where is Python package folder?

When a package is installed globally, it's made available to all users that log into the system. Typically, that means Python and all packages will get installed to a directory under /usr/local/bin/ for a Unix-based system, or \Program Files\ for Windows.

Is easy_install deprecated?

easy_install, now deprecated, was released in 2004 as part of setuptools. It was notable at the time for installing packages from PyPI using requirement specifiers, and automatically installing dependencies.


1 Answers

easy_install should install the packages in the Python installation's site-packages directory. It could have happened that you changed Python's directory accidentally. Reinstalling easy_install should fix this.

Otherwise you could use:easy_install --install-dir C:\Python27\Lib\site-packages\Lib\site-packages\ django-piston

However, this last option has two issues:

  1. Make sure C:\Python27\Lib\site-packages\Lib\site-packages\ is in PYTHONPATH
  2. You will need to indicate a install-dir directory for every new package you install
like image 63
elachell Avatar answered Sep 23 '22 14:09

elachell