Prendiamo il seguente layout del progetto:Python Distutils errore: "[directory] ... non esiste o non è un file regolare"
$ ls -R .
.:
package setup.py
./package:
__init__.py dir file.dat module.py
./package/dir:
tool1.dat tool2.dat
E il seguente contenuto per setup.py
:
$ cat setup.py
from distutils.core import setup
setup(name='pyproj',
version='0.1',
packages=[
'package',
],
package_data={
'package': [
'*',
'dir/*',
],
},
)
Come puoi vedere, voglio includere tutti i file non Python nelle directory package/
e package/dir/
. Tuttavia, l'esecuzione setup.py install
solleverebbe il seguente errore:
$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/package
copying package/module.py -> build/lib/package
copying package/__init__.py -> build/lib/package
error: can't copy 'package/dir': doesn't exist or not a regular file
Che cosa dà?
Una soluzione molto più semplice è dato in questa risposta: http://stackoverflow.com/a/25375689/74632 –