I can't install and configure virtual environment on python3 on my macbook pro. I was trying to install and try django for my next project but here problems started arising.
I can't install and configure virtual environment on python3 on my macbook pro. I was trying to install and try django for my next project but here problems started arising.
Install virtual environment in directory
In the main directory root add the following command to create the environment:
$ python3 -m venv venv this code will create a folder called venv in the root. Which basically is the virtual environment folder.
Then add the following command to activate the virtual environment:
$ source venv/bin/activate
your_project_folder/
|
|-- your_main_app_folder/
| |
| |--Folder_with_controllers/
| | settings.py
| | urls.py
| | ...
| |
| |--App_folder/
| |--Other_app_folder/
|
|--venv/
If the code works fine your bash should look like this:
(venv) <the_path_for_the_folder> your_project_folder %
After activated your environment you can now install django and other packages.
p.s.: make sure you instal and activate the virtual environment folder not in the your_main_app_folder.
You need to change you directory to current project directory.
Then run python -m venv .
This will install virtual environment in current directory. Then cd into Scripts folder cd Scripts and activate venv using . activate