[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name DataFetcher in v2.1.0, wrong tilequeue version in requirements #115

Closed
radumas opened this issue Sep 13, 2017 · 10 comments
Assignees

Comments

@radumas
Copy link
radumas commented Sep 13, 2017

I have tileserver v2.1.0 checked out and correspondingly tilequeue v1.8.0 and vector-datasource v1.4.0 checked out. I created a new python virtualenv, installed the requirements from tileserver, and then went to tilequeue v1.8.0 and vector-datasource v1.4.0 and ran python setup.py develop (btw, should I not be passing a develop argument if using numbered releases?).

When I run python tileserver/__init__.py config.yaml I get

Traceback (most recent call last):
  File "tileserver/__init__.py", line 11, in <module>
    from tilequeue.query import DataFetcher
ImportError: cannot import name DataFetcher

Solution

I noticed the very bottom of the tileserver requirements.txt file has git+https://github.com/mapzen/tilequeue@master#egg=tilequeue. So I tried pip uninstall tilequeue and got

 pip uninstall tilequeue
Uninstalling tilequeue-1.9.0:
etc....

and then

cd ../tilequeue/
python setup.py develop
cd ../tileserver/
python tileserver/__init__.py config.yaml

Did not produce that error.

@radumas
Copy link
Author
radumas commented Sep 13, 2017

This would also be an issue if someone followed the current version of the vector-datasource install guide using the checkout versions listed there.

@rmarianski
Copy link
Member

Yea, good point, those do have master set for those releases. Those instructions are usually tested just with master, and I take the steps you describe above when switching versions. We should probably at a minimum update the documentation to call this out, and ensure that going forward releases have specific versions set in their requirements files.

Instead of having requirements files in each repo though, I think we should have a single set of requirements just in vector-datasource that assumes installation of everything for setup purposes, since that's the useful part practically anyway. We could either split apart just the upstream dependencies from the versions of the tilezen repos, and make separate explicit pip install steps for the install or tilezen repos which might make this more visible. That would also mean that we wouldn't have the problem of having to update the requirements files when we release. Or we just add a step to the instructions that says to edit the bottom of the requirements file for the particular versions desired.

What does everyone think?

@radumas
Copy link
Author
radumas commented Sep 19, 2017

So tilequeue seems to behave happily as a dependency of vector-datasource since AFAIK it doesn't require configuration. Would it be possible to configure vector-datasource's setup (or a version of it) to add tileserver as a git submodule, so that the tileserver config is easily accessible to configure (or otherwise put the tileserver/__init__.py and config.yaml in an accessible location).

Then the instructions to get a "standard install" would be to clone vector-datasource, checkout the latest release, and then run setup.

@gabefair
Copy link

Thanks @radumas for posting this fix. I was stuck after following the install guide.

@zerebubuth
Copy link
Member

Instead of having requirements files in each repo though, I think we should have a single set of requirements just in vector-datasource that assumes installation of everything for setup purposes, since that's the useful part practically anyway.

I think that would be useful for people who want the easiest route to setting everything up.

We're releasing a bunch of packages to PyPI now. Would it make sense to use those for released versions, so that we didn't need git versions in requirements.txt? In other words, that we'd specify version constraints in setup.py to avoid things like tileserver referencing DataFetcher without having pulled in a sufficiently new version of tilequeue?

@rmarianski
Copy link
Member

I think that would be useful for people who want the easiest route to setting everything up.

Which is where we have the problems anyway right? :)

We're releasing a bunch of packages to PyPI now. Would it make sense to use those for released versions, so that we didn't need git versions in requirements.txt?

We deploy off branches too, so we would need a workflow for that anyway.

@radumas
Copy link
Author
radumas commented Oct 19, 2017

I think PyPi makes even more sense for a simple, stable deployment.

We deploy off branches too, so we would need a workflow for that anyway.

You all can figure out what you need for your development 😉

@pnorman
Copy link
Contributor
pnorman commented Oct 22, 2017

I think PyPi makes even more sense for a simple, stable deployment.

Yes, I think this is the best way. I thought it was possible now to pip install tileserver?

@nvkelso
Copy link
Member
nvkelso commented Oct 23, 2017

@pnorman Filed related issues this weekend that we're working on. Thanks everyone for the feedback!

@nvkelso
Copy link
Member
nvkelso commented Mar 12, 2018

Closing for inactivity.

@nvkelso nvkelso closed this as completed Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants