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

No metapack executable after a fresh installation #4

Open
roll opened this issue Oct 13, 2017 · 12 comments
Open

No metapack executable after a fresh installation #4

roll opened this issue Oct 13, 2017 · 12 comments

Comments

@roll
Copy link
Contributor

roll commented Oct 13, 2017

$ pip install metapack
$ metapack
metapack: not found
@ericbusboom
Copy link
Collaborator

Ah, sorry, documentation error. The program name has been changed to mt with metapack being the subcommand mt pack.

@ericbusboom
Copy link
Collaborator

I updates the README, but the older documentation still needs to be changed.

@roll
Copy link
Contributor Author

roll commented Oct 13, 2017

@ericbusboom
I've tried td but got this on a fresh virtualenv for Python 3.5.:

$ pip install metapack
$ mt
Traceback (most recent call last):
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 664, in _build_master
    ws.require(__requires__)
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 981, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 872, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (six 1.11.0 (/home/roll/projects/sandbox/.python/lib/python3.5/site-packages), Requirement.parse('six~=1.10.0'), {'rowpipe'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/roll/projects/sandbox/.python/bin/mt", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3142, in <module>
    @_call_aside
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3126, in _call_aside
    f(*args, **kwargs)
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3155, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 666, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 679, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/roll/projects/sandbox/.python/lib/python3.5/site-packages/pkg_resources/__init__.py", line 872, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (six 1.11.0 (/home/roll/projects/sandbox/.python/lib/python3.5/site-packages), Requirement.parse('six~=1.10.0'), {'rowpipe'})

Not sure what's package have such a strong dependency version lock.

PS.
To do not create new issue on the http://metatab.org/:

  • link to metatab spec is not working (blue button)
  • link to data data package spec is not working (blue button)

@ericbusboom
Copy link
Collaborator

The package is fs, which has the dependency for six specified as:

"six~=1.10",

So, you have to manually re-install six:

$ pip uninstall -y six
$ pip install six==1.10.0

There a note about it buried in the README, but I'd really like to find a real fix. I'm almost ready to fork fs. Oddly, this wasn't an issue until I started using the entry points from pkg_resources, which is where the dependency is being checked. Maybe it's actually a bug in pkg_resources?

@roll
Copy link
Contributor Author

roll commented Oct 13, 2017

@ericbusboom
I've proposed a PR to fs. It's probably just a bug because python libraries just can't use dependencies like this (if I correctly understand an used notation).

@roll
Copy link
Contributor Author

roll commented Oct 13, 2017

I've downgraded the six version but I suppose I'm doing something wrong:

$ mt pack -c
CRITICAL: Failed to instantiate generator for class '<class 'rowgenerators.generator.csv.CsvSource'>', ref 'file:/home/roll/projects/sandbox/package/metadata.csv'

@ericbusboom
Copy link
Collaborator

Hmm... looks familiar. Let me investigate. That's probably a failure in the entry points for generators.

@ericbusboom
Copy link
Collaborator

BTW, adding '--exceptions' to the command line arguments gives you the full exception trace. In this case, it reveals that the error is because the metadata.csv template didn't get included in the package ( in the source, metatab/templates ) , probably because I screwed up the setup.py file and didn't change the MANIFEST. I've got a branch that I'm working on now which should fix this.

@willmcgugan
Copy link

Hello. That PR to fs shouldn't really change anything. The six~=1.10 should be equivalent to six>=1.10,<2.0 as I understand it.

What was the issue you are seeing?

@ericbusboom
Copy link
Collaborator

@willmcgugan The issue occurs entirely outside of fs, when the metatab code is trying to resolve entry_points. It looks like the problem is that pkg_resources, when checking dependencies on entry_points, doesn't understand the '~=' notation and rejects the specification. But, we haven't dug into the problem enough to be sure.

@roll
Copy link
Contributor Author

roll commented Oct 13, 2017

@willmcgugan
My bad. I've missed that PyFilesystem/pyfilesystem2#79 has been resolved.

@willmcgugan
Copy link

Ah, you may need a more recent setuptools that supports ~=

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

3 participants