Virtual Environment
This section applies only to pip
installs. Docker based installs eliminate such environment issues, and are therefore recommended.
Important: in addition to Python environment, there are other configuration settings to consider as described in the Quick Start.
Per-project venv
You created a virtual environment when you installed ApiLogicServer. This venv
will work for all of your created ApiLogicServer projects, or you can use a per-project venv
, as follows.
The created project contains a requirements.txt
used to create a virtual environment.
You can create it in the usual manner:
cd ApiLogicProject
python3 -m venv venv # may require python -m venv venv
source venv/bin/activate # windows venv\Scripts\activate
python3 -m pip install -r requirements.txt
Shared venv
If you wish to share a venv
over multiple projects, use Settings > Python: Venv Path, and specify a directory containing venv
directories (e.g, where you installed API Logic Server).
venv_setup
- shortcut setup procedures
Ss of release 5.02.10, projects are created with a venv_setup
directory which may be helpful in establishing and verifying your Python environment. For more information, see the Trouble Shooting Guide.
Notes
Issues with pip
The install sometimes fails due on machines with an older version of pip
. If you see a message suggesting you upgrade pip
, do so.
VSCode may fail to find your venv
If VSCode does not find your venv
, you can specify it manually using Python: Select Interpreter
For more information, see Work with Environments.