virtualenv tmpenv --system-site-packages -p python3 RuntimeError: failed to build image…
- User
virtualenv tmp_env --system-site-packages -p python3 RuntimeError: failed to build image setuptools because: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/virtualenv/seed/embed/via_app_data/via_app_data.py", line 55, in _install installer.install(creator.interpreter.version_info) File "/usr/lib/python3/dist-packages/virtualenv/seed/embed/via_app_data/pip_install/base.py", line 31, in install self._uninstall_previous_version() File "/usr/lib/python3/dist-packages/virtualenv/seed/embed/via_app_data/pip_install/base.py", line 142, in _uninstall_previous_version dist_name = self._dist_info.stem.split("-")[0] ^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/virtualenv/seed/embed/via_app_data/pip_install/base.py", line 107, in _dist_info raise RuntimeError(f"no .dist-info at {self._image_dir}, has {', '.join(files)}") # pragma: no cover ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: no .dist-info at /cs/usr/shachar.don/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/setuptools-66.1.1-py3-none-any, has _distutils_hack
- Assistant
The error you're encountering: yamlCopyEditRuntimeError: no .dist-info at ..., has _distutils_hack
suggests that virtualenv is trying to seed the new environment with setuptools, but it’s failing because the expected .dist-info directory for setuptools is missing or malformed. This is usually caused by a corrupted or incomplete wheel cache in your local virtualenv app data directory. Here are a few things you can try to fix it:
✅ 1. Clear the virtualenv wheel cache The cache seems to be corrupted. You can manually remove it: bashCopyEditrm -rf ~/.local/share/virtualenv
Then try again: bashCopyEditvirtualenv tmp_env --system-site-packages -p python3
✅ 2. Upgrade virtualenv An older or buggy version of virtualenv might be the culprit. Upgrade to the latest version: bashCopyEditpip install --upgrade virtualenv
Then try creating the environment again.
✅ 3. Try with --no-seed and install packages manually If you're okay skipping auto-installation of pip, setuptools, and wheel, you can avoid this error by using --no-seed: bashCopyEditvirtualenv tmp_env --no-seed -p python3 source tmp_env/bin/activate pip install pip setuptools wheel
Let me know if you'd like help with cleaning up or inspecting the contents of the cache folder more directly!