Django 虚拟环境

发布于 2024-11-08 20:19:14 字数 756 浏览 0 评论 0原文

我有一些关于 virtualenv 的一般问题。

我在网上找到了一些关于 virtualenv 的文档,尽管我认为我的设置没有正确安装某些内容。

基本上我正在考虑将我的应用程序分离到它们自己的目录中,并且我想开始升级 django 和某些其他功能以部署到服务器。

所以我已经根据这个 --no-site-packages 安装了 virtualenv

pip install virtualenv

设置我的新 virtualenv

mkdir virt_env
vitualenv virt_env/virt1 --no-site-packages

你的安装应该只包含基础知识。

我已经激活了 virtualenv

source virt_env/virt1/bin/activate

,然后运行 ​​yolk -l 来查看安装了哪些软件包。 结果似乎不仅仅是基础知识,因为我以前的所有插件仍然列出。

我什至尝试停用,将目录更改为名为virt1的环境,反应性然后再次运行yolk -l

它仍然列出了我所有的包裹。

这是正常现象,还是我做错了什么?

I have a few questions regarding virtualenv in general.

I have found some documentation online about virtualenv, although I don't think my setup is installing something correctly.

Basically I am looking at seperating my applications into their own directories and I want to start upgrading django and certain other features for deployment to the servers.

So I have gone and installed virtualenv

pip install virtualenv

setup my new virtualenv

mkdir virt_env
vitualenv virt_env/virt1 --no-site-packages

according to this --no-site-packages your installation should only have the basics in it.

I have activated my virtualenv

source virt_env/virt1/bin/activate

and then ran yolk -l to see what packages are installed.
the result seems to be a lot more than just the basics as all my previous addons are still listed.

I have even tried to deactivate, change directory into the environment called virt1, reactive and then run yolk -l again.

Still it lists all my packages.

Is this normal, or am I doing something wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晒暮凉 2024-11-15 20:19:14

您使用的是安装在 virtualenv 中的 yolk 还是全局 yolk 安装?

flaper87@BigMac:/tmp$ virtualenv test3 --no-site-packages
New python executable in test3/bin/python
Installing setuptools............done.
Installing pip...............done.
flaper87@BigMac:/tmp$ source test3/bin/activate
(test3)flaper87@BigMac:/tmp$ pip install yolk
Downloading/unpacking yolk
  Downloading yolk-0.4.1.tar.gz (80Kb): 80Kb downloaded
  Running setup.py egg_info for package yolk
Requirement already satisfied (use --upgrade to upgrade): setuptools in ./test3/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg (from yolk)
Installing collected packages: yolk
  Running setup.py install for yolk
    Installing yolk script to /private/tmp/test3/bin
Successfully installed yolk
Cleaning up...
(test3)flaper87@BigMac:/tmp$ yolk -l
Python          - 2.6.1        - active development (/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload)
pip             - 1.0.1        - active 
setuptools      - 0.6c11       - active 
wsgiref         - 0.1.2        - active development (/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6)
yolk            - 0.4.1        - active 
(test3)flaper87@BigMac:/tmp

我真的建议您看一下 virtualenvwrapper[0],这是一组可以帮助您管理 virtualenv 的扩展。

干杯!

[0] http://www.doughellmann.com/projects/virtualenvwrapper/

Are you using a yolk installed in your virtualenv or the global yolk installation?

flaper87@BigMac:/tmp$ virtualenv test3 --no-site-packages
New python executable in test3/bin/python
Installing setuptools............done.
Installing pip...............done.
flaper87@BigMac:/tmp$ source test3/bin/activate
(test3)flaper87@BigMac:/tmp$ pip install yolk
Downloading/unpacking yolk
  Downloading yolk-0.4.1.tar.gz (80Kb): 80Kb downloaded
  Running setup.py egg_info for package yolk
Requirement already satisfied (use --upgrade to upgrade): setuptools in ./test3/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg (from yolk)
Installing collected packages: yolk
  Running setup.py install for yolk
    Installing yolk script to /private/tmp/test3/bin
Successfully installed yolk
Cleaning up...
(test3)flaper87@BigMac:/tmp$ yolk -l
Python          - 2.6.1        - active development (/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload)
pip             - 1.0.1        - active 
setuptools      - 0.6c11       - active 
wsgiref         - 0.1.2        - active development (/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6)
yolk            - 0.4.1        - active 
(test3)flaper87@BigMac:/tmp

I really suggest you to take a look at virtualenvwrapper[0] which is a set of extensions that help you on managing your virtualenvs.

Cheers!

[0] http://www.doughellmann.com/projects/virtualenvwrapper/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文