tonysyu/mpltools

Mpltools installation: ImportError: No module named '_config'

ilonajulczuk opened this issue · 6 comments

Hi, I tried to install mpltools in virtualenv with python3.
I cannot import '_config'. Can anyone help me? Here is a log from pip.

------------------------------------------------------------
/home/att/Projects/hypergraph/py3/bin/pip run on Tue Mar 25 12:10:17 2014
Downloading/unpacking mpltools

  Getting page https://pypi.python.org/simple/mpltools/
  URLs to search for versions for mpltools:
  * https://pypi.python.org/simple/mpltools/
  Analyzing links from page https://pypi.python.org/simple/mpltools/
    Found link https://pypi.python.org/packages/source/m/mpltools/mpltools-0.1.tar.gz#md5=82f6941121792508ae9002290da01e97 (from https://pypi.python.org/simple/mpltools/), version: 0.1
    Skipping link http://matplotlib.sourceforge.net/ (from https://pypi.python.org/simple/mpltools/); not a file
    Skipping link http://matplotlib.sourceforge.net/users/customizing.html (from https://pypi.python.org/simple/mpltools/); unknown archive format: .html
    Skipping link http://tonysyu.github.com/mpltools (from https://pypi.python.org/simple/mpltools/); not a file
    Skipping link http://tonysyu.github.com/mpltools/auto_examples/index.html (from https://pypi.python.org/simple/mpltools/); unknown archive format: .html
    Skipping link http://tonysyu.github.com/mpltools/getting_started.html (from https://pypi.python.org/simple/mpltools/); unknown archive format: .html
    Skipping link http://www.voidspace.org.uk/python/configobj.html (from https://pypi.python.org/simple/mpltools/); unknown archive format: .html
  Downloading mpltools-0.1.tar.gz

  Downloading from URL https://pypi.python.org/packages/source/m/mpltools/mpltools-0.1.tar.gz#md5=82f6941121792508ae9002290da01e97 (from https://pypi.python.org/simple/mpltools/)
  Running setup.py egg_info for package mpltools

    Traceback (most recent call last):

      File "<string>", line 16, in <module>

      File "/home/att/Projects/hypergraph/py3/build/mpltools/setup.py", line 6, in <module>

        from mpltools import __version__

      File "./mpltools/__init__.py", line 22, in <module>

        import _config

    ImportError: No module named '_config'

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/home/att/Projects/hypergraph/py3/build/mpltools/setup.py", line 6, in <module>

    from mpltools import __version__

  File "./mpltools/__init__.py", line 22, in <module>

    import _config

ImportError: No module named '_config'

----------------------------------------

Cleaning up...

Sorry for the delayed response. Unfortunately, I don't have a Python 3 installation, which would actually be required to fix the (likely) many incompatibilities with Python 3. The current error is complaining about relative imports, so that's an easy fix, but there are likely to be many more issues.

I don't have the bandwidth for making this Python 3 compatible, but I'm happy to accept pull requests. Also, I should note that the styleheet interface in mpltools has been ported over to matplotlib itself (currently, it's in the development branch, but it should appear in release 1.4 soon). If you need a simple function from mpltools, you can probably just copy it from here and reuse it (fixing up any Python 3 incompatibilities, if necessary). Sorry I couldn't be more helpful.

I am also facing similar issue! was anyone able to find a solution for that!

This is just a missing dependency, solved by pip install configobj.

It should be added as a dependency in setup.py and it will get installed automatically when you pip install mpltools.

Looks like this is fixed in github with this commit d6d32fe. Must just not be in the cheese shop (or default in cheese shop).

Actually, the dependency problem is not it. I was using 2.7 and just retried with 3.4 and that issue does exist even with the configobject dependency installed. Sorry guys.

@atteroTheGreatest, @bhuppi-nitt, @godber: Could you give PR #22 a shot? If you're tracking this repo on github, you probably know how to test the branch. Alternatively, the pip incantation looks like::

pip install git+https://github.com/tonysyu/mpltools.git@feature/python-3-compatibility

BTW, if you're using this package for the stylesheets, Matplotlib 1.4 (soon-to-be released) will have a style sub-package with all the bells and whistles found here.