GithubHelp home page GithubHelp logo

Comments (2)

stabud avatar stabud commented on May 26, 2024 3

Through trial and error I found the right solution.
To correctly install Argos-Translate, which will work offline, you need to follow these steps:

git clone https://github.com/argosopentech/argos-translate.git
cd argos-translate
virtualenv env
source env/bin/activate
pip install argostranslate
pip install argostranslategui

Note! If you do this:

git clone https://github.com/argosopentech/argos-translate.git
cd argos-translate
virtualenv env
source env/bin/activate
pip install -e .

then offline will not work!

from argos-translate.

bruceleerabbit avatar bruceleerabbit commented on May 26, 2024

This is quite alarming because no one expects argos-translate to use the cloud.

$ argos-translate --help
usage: argos-translate [-h] [--from-lang FROM_LANG] [--to-lang TO_LANG] [TEXT]

Open-source offline translation.
…

I run argos this way to enforce the offline expectation:

firejail --net=none --env=ARGOS_DEVICE_TYPE=auto argos-translate $args

Nonetheless, there is a substantial security issue here for anyone not sandboxing argos (probaby most people), so I suggest prepending “(security)” to the title. To worsen the security problem, note that the argos-translate project intermingles with libretranslate, which is inside the privacy-abusing walled garden of Cloudflare. So it’s concerning that the app uses the cloud when there is a good chance it could be sharing sensitive info with Cloudflare.

The other issue is indeed the packaging. The various pip tools are designed for python developers and not proper tools for end users, which I mention in bug 254. But since there is no proper package we are trapped. That said, the best of the worst is pipx.

I got burnt in a debian upgrade because python3 updates broke all pip-installed apps, thus forcing me to reinstall argos-translate. It was a disaster but one thing I discovered is pipx at least tries to do better than pip by automatically deploying a venv on every install, and by supporting upgrades. It’s still not a proper pkg manager but it’s fewer steps than pip or pip3. You can run something like this:

$ PIPX_HOME=${prefix:-/opt/}/pipx PIPX_BIN_DIR=${prefix:-/usr/local}/bin pipx install --verbose argostranslate

Then to verify:

$ PIPX_HOME=${prefix:-/opt/}/pipx PIPX_BIN_DIR=${prefix:-/usr/local}/bin pipx list
  venvs are in /opt/pipx/venvs
  apps are exposed on your $PATH at /usr/local/bin
     package argostranslate 1.9.6, installed using Python 3.11.2
      - argos-translate
      - argospm

Note that the PIPX_HOME and PIPX_BIN_DIR vars are optional. I use them to do a multi-user systemwide install. But it is a hack that makes some python devs cringe. Python’s toolchains assume everything is installed by and for a single user.

from argos-translate.

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.