Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

virtualenv - Where do I put my python files in the venv folder?

(Probably a noob question, but I didn't find a solution after googling for 20 minutes.)

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

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

  • Inside or outside of venv?
  • In the venv/binfolder?
  • Just inside venv, i.e. myproject/venv/myproject.py?
question from:https://stackoverflow.com/questions/51499950/where-do-i-put-my-python-files-in-the-venv-folder

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...