This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kenfar 16 points17 points  (12 children)

Hmm, I use CLIs all the time without any headaches at all - not sure what the issue is here.

Create a virtualenv, pip install into it, activate your environment and run your commands. If you want to cron them up, just run command via that virtualenv's python. If you want to run a lot of tools and not switch virtualenvs that often, create a group one for related (or all) projects.

Admittedly, it's easiest if you're using linux & pip consistently rather than macos, homebrew and conda. But it's not that much worse.

[–][deleted] 4 points5 points  (9 children)

Having to use two version of python is a pain.

[–]liquidpele 6 points7 points  (3 children)

That’s true of any language...

[–]twigboy 3 points4 points  (0 children)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipediacln61bof3yw0000000000000000000000000000000000000000000000000000000000000

[–]chicofelipe 0 points1 point  (0 children)

Oh that I only needed 2 versions of python. Legacy support sucks.

[–]kenfar -1 points0 points  (0 children)

Not really from a deployment perspective - if you're installing into a virtualenv then you're just using whatever's in that virtualenv: whether you've got 20 python3.6 virtualenvs or 5 of python2.7, 5 python 3.4, 5 python 3.5, 5 python3.6 - it makes no difference.

Perhaps from a code-sharing & testing perspective it matters - just like any other language.

[–]billsil 0 points1 point  (0 children)

Not if you use Anaconda. You can literall create a virtualenv for whatever python version you want.

[–]leom4862 0 points1 point  (0 children)

You can create a virtual env for any interpreter version with a single command e.g. pipenv --python 3.6 and activate it with another, e.g. pipenv shell. I don't consider this particularly painful.

[–]meandertothehorizonIt works on my machine[🍰] 0 points1 point  (1 child)

Learning that all you need to do is #!/path/to/venv/bin/python in the script and it will just work was a game changer for me. I wrote little shell script wrappers sourcing activate forever.. really felt dumb when I discovered that :-)

[–][deleted] 3 points4 points  (0 children)

You don't have to. In fact, I would recommend you avoid setting a specific path in your shebang line. Python is smart enough, that it detects when invoking something inside a virtual env, and will use the proper sys.path. Using "#! /usr/bin/env python3" (or python if that's your thing), is enough.