0

enter image description here

I'm a beginner at Django Web Framework. At the beginning when I start Django project I didn't see venv folder like on the picture on the left. I didn't have bin, lab , .gitignore and pyvenv.cfg files on the right picture.

When I made new env I see venv folder but also there are duplicate bin and lib folders. All I want for now is when I start new Django project is to have one VENV folder and that it's gonna be my only enviornment and also bin and lab folders be in venv folder.

What I try is this: That was the commands I enter on my MAC.

pip install virtualenv
virtualenv venv
source venv/bin/activate

That made a new env and folder venv. But I don't want to have another basic environment with name of the project like on the picture on the right. I don't want to have in project folder bin and lib folder also.

mousetail
  • 7,009
  • 4
  • 25
  • 45
  • You do generally want to create a new virtual environment for each project. You can use a tool like poetry to make syncing your dependencies between teammates a bit easier. Creating a virtualenvironment should not create any folders outside the venv folder – mousetail Dec 12 '22 at 10:09
  • lib and bin should reside inside venv dir. If they are outside then there is something wrong during its creation. Also, `.gitignore` , `pyenv.cfg` and the directory `.idea` are created by PyCharm to setup your environment (It also can create the virtualenvs) – Niko Dec 12 '22 at 10:30
  • @Niko ,By default when I starting new project,.gitignore, pyenv.cfg are outside and the name of my env is name of the project.I really dont know what happens – Aleksandar Kostadinov Dec 12 '22 at 10:35
  • Instead of manually creating one, try to use PyCharm settings to [configure a virtual env](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html#python_create_virtual_env). Since files are not where they should be , must be some kind of confusion with paths. – Niko Dec 12 '22 at 11:04
  • I can set new enviornment but when I go to start new project all of the things are the same..... – Aleksandar Kostadinov Dec 12 '22 at 12:08
  • When creating a new project, you always choose where the venv related to that project will be created, it should be `/.../my-project/venv`. Base interpreter should be your global Python. – Niko Dec 15 '22 at 06:58

0 Answers0