简体   繁体   English

在现有目录中创建 virtualenv 而不创建“本地”目录

[英]Create virtualenv in existing directory without creating a “local” directory

I'm trying something simple.我正在尝试一些简单的事情。 I clone a repository and then I want to create a virtualenv in it:我克隆了一个存储库,然后我想在其中创建一个 virtualenv:

hg clone ssh://hg@bitbucket.org/neves/repo site
virtualenv site

When I run the command to create a Python virtualenv in an exiting project, a directory named local is created.当我运行命令在现有项目中创建 Python virtualenv 时,会创建一个名为local的目录。 All the contents of the "site" dir are copied to this local dir. “站点”目录的所有内容都被复制到这个本地目录。 I don't want this behaviour.我不想要这种行为。 Am I doing something wrong?我做错了什么吗? How do I create a virtualenv without creating this local dir?如何在不创建此本地目录的情况下创建 virtualenv?

I'm using virtualenv 1.10.1我正在使用 virtualenv 1.10.1

Not sure if it is still helpful, but you can do this.不确定它是否仍然有帮助,但您可以这样做。

virtualenv .

Install was fine with me.安装对我来说很好。

This just happens on some platforms (like Ubuntu) and is necessary because a virtualenv imitates the machine's installation, and local is part of that.这仅发生在某些平台(如 Ubuntu)上并且是必要的,因为 virtualenv模仿机器的安装,而local是其中的一部分。 Just add it to your SCM's ignore facility (eg .gitignore ).只需将它添加到您的 SCM 的忽略工具(例如.gitignore )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM