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

pip install borgbackup: pkg-config probably not installed #7698

Closed
calreyengineercom opened this issue Jul 2, 2023 · 7 comments
Closed

pip install borgbackup: pkg-config probably not installed #7698

calreyengineercom opened this issue Jul 2, 2023 · 7 comments
Labels

Comments

@calreyengineercom
Copy link

calreyengineercom commented Jul 2, 2023

Have you checked borgbackup docs, FAQ, and open GitHub issues?

yes

Is this a BUG / ISSUE report or a QUESTION?

bug

System information. For client/server mode post info for both machines.

Your borg version (borg -V).

should be 1.2.4, but doesn't install, so in reality there is no version

Operating system (distribution) and version.

Ubuntu 22.04

Hardware / network configuration, and filesystems used.

ext4

How much data is handled by borg?

none yet

Full borg commandline that lead to the problem (leave away excludes and passwords)

pip install "borgbackup==1.2.4"

Describe the problem you're observing.

error during installation

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

yes, it shows every time I try.

Include any warning/errors/backtraces from the system logs

Defaulting to user installation because normal site-packages is not writeable
Collecting borgbackup==1.2.4
  Using cached borgbackup-1.2.4.tar.gz (4.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error                     <<<====================================
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      Traceback (most recent call last):
        File "/tmp/pip-build-env-2qj1clas/overlay/local/lib/python3.10/dist-packages/pkgconfig/pkgconfig.py", line 91, in _wrapper
          return func(*args, **kwargs)
        File "/tmp/pip-build-env-2qj1clas/overlay/local/lib/python3.10/dist-packages/pkgconfig/pkgconfig.py", line 125, in exists
          return call(cmd) == 0
        File "/usr/lib/python3.10/subprocess.py", line 345, in call
          with Popen(*popenargs, **kwargs) as p:
        File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: 'pkg-config'
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 143, in _get_build_requires
          self.run_setup()
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 193, in <module>
          setup_crypto.crypto_ext_kwargs(pc, system_prefix_openssl),
        File "/tmp/pip-install-bk6_s333/borgbackup_6cffe56d040e461e9b306e1fa1dca8e1/setup_crypto.py", line 28, in crypto_ext_kwargs
          if pc and pc.exists('libcrypto'):
        File "/tmp/pip-build-env-2qj1clas/overlay/local/lib/python3.10/dist-packages/pkgconfig/pkgconfig.py", line 93, in _wrapper
          raise EnvironmentError("pkg-config probably not installed: %r" % e)
      OSError: pkg-config probably not installed: FileNotFoundError(2, 'No such file or directory')
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Comment: the error relates to the missing 'pkg-config' file or directory, while it seems that it should be 'pkgconfig' (without the dash).

@ThomasWaldmann
Copy link
Member

Please read the docs, start at the top of the page:

https://borgbackup.readthedocs.io/en/stable/installation.html

@ThomasWaldmann ThomasWaldmann changed the title Error during borg installation pip install borgbackup: pkg-config probably not installed Jul 2, 2023
@calreyengineercom
Copy link
Author

Thanks for pointing me to the proper doc page.

I got confused mostly by the similarity of the names of the packages:
the page "https://github.com/borgbackup/borg/releases?page=1", section "[Release 1.2.4]" tells "use: pip install pkgconfig", which I did, and the error encountered by me indicated missing package "pkg-config".
Seeing so similar names I was thinking that there is a spelling error in the script and I haven't investigated further. My bad !

Again, thanks for your quick help :-)

@calreyengineercom
Copy link
Author

Borg installed, case closed :-)

@calreyengineercom
Copy link
Author

calreyengineercom commented Jul 3, 2023 via email

@debuglevel
Copy link
Contributor

Just in case anybody stumbles upon this:
There is probably a package from your distribution called pkg-config, pkgconf et ecerta AND a python package called pkgconfig. The Python pkgconfig is a wrapper/binding for your system's pkg-config. Install both.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Sep 4, 2023

Since we have the pyproject.toml file, the python pkgconfig package should get installed automatically when using a recent enough version of pip:

https://github.com/borgbackup/borg/blob/master/pyproject.toml

https://github.com/borgbackup/borg/blob/1.2-maint/pyproject.toml

One still needs to have the pkg-config CLI tool installed though.

@RonnyPfannschmidt
Copy link
Contributor

Would it make sense to use cibuildwheel to provide wheels for some manylinux versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants