tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
987 stars 223 forks source link

entry_points in setup.py is not supported without setuptools #43

Closed tumluliu closed 9 years ago

tumluliu commented 9 years ago

Hi gpxpy team,

a warning will be thrown when installing the package with the setup.py in master branch:

UserWarning: Unknown distribution option: 'entry_points'

The gpxinfo executable script can not be generated or installed properly either.

After some searching work, I found that the installation process would be alright if I added the import of setuptools in setup.py:

from setuptools import setup

However, the generated gpxinfo still doesn't work. Its content is as follows.

#!/usr/local/opt/python/bin/python2.7
# EASY-INSTALL-ENTRY-SCRIPT: 'gpxpy==0.9.8','console_scripts','gpxinfo'
__requires__ = 'gpxpy==0.9.8'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('gpxpy==0.9.8', 'console_scripts', 'gpxinfo')()
    )

Error message is:

Traceback (most recent call last):
  File "/usr/local/bin/gpxinfo", line 9, in <module>
    load_entry_point('gpxpy==0.9.8', 'console_scripts', 'gpxinfo')()
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 519, in load_entry_point
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2630, in load_entry_point
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2310, in load
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2316, in resolve
ImportError: No module named gpxinfo

My environment is OS X 10.10.3 with python 2.7.9 installed via homebrew.

Would you please give me some hints? Thanks.

tkrajina commented 9 years ago

Hi @tumluliu,

I'd like to give you some hints, but I'm not 100% sure what is the right way to do this ;)

Anyway, I tried a few variations, and this one https://github.com/tkrajina/gpxpy/tree/gpxinfo-install-fix seems to work fine for me. Can you try it on your OSX?

tumluliu commented 9 years ago

this version works with no problem, @tkrajina . Thanks a lot! I actually modified setup.py the same way as you did to make the package installable on my machine. I think there should be a solution to let the 'entry_point' way work on osx as well.

tkrajina commented 9 years ago

Yes, there is probably a better solution but if somebody knows it -- I'm accepting pull requests. This solution is good enough at the moment.