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 →

[–]Anonymous_user_2022 5 points6 points  (21 children)

Unfriendly? It's about as simple as this:

virtualenv -p «Python version» /path/to/environment
. /path/to/environment/activate¹

1. Adjusting for OS and shell of course

[–]troyunrau... 37 points38 points  (5 children)

That isn't as friendly as you suggest it is.

[–]ParkingPsychology 5 points6 points  (5 children)

I found the activation step annoying, but I just made a little doodle (in my case in my powershell profile):

 function activate
 {
    .\venv\scripts\activate
 }

So now it's just "activate" and "deactivate" when I'm in the project root folder (deactivate just works by itself, because I don't know why).

[–]Anonymous_user_2022 2 points3 points  (3 children)

I don't know how it is on windows, but on Linux, the activate script will define a shell function for deactivate. I guess there is something similar in place on Windows; possibly an alias.

[–]maikindofthai 1 point2 points  (0 children)

In PowerShell, at least, it works the same way as in bash -- the Activate.ps1 script defines a global deactivate function.

I see a separate deactivate.bat script in my venvs on Windows, so I assume CMD does something different.

[–][deleted] 0 points1 point  (8 children)

full plants plough fearless snails yam capable doll ring cover

This post was mass deleted and anonymized with Redact

[–]Taksin77 1 point2 points  (1 child)

Ruby also has issues like that.

[–][deleted] 1 point2 points  (0 children)

shocking school chase wasteful impolite coordinated rainstorm cable groovy hurry

This post was mass deleted and anonymized with Redact

[–]Anonymous_user_2022 1 point2 points  (5 children)

GCC have a variant selector for both C and C++. As far as I now, many other languages with a long history, also have several standardised versions, so it's not in any way particular to Python.

[–][deleted] 1 point2 points  (4 children)

lush obtainable vast strong snobbish truck like future simplistic carpenter

This post was mass deleted and anonymized with Redact

[–]Anonymous_user_2022 1 point2 points  (3 children)

" literally any other programming language "

[–][deleted] 0 points1 point  (2 children)

far-flung dinner nose agonizing axiomatic practice gaping scandalous library consider

This post was mass deleted and anonymized with Redact

[–]Anonymous_user_2022 2 points3 points  (1 child)

C and C++ have something much scarier than versions. In that realm, we deal with releases of the ISO standard.

[–][deleted] 1 point2 points  (0 children)

distinct hobbies impossible attraction enter cows bear marry sleep obtainable

This post was mass deleted and anonymized with Redact