Code Monkey home page Code Monkey logo

Comments (10)

JoshData avatar JoshData commented on August 17, 2024 1

It's installed explicitly into a virtualenv at

rtyaml "email_validator>=1.0.0" "exclusiveprocess" \
so running mailinabox should fix it. But in that issue, the backup command is invoked the wrong way, which probably explains the problem.

from mailinabox.

kiekerjan avatar kiekerjan commented on August 17, 2024

In this case you should run /usr/local/lib/mailinabox/env/bin/pip list That will use the mailinabox virtual environment

from mailinabox.

MSSEsq avatar MSSEsq commented on August 17, 2024

I had previously run curl -s https://mailinabox.email/setup.sh | sudo bash and now ran mailinabox as Josh suggested. Neither fixed the problem of the rtyaml module not being found. Running cd /root/mailinabox/management then python3 backup.py still returns ModuleNotFoundError: No module named 'rtyaml'. Nevertheless, running /usr/local/lib/mailinabox/env/bin/pip list confirms that the rtyaml module is installed in the virtualenv. For some reason, the rtyaml module in the virtualenv is not being found.

from mailinabox.

JoshData avatar JoshData commented on August 17, 2024

Don't put python3 in the command to start backup.py. Just give the path to the python script alone. It has a shebang line at the top to activate its virtualenv where its packages are installed.

from mailinabox.

MSSEsq avatar MSSEsq commented on August 17, 2024

I originally tried directly running backup.py in the management directory without the python3 command which returns backup.py: command not found even though running ls confirms that the backup.py file is in the management directory. The only command line I tried that works properly is ~/mailinabox/management# /usr/local/lib/mailinabox/env/bin/python3 backup.py which seems to indicate that the virtualenv is not being used unless the full path to python3 in the virtualenv is specified.

from mailinabox.

amedee avatar amedee commented on August 17, 2024

Did you run backup.py or ./backup.py?
The ./ makes a big difference! If you don't give your shell a path to find a command, it will first look at al the directories in the $PATH variable, and if it doesn't find a command there, it will give up with command not found.

from mailinabox.

MSSEsq avatar MSSEsq commented on August 17, 2024

I did run backup.py which failed. Running ./backup.py which specifies running from the current directory rather than the command search path does enable the shebang line in backup.py to direct running python3 from the virtualenv. Thanks for the suggestion. I should have realized that the MiaB management directory is not in the default system command search path.

from mailinabox.

amedee avatar amedee commented on August 17, 2024

Could be a nice improvement, to add the MiaB management directory to the command search path. I'm going to make that customization.

from mailinabox.

MSSEsq avatar MSSEsq commented on August 17, 2024

I had the same thought about appending the MiaB management directory to the command search path. I created a file named “Mail-in-a-Box_management.sh” owned by 0:0 with mode 644 and saved it to the /etc/profile.d directory. This file contains:

# If a Mail-in-a-Box management directory exists
# then append it to the commamnd search path.
if [ -d "/root/mailinabox/management" ] ; then
PATH="$PATH:/root/mailinabox/management"
fi

This customization should be harmless because the default search path retains priority and no change is made to the search path unless the MiaB management directory exists. For an informative discussion of the ways to change the command search path see: https://askubuntu.com/questions/866161/setting-path-variable-in-etc-environment-vs-profile

from mailinabox.

amedee avatar amedee commented on August 17, 2024

I had the same thought about appending the MiaB management directory to the command search path. I created a file named “Mail-in-a-Box_management.sh” owned by 0:0 with mode 644 and saved it to the /etc/profile.d directory. This file contains:

If a Mail-in-a-Box management directory exists

then append it to the commamnd search path.

if [ -d "/root/mailinabox/management" ] ; then
PATH="$PATH:/root/mailinabox/management"
fi

This customization should be harmless because the default search path retains priority and no change is made to the search path unless the MiaB management directory exists. For an informative discussion of the ways to change the command search path see: https://askubuntu.com/questions/866161/setting-path-variable-in-etc-environment-vs-profile

I applied it as such on my box using Ansible.

from mailinabox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.