本文介绍了使用 virtualenv 安装某些软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我今年想开始使用 virtualenv.我喜欢 no-site-packages 选项,这很好.但是我想知道如何将某些软件包安装到每个 virtualenv 中.例如,假设我想将 django 安装到每个 virtualenv 中......这可能吗,如果是这样,如何?扩建能解决这个问题吗?

So, I want to start using virtualenv this year. I like the no-site-packages option, that is nice. However I was wondering how to install certain packages into each virtualenv. For example, lets say I want to install django into each virtualenv... is this possible, and if so, how? Does buildout address this?

嗯,它不是 django,更像是 django 应用程序……我不介意在每个 virtualenv 中安装一个 django 版本……我只是想知道是否有一些中间选项来无站点包"

Well it's not so much django, more like the django applications... I dont mind installing a version of django into each virtualenv... i was just wondering if there was some intermediate option to 'no-site-packages'

推荐答案

我建议使用 virtualenv引导 支持.这允许您在创建 virtualenv 后执行任意 Python,例如安装新包.

I'd suggest using virtualenv's bootstrapping support. This allows you to execute arbitrary Python after the virtualenv is created, such as installing new packages.

这篇关于使用 virtualenv 安装某些软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:24