-
Notifications
You must be signed in to change notification settings - Fork 3.1k
"pip install ." fails on Python 3.3 (with symlinks in local directory) #1006
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
Comments
can you explain the details of your symlink case, or provide a repeatable case. thanks. |
Yeah, it is easy to reproduce. $ git clone https://github.com/myint/docformatter
$ cd docformatter
$ ln -s /tmp
$ pip install .
Unpacking /Users/myint/projects/docformatter
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Users/myint/Library/Python/3.3/lib/python/site-packages/pip/basecommand.py", line 134, in main
status = self.run(options, args)
File "/Users/myint/Library/Python/3.3/lib/python/site-packages/pip/commands/install.py", line 235, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/myint/Library/Python/3.3/lib/python/site-packages/pip/req.py", line 1084, in prepare_files
self.unpack_url(url, location, self.is_download)
File "/Users/myint/Library/Python/3.3/lib/python/site-packages/pip/req.py", line 1224, in unpack_url
return unpack_file_url(link, loc)
File "/Users/myint/Library/Python/3.3/lib/python/site-packages/pip/download.py", line 420, in unpack_file_url
shutil.copytree(source, location)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/shutil.py", line 343, in copytree
raise Error(errors)
shutil.Error: [('/Users/myint/projects/docformatter/tmp', '/var/folders/eD/eDkaCQuWHJG9f-G6kmkpgk+++TI/-Tmp-/pip-ayxv_5-build/tmp', "[Errno 21] Is a directory: '/Users/myint/projects/docformatter/tmp'")] Note that the error goes away if I set |
Any thoughts on my fix? |
to be clear, the failure is occuring when copying from src to the build location, not when installing. |
FWIW Python 3.3 changed the way |
Right, |
Also, correct, the symlink is not meant to be installed. The symlink is just some temporary file (as in the contents of |
Without this, "pip install" crashes when encountering symlinks that point to external paths. The culprit is "shutil.copytree()", which throws an error in such cases if the "symlinks" parameter is not set to "True". This fixes pypa#1006.
This seems to happen only if there are symlinks in the local directory. (In my case, the symlinks are from temporary build files.)
This seems to be due to
shutil.copytree()
, which fails if there are symlinks in the source.The text was updated successfully, but these errors were encountered: