I'm in #python hell:
root ~ # /usr/local/bin/twine --version
twine version 1.15.0
user ~ # /usr/local/bin/twine --version
twine version 1.9.1
Same computer, new shells.
`python3 -m venv /path/to/my/proj/dir/venv`
(Can put it anywhere, proj. dir is just handy) which can then be activated with
That way anything you install with pip will be self-contained and avoid version problems. (To exit you can just type `deactivate`)
@ItsTheManOnTheMoon @fabian Is "python3 -m venv" the same as "virtualenv venv"?
Can the venv-dir itself be a subdir of the source dir so that it doesn't mess up my PROJECT/bin/ dir?
Do I have to re-activate the env (after reboot)?
How am I able to use the venv in cronjobs that are calling the python files?
@publicvoit @fabian Ah, it does look like virtualenv is the same thing. The venv dir can go anywhere, and you would need to re-activate it any time you want to work on that project. (Most IDEs will also let you specify the environment for the project too.)
I haven't tested to confirm, but for cron I think you just invoke the venv python directly (https://stackoverflow.com/a/3287063)
* * * * * cd /path/to/my/project && /path/to/my/venv/bin/python mycode.py
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!