Search code examples
pythonunixubuntuvirtualboxdistutils

python setup.py sdist error: Operation not permitted


I'm trying to create a python source package, but it fails when creating hard links for files.

$ python setup.py sdist

running sdist
running check
reading manifest template 'MANIFEST.in'
writing manifest file 'MANIFEST'
making hard links in foo-0.1...
hard linking README.txt -> foo-0.1
error: Operation not permitted

I've tried running the command with sudo, but it produces the same error.

This also produces the same error:

ln foo bar

I'm using vbox to run a virtual instance of ubuntu, which is probably where the problem comes from. Is there a way round using hard links when creating source distributions?

System information:

Ubuntu server 11.04; VirtualBox 4.14; osx 10.6.6; python 2.7.1;


Solution

  • It is unclear from your question what step is failing. Might be the hard linking right before the error. You can try strace to see what system call is failing. That should give a better picture of the problem at least.

    This python bug report looks like they're not going to fix this until distutils2. Someone did supply a patch that might be useful to you. You might also be able to mount a directory over NFS and build there. I believe that NFS allows hard linking.