我在哪里将python文件放在venv文件夹中? [英] Where do I put my python files in the venv folder?

查看:673
本文介绍了我在哪里将python文件放在venv文件夹中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能是一个菜鸟问题,但在谷歌搜索20分钟后找不到解决方案。

我创建了一个新的具有PyCharm的 pure Python 项目,其产生以下文件夹结构

I created a new pure Python project with PyCharm which yielded the following folder structure

myproject
└── venv
    ├── bin
    │   ├── activate
    │   ├── activate.csh
    │   ├── activate.fish
    │   ├── easy_install
    │   ├── easy_install-3.5
    │   ├── pip
    │   ├── pip3
    │   ├── pip3.5
    │   ├── python
    │   ├── python3
    │   └── python3.5
    ├── include
    ├── lib
    │   └── python3.5
    ├── lib64 -> lib
    └── pyvenv.cfg

我在哪里放置是myproject.py 还是 myproject 文件夹?

Where do I put myproject.py or the myproject folder now?


  • venv 内部还是外部?

  • venv / bin 文件夹中?

  • 就在 venv 内,即 myproject / venv / myproject.py

  • Inside or outside of venv?
  • In the venv/binfolder?
  • Just inside venv, i.e. myproject/venv/myproject.py?

推荐答案

虚拟环境管理没有的文件你的不管您如何管理自己的文件。将它们放在对您有意义的任何地方,而不是放在venv目录树中的任何地方。常见的解决方案包括直接在 myproject 中或在 myproject / src 中。

The virtual environment manages files which aren't yours. It doesn't care how you manage your own files. Put them wherever makes sense to you, just not anywhere inside the venv directory tree. Common solutions include directly in myproject, or in myproject/src.

这篇关于我在哪里将python文件放在venv文件夹中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆