workalendar: Cannot import workalendar in ipython (DistributionNotFound)

It works when I use the normal python console, but not with ipython. I’ve tried with and without ipython installed in the virtualenv (it’s installed globally).

Steps to recreate:

> virtualenv ve
> . ve/bin/activate
> pip install workalendar
> ipython
In [1]: import workalendar
---------------------------------------------------------------------------
DistributionNotFound                      Traceback (most recent call last)
<ipython-input-1-375fa58b25cd> in <module>()
----> 1 import workalendar

/home/flyte/temp/workalendar/ve/lib/python2.7/site-packages/workalendar/__init__.py in <module>()
      4 
      5 #: Module version, as defined in PEP-0396.
----> 6 __version__ = pkg_resources.get_distribution(__package__).version

/usr/lib/python2.7/dist-packages/pkg_resources.pyc in get_distribution(dist)
    328     """Return a current distribution object for a Requirement or string"""
    329     if isinstance(dist,basestring): dist = Requirement.parse(dist)
--> 330     if isinstance(dist,Requirement): dist = get_provider(dist)
    331     if not isinstance(dist,Distribution):
    332         raise TypeError("Expected string, Requirement, or Distribution", dist)

/usr/lib/python2.7/dist-packages/pkg_resources.pyc in get_provider(moduleOrReq)
    207     """Return an IResourceProvider for the named module or requirement"""
    208     if isinstance(moduleOrReq,Requirement):
--> 209         return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
    210     try:
    211         module = sys.modules[moduleOrReq]

/usr/lib/python2.7/dist-packages/pkg_resources.pyc in require(self, *requirements)
    684         """
    685 
--> 686         needed = self.resolve(parse_requirements(requirements))
    687 
    688         for dist in needed:

/usr/lib/python2.7/dist-packages/pkg_resources.pyc in resolve(self, requirements, env, installer, replacement)
    582                         # unfortunately, zc.buildout uses a str(err)
    583                         # to get the name of the distribution here..
--> 584                         raise DistributionNotFound(req)
    585                 to_activate.append(dist)
    586             if dist not in req:

DistributionNotFound: workalendar

My pip freeze:

argparse==1.2.1
ipython==2.0.0
lunardate==0.1.4
pyCalverter==1.6.1
pyephem==3.7.5.2
python-dateutil==2.2
pytz==2014.2
six==1.6.1
workalendar==0.1
wsgiref==0.1.2

pip version:

pip 1.5.4 from /home/flyte/temp/workalendar/ve/local/lib/python2.7/site-packages (python 2.7)

setuptools version:

setuptools 2.2

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 22 (13 by maintainers)

Commits related to this issue

Most upvoted comments

maybe we could get rid of this issue by forcing a certain version of setuptools, or define a minimum version. On my (old) 14.04 Ubuntu LTS, the stock setuptools version is 3.3 ; the current latest I could install is 36.0.1.

With 3.3 it works like a charm. Maybe we could just add this line in the requirements:

setuptools>=3.3

(sidenote: is it me or is the versionning of setuptools became insane?)