borg icon indicating copy to clipboard operation
borg copied to clipboard

Borg install using pip fails following docs exactly

Open Solverz-0 opened this issue 3 years ago • 7 comments

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

Yes

Is this a BUG / ISSUE report or a QUESTION?

ISSUE

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

Your borg version (borg -V).

borg 1.2.2

Operating system (distribution) and version.

Ubuntu 22.04.1 LTS

Hardware / network configuration, and filesystems used.

Virtualbox VM

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

pip install borgbackup

Describe the problem you're observing.

Following the Using pip in the docs when I get to the "pip install borgbackup" I get the belwo errors saying pkg-config probably not installed, but it definitley is in the virtualenv.

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

Yes, follow borg "using pip" docs, from start to "pip install borgbackup"

Include any warning/errors/backtraces from the system logs

(borg-env) root@ubuntu:~# pip install borgbackup
Collecting borgbackup
  Using cached borgbackup-1.2.2.tar.gz (4.0 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
  ╰─> [34 lines of output]
      Traceback (most recent call last):
        File "/tmp/pip-build-env-esnx__x6/overlay/lib/python3.10/site-packages/pkgconfig/pkgconfig.py", line 91, in _wrapper
          return func(*args, **kwargs)
        File "/tmp/pip-build-env-esnx__x6/overlay/lib/python3.10/site-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 966, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/usr/lib/python3.10/subprocess.py", line 1842, 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 "/root/borg-env/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/root/borg-env/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/root/borg-env/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-esnx__x6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-esnx__x6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-esnx__x6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 193, in <module>
        File "/tmp/pip-install-73oqulma/borgbackup_d70a4c95313c4c82a39a9e6cac965409/setup_crypto.py", line 28, in crypto_ext_kwargs
          if pc and pc.exists('libcrypto'):
        File "/tmp/pip-build-env-esnx__x6/overlay/lib/python3.10/site-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.

Solverz-0 avatar Sep 03 '22 14:09 Solverz-0

https://borgbackup.readthedocs.io/en/1.2.2/installation.html#from-source

ThomasWaldmann avatar Sep 03 '22 15:09 ThomasWaldmann

BTW, do not confuse the pkgconfig python package and the pkg-config commandline tool (which is required and used by the python package).

ThomasWaldmann avatar Sep 03 '22 15:09 ThomasWaldmann

BTW, do not confuse the pkgconfig python package and the pkg-config commandline tool (which is required and used by the python package).

Okay thank you but what dependencies can I be missing? as I just went through them all again and I am sure all of them are installed after checking my system

Solverz-0 avatar Sep 03 '22 15:09 Solverz-0

apt install pkg-config

ThomasWaldmann avatar Sep 03 '22 16:09 ThomasWaldmann

apt install pkg-config

Can these dependencies not be installed in the Virtualenv? (Sorry if this obvious question)

Or is the Virtualenv just for python libraries?

Solverz-0 avatar Sep 03 '22 16:09 Solverz-0

No, that is not a python software package, but ubuntu provides it as a .deb package. a virtual env is only for python software.

pkg-config is a tool which is generally useful to locate libraries and headers (borg uses it to find the zstd, lz4, openssl, xxhash stuff).

ThomasWaldmann avatar Sep 03 '22 16:09 ThomasWaldmann

Did you get it working?

ThomasWaldmann avatar Sep 09 '22 19:09 ThomasWaldmann

Well, let's assume so.

ThomasWaldmann avatar Oct 01 '22 20:10 ThomasWaldmann