How to associate Python scripts with active virtualenv?

点点圈 提交于 2019-12-13 04:32:45

问题


After I activate specific virtualenv I'd like to have Python scripts, which I run using only their name (script.py), be executed using Python interpreter from virtualenv. How to do this?

It's a followup to the Why doesn't virtualenv on Windows associate .py/.pyw/.pyo/.pyc files with virtualenv's version of Python executables? question.


回答1:


Thanks to great work of Vinay Sajip, creator of Python Launcher (also called pylauncher) and this commit made by Paul Moore we can enjoy running Python scripts in the context of active virtualenv now! This feature is planned to be included in Python Launcher bundled with Python 3.4.



来源:https://stackoverflow.com/questions/17867214/how-to-associate-python-scripts-with-active-virtualenv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!