7

I am attempting to build an application using meson, Gnome PasswordSafe. I have successfully built it on Arch, but have since moved to PureOS (Debian).

When running:

 $ meson . _build --prefix=/usr

it tells me:

meson.build:36:4: ERROR: Problem encountered: Missing dependency pykeepass >= master

What am I missing?

Thanks!


I installed pykeepass using pip. When that did not work, I tried using pip3. When that did not work, I tried both again, but with sudo. Still no dice.

I then installed it from the repo/source (https://github.com/pschmitt/pykeepass). No dice.


Currently, python help recognizes pykeepass as being installed to:

/home/dc3p/.local/lib/python3.7/site-packages/pykeepass/__init__.py
/usr/local/lib/python3.7/dist-packages/pykeepass/__init__.py
/home/dc3p/.local/lib/python2.7/site-packages/pykeepass/__init__.py
/usr/local/lib/python2.7/dist-packages/pykeepass/__init__.py

pip and pip3 list shows pykeepass as being present.

While I have it installed in all four locations currently, I have also tried while having only one installed at any location at a time.

I have also tried the meson command without and with sudo. Regardless of what I do, meson throws the same error.

Expected result is a build.

ashwin agrawal
  • 1,603
  • 8
  • 16
dc3p
  • 79
  • 1
  • Is `dc3p` some kind of virtual env which you are using? And have you checked python is added to the path? – ashwin agrawal Feb 23 '20 at 22:52
  • Moreover it seems you have python installed at two different locations? So it could happen due to conflict it is not able to detect the `pykeepass` lib – ashwin agrawal Feb 23 '20 at 23:14
  • I don't know much of meson, but you must check what's the python it's using and make `pykeepass` available there, is not through a virtual environment, then with the `--user` option (https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-user) or with the `--root` option (https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-root) – cristianoms Feb 24 '20 at 16:11
  • BTW, prefer python 3.x as 2.7 will STOP being officially supported by 2020 (https://www.python.org/dev/peps/pep-0373/) – cristianoms Feb 24 '20 at 16:15
  • From the documentation: *"Due to our frequent release cycle and development speed, distro packaged software may quickly become outdated."* Have you tried installing meson from pip? Arch is fast at updating packages as opposed to Debian which prefers stability to cutting edge software. [Link to the doc](https://mesonbuild.com/Quick-guide.html) – Jacques Gaudin Feb 25 '20 at 12:44
  • What happens if you don't use `--prefix=/usr`? – kmaork Feb 28 '20 at 11:42

1 Answers1

1

The meson.build file in PasswordSafe is testing for the presence of a directory in the file system which can lead to false negatives if the installation directory varies. See the code extract below.

# Python Module Check
pykeepass_dir = join_paths(python_dir, 'pykeepass')
construct_dir = join_paths(python_dir, 'construct')

if run_command('[', '-d', pykeepass_dir, ']').returncode() != 0
    error('Missing dependency pykeepass >= master')
endif

if run_command('[', '-d', construct_dir, ']').returncode() != 0
    error('Missing dependency python-construct >= 2.9.45')
endif

You can replace the above with the following to test for dependencies based on imports:

python3_required_modules = ['pykeepass', 'construct']

foreach p : python3_required_modules
    script = 'import importlib.util; import sys; exit(1) if importlib.util.find_spec(\''+ p +'\') is None else exit(0)'
    if run_command(python_bin, '-c', script).returncode() != 0
        error('Required Python3 module \'' + p + '\' not found')
    endif
endforeach

This should solve the issue providing that pykeepass is within your path.

Jacques Gaudin
  • 15,779
  • 10
  • 54
  • 75