Closed kwadsten closed 10 months ago
I managed to get this working by reinstalling virtualenvwrapper with Python 3.12.
Specifically, $VIRTUALENVWRAPPER_PYTHON --version
needed to be Python 3.12.
I was then able to use the various commands in fresh virtualenvs. (I still have a bit of digging and cleansing to do to my shell environment to make 100% of the error conditions: e.g. on one env I see a PY310 reference and a distutils deprecation warning, so I think there's still a wire crossed there.)
Other than hygiene though, I don't think it's a genuine issue per se.
Is that 1 line traceback the entire error stack?
@dhellmann Remarkably, yes 😅 (I think I've likely got a shell open with it still. I can paste it in full tomorrow.)
OK, I think that makes sense given that the command being run is
"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python" -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())
And without distutils that's not going to work.
We need a new way to get the location of the standard library directory for the current Python interpreter. It looks like maybe
"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python" -c 'import sysconfig; print(sysconfig.get_path("platstdlib"))'
or
"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python" -c 'import site; print(site.getsitepackages()[0])'
would do it, but I'll need to do a bit of research to see which is preferred. Do you want to give those a try on your system and see if either fixes the problem?
Ah, I was looking at the code on main
. Is this resolved by 05ccf752512c74d212f746017f240c692f848983 then?
That stack...
% lssitepackages
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'distutils'
ls: : No such file or directory
Oh, it is, yes. It looks like I should do a release.
I just published 6.0.0.0a5, which should include the fix for this.
Thanks!
Python 3.12 - Of note, the distutils package has been removed from the standard library.
This causes lssitepackages to fail.
Traceback (most recent call last): File "", line 1, in
ModuleNotFoundError: No module named 'distutils'
ls: : No such file or directory