[Distutils] Installing a file into sitepackages

Stuart Axon stuaxo2 at yahoo.com
Sun Mar 8 16:05:04 CET 2015


Hm - I was able to reproduce it just now, I tried it with and without a recent site packages.

Since my project is an import hook I want it to be imported on startup, maybe I should do this in a different way ...

 
S++



> On Saturday, March 7, 2015 1:51 AM, Erik Bray <erik.m.bray at gmail.com> wrote:
> > On Fri, Feb 20, 2015 at 1:49 PM, Stuart Axon
> 
> <stuaxo2 at yahoo.com.dmarc.invalid> wrote:
>>  Hi,
>>     In my project, I install a .pth file into site-packages, I use the 
> data_files...  in Ubuntu this seems to work OK, but in a Windows VM the file 
> doesn't seem to be being installed:
>> 
>>  setup(
>>     ....
>>     # Install the import hook
>>      data_files=[
>>          (site_packages_path, ["vext_importer.pth"] if 
> environ.get('VIRTUAL_ENV') else []),
>>      ],
>>  )
>> 
>> 
>>  - Is there a better way to do this ?
>> 
>> 
>> 
>>  I realise it's a bit odd installing a .pth - my project is to allow 
> certain packages to use the system site packages from a virtualenv -
>>  https://github.com/stuaxo/vext
> 
> Hi Stuart,
> 
> I know this is old so sorry to anyone else.  But since no one
> replied--I haven't looked too closely at what it is you're trying to
> accomplish.  But whatever the reason, that seems like a
> reasonable-enough way to me if you need to get a .pth file installed
> into site-packages.  I'm not sure why it isn't working for you in
> WIndows but it wasn't clear what the problem was.  I just tried this
> in a Windows VM and it worked fine?
> 
> Best,
> Erik
> 


More information about the Distutils-SIG mailing list