systemd/python-systemd

Cannot install on Ubuntu 18.04 from docs

smacz42 opened this issue · 2 comments

(virtualenv) root@oc1736-ourcompose-com--2021-07-11-01-56:~# /usr/local/lib/docker/virtualenv/bin/pip3 install -U --force-reinstall -v git+https://github.com/systemd/python-systemd.git#egg=systemd                                          
Using pip 21.1.3 from /usr/local/lib/docker/virtualenv/lib/python3.6/site-packages/pip (python 3.6)                    
Non-user install because user site-packages disabled                                                                                                                                                                                          
Created temporary directory: /tmp/pip-ephem-wheel-cache-yu65o3nt                                                                                                                                                                              
Created temporary directory: /tmp/pip-req-tracker-9jlex1xo                                                                                                                                                                                    
Initialized build tracking at /tmp/pip-req-tracker-9jlex1xo                                                                                                                                                                                   
Created build tracker: /tmp/pip-req-tracker-9jlex1xo                                                                                                                                                                                          
Entered build tracker: /tmp/pip-req-tracker-9jlex1xo                                                                                                                                                                                          
Created temporary directory: /tmp/pip-install-7pthecm8                                                                                                                                                                                        
Collecting systemd                                                                                                                                                                                                                            
  Cloning https://github.com/systemd/python-systemd.git to /tmp/pip-install-7pthecm8/systemd_b0aedc0644d74827b2cf4de913ce99e3                                                                                                                 
  Running command git clone -q https://github.com/systemd/python-systemd.git /tmp/pip-install-7pthecm8/systemd_b0aedc0644d74827b2cf4de913ce99e3                                                                                               
  Added systemd from git+https://github.com/systemd/python-systemd.git#egg=systemd to build tracker '/tmp/pip-req-tracker-9jlex1xo'                                                                                                           
    Running setup.py (path:/tmp/pip-install-7pthecm8/systemd_b0aedc0644d74827b2cf4de913ce99e3/setup.py) egg_info for package systemd                                                                                                          
    Created temporary directory: /tmp/pip-pip-egg-info-3m8k8600                                                                                                                                                                               
    Running command python setup.py egg_info                                                                                                                                                                                                  
    running egg_info                                                                                                                                                                                                                          
    creating /tmp/pip-pip-egg-info-3m8k8600/systemd_python.egg-info                                                                                                                                                                           
    writing /tmp/pip-pip-egg-info-3m8k8600/systemd_python.egg-info/PKG-INFO                                                                                                                                                                   
    writing dependency_links to /tmp/pip-pip-egg-info-3m8k8600/systemd_python.egg-info/dependency_links.txt                                                                                                                                   
    writing top-level names to /tmp/pip-pip-egg-info-3m8k8600/systemd_python.egg-info/top_level.txt                                                                                                                                           
    writing manifest file '/tmp/pip-pip-egg-info-3m8k8600/systemd_python.egg-info/SOURCES.txt'                                                                                                                                                
    package init file 'systemd/test/__init__.py' not found (or not a regular file)                                                                                                                                                            
    reading manifest file '/tmp/pip-pip-egg-info-3m8k8600/systemd_python.egg-info/SOURCES.txt'                                                                                                                                                
    reading manifest template 'MANIFEST.in'                                                                                                                                                                                                   
    warning: no previously-included files found matching 'docs/__pycache__/*'                                                                                                                                                                 
    adding license file 'LICENSE.txt'                                                                                                                                                                                                         
    writing manifest file '/tmp/pip-pip-egg-info-3m8k8600/systemd_python.egg-info/SOURCES.txt'                                                                                                                                                
  WARNING: Generating metadata for package systemd produced metadata for project name systemd-python. Fix your #egg=systemd fragments.                                                                                                        
  Source in /tmp/pip-install-7pthecm8/systemd_b0aedc0644d74827b2cf4de913ce99e3 has version 235, which satisfies requirement systemd-python from git+https://github.com/systemd/python-systemd.git#egg=systemd                                 
  Removed systemd-python from git+https://github.com/systemd/python-systemd.git#egg=systemd from build tracker '/tmp/pip-req-tracker-9jlex1xo'                                                                                                
WARNING: Discarding git+https://github.com/systemd/python-systemd.git#egg=systemd. Requested systemd-python from git+https://github.com/systemd/python-systemd.git#egg=systemd has inconsistent name: filename has 'systemd', but metadata has
 'systemd-python'                                                                                                                                                                                                                             

With the important line being:

WARNING: Discarding git+https://github.com/systemd/python-systemd.git#egg=systemd. Requested systemd-python from git+https://github.com/systemd/python-systemd.git#egg=systemd has inconsistent name: filename has 'systemd', but metadata has
 'systemd-python'                                                                                                                                                                                                                             

So I changed the command to:

/usr/local/lib/docker/virtualenv/bin/pip3 install -U --force-reinstall -v git+https://github.com/systemd/python-systemd.git#egg=systemd-python

which worked. I'm assuming that it's just a documentation issue?

This is also stemming from the fact that the version in pypi is 0.0.9, which does not have the systemd.daemon.listen_fds() function available.

I have the same issue in ubuntu 20.04 installing in a virtual environment

(_env) skrhee@skrhee-corsair:/media/H/Python/Nevados/bc-software$ pip3 install git+https://github.com/systemd/python-systemd.git#egg=systemd
Collecting systemd
  Cloning https://github.com/systemd/python-systemd.git to /tmp/pip-install-w9rfybkq/systemd
  Running command git clone -q https://github.com/systemd/python-systemd.git /tmp/pip-install-w9rfybkq/systemd
    ERROR: Command errored out with exit status 1:
     command: /media/H/Python/Nevados/bc-software/_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-w9rfybkq/systemd/setup.py'"'"'; __file__='"'"'/tmp/pip-install-w9rfybkq/systemd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-w9rfybkq/systemd/pip-egg-info
         cwd: /tmp/pip-install-w9rfybkq/systemd/
    Complete output (12 lines):
    Cannot find libsystemd or libsystemd-journal:
    
    Package libsystemd was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libsystemd.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libsystemd' found
    
    Package libsystemd-journal was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libsystemd-journal.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libsystemd-journal' found
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.