|
|
Subscribe / Log in / New account

Python virtual environments

Python virtual environments

Posted Jun 25, 2018 13:37 UTC (Mon) by jsmith45 (guest, #125263)
In reply to: Python virtual environments by gdamjan
Parent article: Python virtual environments

My biggest gripe against virtual environments is that they break direct execution of a python script.

You cannot just type /path/to/my/script.py from a newly opened shell and have it work, unless you install globally which is not recommended. This also means you cannot simply run by double clicking in Windows either.

Compare that with node.js. Sure you do need to run `npm install` once, but after you have done so, as long as you don't change the script, you can just directly execute in a newly opened shell and everything works fine.

That alone is a large part of the reason that many projects try rather hard to avoid using anything not in the standard library, since if they do so they must either contaminate the global environment, or lose the ability to run the script directly (they would need to create some shell script wrapper to enter a virtual environment and then execute it).


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds