Hi, I am developing a small pet project that I call pyspread (A small spreadsheet that accepts Python in cells, further info at: http://pyspread.sf.net). Now some users complained that it does not install correctly with easy_install even though distutils work. I tried for some time fixing it, but I was not too successful. The main problem is that the .pth file and the subdirectory are not created on installation, which works all right with python setup.py install. First, I thought that my easy_install installation is broken (I am using Debian testing with the version in the apt repository). However, after I read a few posts in this list, I believe that I stumbled into some gotchas that are definitively not in the main download page manual. Any idea how I could get the directories set up with easy install? Is this in a FAQ that I am unaware of? My setup.py code is posted below. You can find the bug report at http://sourceforge.net/tracker/index.php?func=detail&aid=2036736&group_id=224598&atid=1062244 Thanks in advance Regards Martin --- setup.py --- #!/usr/bin/env python from distutils.core import setup from distutils.sysconfig import get_python_lib setup(name='pyspread', version='0.0.10a', description='A spreadsheet that accepts a pure python expression in each cell.', license='GPL v3 :: GNU General Public License', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: End Users/Desktop', ], author='Martin Manns', author_email='mmanns@gmx.net', url='http://sourceforge.net/projects/pyspread/', requires=['numpy (>=1.1)', 'wx (>=2.7)'], scripts=['pyspread/pyspread.py'], packages=['pyspread'], package_dir={'pyspread': 'pyspread'}, package_data={'pyspread': ['icons/*.png', 'icons/actions/*.png', \ 'examples/*', \ 'doc/manual.html', 'README', 'COPYING']}, ) import distutils.sysconfig try: pthfile = open(get_python_lib() + "/pyspread.pth", 'w') pthfile.write("pyspread") pthfile.close() except IOError: print 'Creation of ' + distutils.sysconfig.get_python_lib() + ' pyspread.pth failed.'
At 10:03 PM 11/30/2008 +0000, Martin Manns wrote:
Hi,
I am developing a small pet project that I call pyspread (A small spreadsheet that accepts Python in cells, further info at: http://pyspread.sf.net).
Now some users complained that it does not install correctly with easy_install even though distutils work. I tried for some time fixing it, but I was not too successful.
The main problem is that the .pth file and the subdirectory are not created on installation, which works all right with python setup.py install.
From reading your setup script, I don't understand why your package needs a .pth file of its own, let alone why it's writing it directly in the setup script. I would expect it to work correctly if you simply delete that portion of the setup script. In fact, it works for me that way. One other thing you need to change if you want easy_install to handle dependencies:
requires=['numpy (>=1.1)', 'wx (>=2.7)'],
Either change this line (or add another) saying: install_requires=["numpy>=1.1", "wx>=2.7"], Also note that this line is superfluous (neither distutils nor setuptools need it):
package_dir={'pyspread': 'pyspread'},
And of course, delete the entire block below; as far as I can tell, it's not needed for distutils or setuptools.
import distutils.sysconfig try: pthfile = open(get_python_lib() + "/pyspread.pth", 'w') pthfile.write("pyspread") pthfile.close() except IOError: print 'Creation of ' + distutils.sysconfig.get_python_lib() + ' pyspread.pth failed.'
participants (2)
-
Martin Manns
-
Phillip J. Eby