metaodi / osmapi

Python wrapper for the OpenStreetMap API
http://osmapi.metaodi.ch/
GNU General Public License v3.0
212 stars 41 forks source link

Error installing on clean virtualenv #67

Closed Xevib closed 7 years ago

Xevib commented 7 years ago

When I install osmapi on a clean virtualenv with python 2.7.11 I get this: Collecting osmapi Downloading osmapi-0.7.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-_d5sLy/osmapi/setup.py", line 6, in version = import('osmapi').version File "osmapi/init.py", line 5, in from .OsmApi import * # noqa File "osmapi/OsmApi.py", line 35, in import requests ImportError: No module named requests

metaodi commented 7 years ago

Do you use 'pip install osmapi' to install it? requests is a dependency that pip should resolve, it's defined in our requirements.txt file.

Xevib commented 7 years ago

Yes, I used pip install osmapi

metaodi commented 7 years ago

I could perfectly reproduce your issue. I just read https://caremad.io/posts/2013/07/setup-vs-requirement/ and it seems the correct way of defining a dependency in a library is to add it as install_requires in setup.py. So hopefully my PR fixes this issue.

metaodi commented 7 years ago

@Xevib I could finally fix the installation problem and osmapi 0.8.1 can be installed in a clean virtualenv without a problem. I added a test to my build script to make sure these kind of problems are detected earlier next time. Thanks you very much for reporting this issue.