Running the command python3 -c 'import distutils; print(distutils.sysconfig.get_python_lib())' (as the sitepackages_dir function in pew.py does) gives an error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'setuptools._distutils' has no attribute 'sysconfig'
But sitepackages_dir does not check for errors, so it just uses the string returned on stdout, which is "", and therefore puts the _virtualenv_path_extensions.pth file in the current directory.
Changing the command to python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())' seems like an easy fix. But it would probably also make sense to check if the python command succeeded or not and print out any errors, in case anything else goes wrong.
I think this is something to do with debian patches for python (see https://stackoverflow.com/questions/28011865/why-cant-my-virtualenv-find-distutils-sysconfig)
Running the command
python3 -c 'import distutils; print(distutils.sysconfig.get_python_lib())'
(as thesitepackages_dir
function inpew.py
does) gives an error:But
sitepackages_dir
does not check for errors, so it just uses the string returned on stdout, which is "", and therefore puts the_virtualenv_path_extensions.pth
file in the current directory.Changing the command to
python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())'
seems like an easy fix. But it would probably also make sense to check if the python command succeeded or not and print out any errors, in case anything else goes wrong.