Installing P
Installing P
Looking for P 1.x?
If you want to use older P version 1.x.x, please use the installation steps here.
P is built to be cross-platform and can be used on MacOS, Linux, and Windows. Follow the steps below to install P along with the required dependencies.
Verify each step
After each step, use the troubleshooting check to ensure the installation succeeded.
Install .NET SDK
The P compiler is implemented in C# and hence the tool chain requires dotnet.
P currently uses the specific version of .Net SDK 8.0.
Installing .Net SDK on MacOS using Homebrew (details)
brew tap isen-ng/dotnet-sdk-versions
brew install --cask dotnet-sdk8-0-200
Dont have Homebrew? Install manually using the installer for x64 or Arm64.
Installing .Net SDK on Ubuntu (details)
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt update && sudo apt install -y dotnet-sdk-8.0
Installing .Net SDK on Amazon Linux 2 (details)
wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh -c 8.0 -i ~/.dotnet
# If using a bash shell, replace .zshrc with .bashrc in the below commands
echo 'PATH=$HOME/.dotnet:$HOME/.dotnet/tools:$PATH' >> ~/.zshrc
echo 'export PATH' >> ~/.zshrc
source ~/.zshrc
sudo mkdir /usr/share/dotnet/
sudo cp -r ~/.dotnet/* /usr/share/dotnet/
Troubleshoot: Confirm that dotnet is correctly installed on your machine.
dotnet --list-sdks
You must see an SDK with 8.0.* dotnet version installed.
If you get dotnet command not found error, mostly likely, you need to add the path to dotnet in your PATH.
Useful resources:
- For Ubuntu: fxr does not exist
Install Java Runtime
The P compiler also requires Java (java version 11 or higher).
Installing Java on MacOS using Homebrew (details)
brew install java
Installing Java on Ubuntu (details)
sudo apt install -y default-jre
Installing Java 17 on Amazon Linux (you can use any version of java >= 11)
sudo yum install -y java-17-amazon-corretto
Installing Java on Windows (details)
Troubleshoot: Confirm that java is correctly installed on your machine.
java -version
If you get java command not found error, mostly likely, you need to add the path to java in your PATH.
Install P Tool
Finally, install the P tool as a dotnet tool:
dotnet tool install --global P
Troubleshoot: Confirm that p is correctly installed on your machine
After installation, run which p and it should show:
which p
/Users/<user>/.dotnet/tools/p
$HOME/.dotnet/tools to $PATH in your .bash_profile (or equivalent) and try again after restarting the shell.
If you are getting the error that the p command is not found, it is most likely that $HOME/.dotnet/tools is not in your PATH.
Updating P Compiler
You can update the version of P compiler by running the following command:
dotnet tool update --global P
Recommended IDE (Optional)
| Purpose | Recommended Tool |
|---|---|
| Developing P programs | Peasy (VS Code extension) |
| AI-assisted P development | PeasyAI (Cursor / Claude Code) |
Great ! You are all set to compile and check your first P program
!