New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App data seeder breaks with long paths on Windows #1769
Comments
Does it still happen if you pass in |
Thx for the hint. i still get a new error: C:\Users\runge>mkvirtualenv api --clear-app-data
Exception in thread Thread-6:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\threading.py", line 932,
in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\threading.py", line 870,
in run
self._target(*self._args, **self._kwargs)
File "C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\
site-packages\virtualenv\seed\via_app_data\via_app_data.py", line 50, in _install
installer.build_image()
File "C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\
site-packages\virtualenv\seed\via_app_data\pip_install\base.py", line 59, in build_image
zip_ref.extractall(str(self._image_dir))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\zipfile.py", line 1647, i
n extractall
self._extract_member(zipinfo, path, pwd)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\zipfile.py", line 1701, i
n _extract_member
open(targetpath, "wb") as target:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\runge\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Pytho
n.3.8_qbz5n2kfra8p0\\LocalCache\\Local\\pypa\\virtualenv\\seed-app-data\\v1.0.1\\3.8\\image\\CopyPipInstall\\pip-20.0.2-py2.py3-non
e-any\\pip\\_vendor\\urllib3\\packages\\ssl_match_hostname\\_implementation.py'
created virtual environment CPython3.8.2.final.0-64 in 2184ms
creator Venv(dest=C:\virtenv\api, clear=False, global=False, describe=CPython3Windows)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\virtualenv\seed-app-data\v1.0.1)
activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator _implementation.py is missing in the directory. |
Can you detail what |
The code of the mkvirtualen.bat can you see here It is just a small wrapper for easier use. Output by directly using of virtuelenv: C:\Users\runge>virtualenv api -vvv --clear-app-data
64 setup logging to NOTSET [DEBUG report:43]
73 clean app data folder C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\p
ypa\virtualenv [DEBUG app_data:21]
168 find interpreter for spec PythonSpec(path=C:\Users\runge\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.
8_qbz5n2kfra8p0\python.exe) [INFO builtin:44]
170 proposed PythonInfo(spec=CPython3.8.2.final.0-64, exe=C:\Users\runge\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundati
on.Python.3.8_qbz5n2kfra8p0\python.exe, platform=win32, version='3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64
bit (AMD64)]', encoding_fs_io=utf-8-utf-8) [INFO builtin:50]
170 accepted PythonInfo(spec=CPython3.8.2.final.0-64, exe=C:\Users\runge\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundati
on.Python.3.8_qbz5n2kfra8p0\python.exe, platform=win32, version='3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64
bit (AMD64)]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:52]
175 symlink on filesystem does work [DEBUG info:47]
175 filesystem is not case-sensitive [DEBUG info:28]
260 create virtual environment via Venv(dest=C:\Users\runge\api, clear=False, global=False, describe=CPython3Windows) [INFO session
:52]
291 create virtualenv import hook file C:\Users\runge\api\Lib\site-packages\_virtualenv.pth [DEBUG api:78]
297 create C:\Users\runge\api\Lib\site-packages\_virtualenv.py [DEBUG api:81]
300 ============================== target debug ============================== [DEBUG session:54]
300 debug via 'C:\Users\runge\api\Scripts\python.exe' 'C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qb
z5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\virtualenv\create\debug.py' [DEBUG creator:187]
300 {
"sys": {
"executable": "C:\\Users\\runge\\api\\Scripts\\python.exe",
"_base_executable": "C:\\Users\\runge\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p
0\\python.exe",
"prefix": "C:\\Users\\runge\\api",
"base_prefix": "C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0",
"real_prefix": null,
"exec_prefix": "C:\\Users\\runge\\api",
"base_exec_prefix": "C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0",
"path": [
"C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\\python38.zip",
"C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\\DLLs",
"C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\\lib",
"C:\\Users\\runge\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0",
"C:\\Users\\runge\\api",
"C:\\Users\\runge\\api\\lib\\site-packages"
],
"meta_path": [
"<class '_virtualenv._Finder'>",
"<class '_frozen_importlib.BuiltinImporter'>",
"<class '_frozen_importlib.FrozenImporter'>",
"<class '_frozen_importlib_external.PathFinder'>"
],
"fs_encoding": "utf-8",
"io_encoding": "cp1252"
},
"version": "3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]",
"os": "<module 'os' from 'C:\\\\Program Files\\\\WindowsApps\\\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\
\\\lib\\\\os.py'>",
"site": "<module 'site' from 'C:\\\\Program Files\\\\WindowsApps\\\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra
8p0\\\\lib\\\\site.py'>",
"datetime": "<module 'datetime' from 'C:\\\\Program Files\\\\WindowsApps\\\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qb
z5n2kfra8p0\\\\lib\\\\datetime.py'>",
"math": "<module 'math' (built-in)>",
"json": "<module 'json' from 'C:\\\\Program Files\\\\WindowsApps\\\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra
8p0\\\\lib\\\\json\\\\__init__.py'>"
} [DEBUG session:55]
444 add seed packages via FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=C:\Users\
runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\virtualenv\seed-app-data\v1.0.
1) [INFO session:59]
446 Attempting to acquire lock 1977832226976 on C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfr
a8p0\LocalCache\Local\pypa\virtualenv\seed-app-data\v1.0.1\3.8\wheels.lock [DEBUG filelock:270]
448 Lock 1977832226976 acquired on C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCac
he\Local\pypa\virtualenv\seed-app-data\v1.0.1\3.8\wheels.lock [INFO filelock:274]
449 get bundled wheel C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-pack
ages\Python38\site-packages\virtualenv\seed\embed\wheels\pip-20.0.2-py2.py3-none-any.whl [DEBUG acquire:51]
449 get bundled wheel C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-pack
ages\Python38\site-packages\virtualenv\seed\embed\wheels\setuptools-46.1.3-py3-none-any.whl [DEBUG acquire:51]
449 get bundled wheel C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-pack
ages\Python38\site-packages\virtualenv\seed\embed\wheels\wheel-0.34.2-py2.py3-none-any.whl [DEBUG acquire:51]
459 install wheel from wheel C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Loc
al\pypa\virtualenv\seed-app-data\v1.0.1\3.8\wheels\wheel-0.34.2-py2.py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:46]
459 install setuptools from wheel C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCach
e\Local\pypa\virtualenv\seed-app-data\v1.0.1\3.8\wheels\setuptools-46.1.3-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:4
6]
459 build install image to C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local
\pypa\virtualenv\seed-app-data\v1.0.1\3.8\image\CopyPipInstall\wheel-0.34.2-py2.py3-none-any of wheel-0.34.2-py2.py3-none-any.whl [
DEBUG base:57]
461 install pip from wheel C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local
\pypa\virtualenv\seed-app-data\v1.0.1\3.8\wheels\pip-20.0.2-py2.py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:46]
461 build install image to C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local
\pypa\virtualenv\seed-app-data\v1.0.1\3.8\image\CopyPipInstall\setuptools-46.1.3-py3-none-any of setuptools-46.1.3-py3-none-any.whl
[DEBUG base:57]
461 build install image to C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local
\pypa\virtualenv\seed-app-data\v1.0.1\3.8\image\CopyPipInstall\pip-20.0.2-py2.py3-none-any of pip-20.0.2-py2.py3-none-any.whl [DEBU
G base:57]
656 copy directory C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\vi
rtualenv\seed-app-data\v1.0.1\3.8\image\CopyPipInstall\wheel-0.34.2-py2.py3-none-any\wheel to C:\Users\runge\api\Lib\site-packages\
wheel [DEBUG _sync:48]
721 copy directory C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\vi
rtualenv\seed-app-data\v1.0.1\3.8\image\CopyPipInstall\wheel-0.34.2-py2.py3-none-any\wheel-0.34.2.dist-info to C:\Users\runge\api\L
ib\site-packages\wheel-0.34.2.dist-info [DEBUG _sync:48]
737 copy C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\virtualenv\s
eed-app-data\v1.0.1\3.8\image\CopyPipInstall\wheel-0.34.2-py2.py3-none-any\wheel-0.34.2.virtualenv to C:\Users\runge\api\Lib\site-p
ackages\wheel-0.34.2.virtualenv [DEBUG _sync:48]
829 generated console scripts wheel.exe wheel3.exe wheel-3.8.exe [DEBUG base:53]
1160 copy C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\virtualenv\
seed-app-data\v1.0.1\3.8\image\CopyPipInstall\setuptools-46.1.3-py3-none-any\easy_install.py to C:\Users\runge\api\Lib\site-package
s\easy_install.py [DEBUG _sync:48]
1168 copy directory C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\v
irtualenv\seed-app-data\v1.0.1\3.8\image\CopyPipInstall\setuptools-46.1.3-py3-none-any\pkg_resources to C:\Users\runge\api\Lib\site
-packages\pkg_resources [DEBUG _sync:48]
1250 copy directory C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\v
irtualenv\seed-app-data\v1.0.1\3.8\image\CopyPipInstall\setuptools-46.1.3-py3-none-any\setuptools to C:\Users\runge\api\Lib\site-pa
ckages\setuptools [DEBUG _sync:48]
1645 copy directory C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\v
irtualenv\seed-app-data\v1.0.1\3.8\image\CopyPipInstall\setuptools-46.1.3-py3-none-any\setuptools-46.1.3.dist-info to C:\Users\rung
e\api\Lib\site-packages\setuptools-46.1.3.dist-info [DEBUG _sync:48]
1669 copy C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\virtualenv\
seed-app-data\v1.0.1\3.8\image\CopyPipInstall\setuptools-46.1.3-py3-none-any\setuptools-46.1.3.virtualenv to C:\Users\runge\api\Lib
\site-packages\setuptools-46.1.3.virtualenv [DEBUG _sync:48]
1753 generated console scripts easy_install3.exe easy_install-3.8.exe easy_install.exe [DEBUG base:53]
Exception in thread Thread-8:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\threading.py", line 932,
in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\threading.py", line 870,
in run
self._target(*self._args, **self._kwargs)
File "C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\
site-packages\virtualenv\seed\via_app_data\via_app_data.py", line 50, in _install
installer.build_image()
File "C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\
site-packages\virtualenv\seed\via_app_data\pip_install\base.py", line 59, in build_image
zip_ref.extractall(str(self._image_dir))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\zipfile.py", line 1647, i
n extractall
self._extract_member(zipinfo, path, pwd)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\zipfile.py", line 1701, i
n _extract_member
open(targetpath, "wb") as target:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\runge\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Pytho
n.3.8_qbz5n2kfra8p0\\LocalCache\\Local\\pypa\\virtualenv\\seed-app-data\\v1.0.1\\3.8\\image\\CopyPipInstall\\pip-20.0.2-py2.py3-non
e-any\\pip\\_vendor\\urllib3\\packages\\ssl_match_hostname\\_implementation.py'
2349 Attempting to release lock 1977832226976 on C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kf
ra8p0\LocalCache\Local\pypa\virtualenv\seed-app-data\v1.0.1\3.8\wheels.lock [DEBUG filelock:315]
2350 Lock 1977832226976 released on C:\Users\runge\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCa
che\Local\pypa\virtualenv\seed-app-data\v1.0.1\3.8\wheels.lock [INFO filelock:318]
2350 add activators for Bash, Batch, Fish, PowerShell, Python, Xonsh [INFO session:64]
2375 write C:\Users\runge\api\pyvenv.cfg [DEBUG pyenv_cfg:34]
2388 home = C:\Users\runge\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0 [DEBUG pyenv_cf
g:38]
2405 implementation = CPython [DEBUG pyenv_cfg:38]
2405 version_info = 3.8.2.final.0 [DEBUG pyenv_cfg:38]
2407 virtualenv = 20.0.17 [DEBUG pyenv_cfg:38]
2407 include-system-site-packages = false [DEBUG pyenv_cfg:38]
2408 version = 3.8.2 [DEBUG pyenv_cfg:38]
2410 created virtual environment CPython3.8.2.final.0-64 in 2348ms
creator Venv(dest=C:\Users\runge\api, clear=False, global=False, describe=CPython3Windows)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=C:\Users\runge\AppData\Loc
al\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypa\virtualenv\seed-app-data\v1.0.1)
activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator [WARNING __main__:21] I still get the same error because of the missing _implementation.py |
Seems this is a case of the path becoming too large for Windows https://bugs.python.org/issue10447 The path it tries to write is: |
Is there a solution to this? |
Either change app data folder via the flag or use the pip seeder in the meantime 👍 |
see https://virtualenv.pypa.io/en/latest/cli_interface.html#app-data that allows changing the temp path 👍 |
Thx a lot. It works now by changing the app data folder 👍 |
By the way, you can also enable long paths per https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/ |
A yeahh.. you are right. That option was enabled in me previously OS setup. Thx for the hint. |
I think a warning if long paths are disabled is useful |
I'm not aware of a cheap way of checking that (or even an expensive way) 🤔 Do you know of any? |
If a error occures, count the length of the last path and if the length is higher than 260 characters, show a warning to check the longpath setting. Think this is the fastest and simplest solution. |
This can happen in at least 3 more places. How do you differentiate between path actually not existing and path too long though, and then what about path is too long and also does not exist? |
Okay thats really difficult🤔 Create random cascade tmp path higher 260 , if a raise condition occures, path limit is set |
I'll close this for now as will not fix, and insteaad encourage people to use the above workaround. If more people run into this we can address it, but considering the ammount of people that reported this/ran into this I consider it not worth the effort just yet. |
Hi,
when I create a new virtualenv, I always get this error: RuntimeError: no dist info
After the creation process the folder with all files exists. The only thing missing is the pip dist-info folder in site-packages and the pip files in the Scripts Folder. For the creation process i use the virtualenvwrapper-win package with the command mkvirtualenv.
I had never be problems with that. I never use some extra options or settings.
Even with active virtual environment it uses the global pip installer.
I just reinstalled the OS today. Before I had no problems.
I have also worked with exactly the same versions of pip, python and virtualenv before.
Tested with pip 19.2.3 and pip 20.0.2
Environment
Provide at least:
pip list
of the host python wherevirtualenv
is installed:Output of the virtual environment creation
Make sure to run the creation with
-vvv --with-traceback
:The text was updated successfully, but these errors were encountered: