Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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;

like image 887
rlayte Avatar asked Oct 10 '11 22:10

rlayte


People also ask

What is setup py Sdist?

In the simplest case, python setup. py sdist. (assuming you haven't specified any sdist options in the setup script or config file), sdist creates the archive of the default format for the current platform. The default format is a gzip'ed tar file ( .

What does Setup py clean do?

As far as I know, it just removes the the build subdirectory, where Python puts all the files to be installed, including extensions that need to be compiled.

What is a manifest file Python?

A MANIFEST.in file consists of commands, one per line, instructing setuptools to add or remove some set of files from the sdist.


1 Answers

Same issue. I am using vagrant, my host OS is Windows while the Gust OS is Ubuntu. I am not a vim fan, so @simo's answer does not help me much because I really rely on virtual box shared folders to sync changes made by sublime editor to the Ubuntu virtual machine.

Thanks to Fabian Kochem, he found a quick and dirty workaround: post

# if you are not using vagrant, just delete os.link directly,
# The hard link only saves a little disk space, so you should not care
if os.environ.get('USER','') == 'vagrant':
    del os.link
like image 69
Leonardo.Z Avatar answered Sep 20 '22 05:09

Leonardo.Z