Steps for Setting up a Python3 Virtual Environment
I use Windows and Linux together for dev.
My machine is a Windows 10 box and run Ubuntu in the ‘Windows Subsystem for Linux’.
I use vscode insalled on WIndows as my editing environment.
So my source code is on my windows file system and I use a symbolic link to access it in Ubuntu.
See the ‘Windows Subsystem for Linux’ docs for how to set it up.
See how to install virtualenv and virtualenvwrapper
If you do not already have one, setup a projects folder off your Ubuntu home folder.
cd ~ mkdir projects cd projects
Create a dev workspace in the Windows file system
D:\dev\apps\grokthis
In Ubuntu Setup a symbolic link to access it
This is the old way to mount a windows path in WSL ln -s /mnt/d/dev/grokthis grok
There is a WSL config that allows you to change this (Thanks Nick J) ln -s /d/dev/grokthis grok
In Ubuntu use mkvirtualenv to create a virtualenv that uses Python3
In my current Pelican setup I customize the Pelican source to allow jinja tests. (It detects the need for an update and calls a script from pelicanconf.py). Pelican is already setup to do jinja filters but for some reason they did not bother with tests. In order for this to work the virtualenv name must be the same as the folder name of the application. In this example that name is grokthis
mkvirtualenv -p python3 grokthis
In Ubuntu install your projects requirements (make sure your virtual env is active)
cd grok pip3 install -r requirements.txt
In a Nutshell
make an application folder on Windows.
make a symbolic link to the folder in linux.
mkvirtualenv -p python3 grokthis
cd grok
pip3 install -r requirements.txt
compile your app:
pelican —debug
To see the site, open a separate command shell
cd into your pelican application’s output folder
start the python local server
python -m http.server
go to localhost:8000 in your browser (Windows or Linux)