通过 ubuntu 创建的 Virtualenv django 项目,签出到 Windows 机器不跨操作系统兼容?
我在我的服务器上使用 virtualenv 创建了一个 django 项目。它是一个 Ubuntu 服务器。我已经把它签入svn了。 现在我在 Windows 机器上并检查了该项目。然而,我注意到,通过 Linux 创建时,激活和停用脚本位于 bash 中,而在 Windows 中则为 .bat 文件。此外,我的 Windows 机器上的 pip 是一个 exe 文件,而在通过 ubuntu 创建的项目上它不是。
我的问题是:是否有办法设置我的 Windows 环境,以便我能够在 Windows 计算机上工作(也许在 Windows 上安装 bash 或其他东西),在创建时我可以做些什么通过 ubuntu 的项目也许可以实现这一点 或者我只能通过 Linux 来从事此类项目?
I've created a django project with virtualenv on my server. It is an Ubuntu server. I have checked it into svn.
Now I'm on a windows machine and have checked out the project. I noticed however that the activate and deactivate scripts are in bash when created through linux and are .bat files in windows. Furthermore the pip on my windows machine is a exe file where on the project created through ubuntu it's not.
My question then is: is there anyway to setup my windows environment so that I'm able to work from a windows machine (perhaps installing bash on windows or something), is there something I can do when creating the project through ubuntu to allow for this perhaps
or will I be limited to working on this kind of project via linux?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,你可以安装 cygwin。
但你确实做错了。您不应该将 virtualenv 检查到您的存储库中 - 只是您的代码。您的代码应该包含在目标计算机上重新创建 virtualenv 所需的所有内容,这基本上意味着您传递给 pip 以重新安装相关库的requirements.txt 文件。
Well, you could install cygwin.
But you're doing it wrong, really. You shouldn't be checking your virtualenv into your repo - just your code. Your code should contain everything you need to recreate your virtualenv on the target machine, which basically just means a requirements.txt file which you pass to pip to reinstall the relevant libraries.