sollidsnake/pipman

KryPy cannot be built because it doesn't see dependencies

Closed this issue · 1 comments

Hi,
I want to install KryPy package, it requires NumPy, which is installed as python-numpy:

local/python-numpy 1.12.1-1
Scientific tools for Python

However, pipman cannot build the package:

pipman krypy --target-dir=/home/user
pipman: Preparing virtualenv
pipman: Installing 'krypy' in virutalenv
Collecting krypy
  Using cached krypy-2.1.5.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-af1gg6ml/krypy/setup.py", line 18, in <module>
        from krypy import __version__
      File "/tmp/pip-build-af1gg6ml/krypy/krypy/__init__.py", line 1, in <module>
        from . import linsys, deflation, recycling, utils
      File "/tmp/pip-build-af1gg6ml/krypy/krypy/linsys.py", line 2, in <module>
        import numpy
    ModuleNotFoundError: No module named 'numpy'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-af1gg6ml/krypy/
Traceback (most recent call last):
  File "/usr/bin/pipman", line 73, in <module>
    action(args, quiet)
  File "/usr/bin/pipman", line 39, in generate
    Pip2Pkgbuild(packages, quiet=quiet).generate_all(dir)
  File "/usr/lib/python3.6/site-packages/pipman/pip2pkgbuild.py", line 31, in __init__
    self.install_in_venv(pack)
  File "/usr/lib/python3.6/site-packages/pipman/pip2pkgbuild.py", line 132, in install_in_venv
    '--disable-pip-version-check', package])
  File "/usr/lib/python3.6/site-packages/pipman/pip2pkgbuild.py", line 43, in _exec
    func(command)
  File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/tmp/pipman/pipman-venv/bin/pip', 'install', '--disable-pip-version-check', 'krypy']' returned non-zero exit status 1.

KryPy package itself works fine:

pip install --user krypy
Collecting krypy
  Using cached krypy-2.1.5.tar.gz
Installing collected packages: krypy
  Running setup.py install for krypy ... done
Successfully installed krypy-2.1.5

This seems to be an upstream issue. In my tests, it does happen with pip:

$ pip install krypy --user
Collecting krypy
  Using cached krypy-2.1.5.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-0jro3i0j/krypy/setup.py", line 18, in <module>
        from krypy import __version__
      File "/tmp/pip-build-0jro3i0j/krypy/krypy/__init__.py", line 1, in <module>
        from . import linsys, deflation, recycling, utils
      File "/tmp/pip-build-0jro3i0j/krypy/krypy/linsys.py", line 2, in <module>
        import numpy
    ModuleNotFoundError: No module named 'numpy'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0jro3i0j/krypy/

If I install the numpy module with pip install numpy --user, it does fix this error. That happens because the krypy package is missing these dependencies in its pip repository. So it works for you with pip probably because you already numpy installed, but pipman uses its own python environment, where it doesn't have access to your installed packages.

You could report this to the package maintainer, but as a workaround you can manually install these dependencies under pipman environment with:

pipman install krypy # this one will fail, but it's necessary to create the virtualenv if it's not created already
source /tmp/pipman/pipman-venv # let's enter pipman environment
pip install numpy scipy # installing krypy dependencies - scipy is also a dependency
pipman install krypy # now it should work

I'm closing this issue. Please let me know if it works for you.