Python: Developing in Python: the local approach
This documentation is part of the Development platform guide. View the full guide here: Prepare your development platform for a pleasant and efficient experience.
👋 Welcome to the Stackhero documentation!
Stackhero offers a ready-to-use Python cloud solution that provides a host of benefits, including:
- Deploy your application in seconds with a simple
git push.- Use your own domain name and benefit from the automatic configuration of HTTPS certificates for enhanced security.
- Enjoy peace of mind with automatic backups, one-click updates, and straightforward, transparent, and predictable pricing.
- Get optimal performance and robust security thanks to a private and dedicated VM.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Python cloud hosting solution!
Setting up a local development environment involves installing Python, necessary dependencies, and tools on your computer.
Keep in mind that local development may come with limitations, such as hardware constraints or the need for manual updates and backups.
Setting up your local Python environment
To start developing with Python, you will need to install Python and its dependencies on your computer.
We will use asdf, a versatile tool that allows you to manage multiple environments and switch between different versions effortlessly.
While asdf may seem unfamiliar, it can significantly simplify your Python development experience, saving you time and preventing common issues associated with managing multiple environments and versions.
Python has its own virtual environment handlers (python venv, mkvirtualenv, or virtualenv), commonly used to isolate project dependencies. However, with asdf, you will not need to rely on these, as it offers a more robust solution for managing various runtime environments and versions.
asdf is useful not only for Python but also for many other languages like Node.js, Ruby, PHP, and more.
Installing asdf
To install asdf, simply follow the steps outlined in the official documentation.
Once you have completed the installation, you can verify that asdf is working correctly by running asdf version in your terminal. This command should display the installed version of asdf, confirming it is ready for use.
Installing Python using asdf
To install the latest version of Python using asdf, you can execute the following commands:
asdf plugin add python https://github.com/danhper/asdf-python.git
asdf install python latest
asdf global python latest
After completing the installation, verify that everything is functioning correctly by running the command below to display the installed Python version:
python --version
This should return the version number of the newly installed Python, confirming it is properly set up and ready for use.