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

The usual python misery. #13

Open
jult opened this issue Jul 11, 2024 · 0 comments
Open

The usual python misery. #13

jult opened this issue Jul 11, 2024 · 0 comments

Comments

@jult
Copy link

jult commented Jul 11, 2024

Gosh how I detest python. Why is there rarely, if at all, any proper documentation on python projects out there?
Fails at even the first inkling of an install;

root@server:~## python3.7 -m pip install -U pipenv
-bash: python3.7: command not found

root@server:~# python3.11.2 -m pip install -U pipenv
-bash: python3.11.2: command not found

root@server:~# python3 -m pip install -U pipenv
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Then installed it using apt install pipenv.
Second hurdle with your 'instructions':


root@server:~# gpasswd -a mailparser syslog adm postfix
Usage: gpasswd [option] GROUP

Options:
  -a, --add USER                add USER to GROUP
  -d, --delete USER             remove USER from GROUP
  -h, --help                    display this help message and exit
  -Q, --root CHROOT_DIR         directory to chroot into
  -r, --remove-password         remove the GROUP's password
  -R, --restrict                restrict access to GROUP to its members
  -M, --members USER,...        set the list of members of GROUP
  -A, --administrators ADMIN,...
                                set the list of administrators for GROUP
Except for the -A and -M options, the options cannot be combined.

Seems there is no adm or syslog group or user on a default debian 12 system. So had to move those out.
Third hurdble:

mailparser@server:~/postfix-parser$ pipenv install
Warning: Python 3.8 was not found on your system...
Neither 'pyenv' nor 'asdf' could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path/to/python

and then I tried:

root@server:~# whereis python
python:


So, your Install is pretty much moot there; Had to change the Pipfile entry where it requires Python 3.8 to 3.11.2 and now it finally runs!

Also

# Add a crontab entry to run the parse/import script every minute or so
# You should use a file lock utility such as `flock` (included by default on Ubuntu) or `lckdo` to prevent the
# cron overlapping if there's a lot to parse.

crontab -e
# *  *   *   *   *    flock /tmp/lck_mailparser /home/mailparser/postfix-parser/run.sh cron

I have no idea what you're trying to say here, and how you would run a cron "every minute or so" with only asterixes.

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

No branches or pull requests

1 participant