Python: Setting up your development environment

Prepare your development platform for a smooth and productive experience

👋 Welcome to the Stackhero documentation!

Stackhero offers a ready-to-use Python cloud solution designed to simplify your deployments:

  • Deploy your application to production within seconds using a simple git push.
  • Use your own domain name, with automatic HTTPS certificate setup for secure connections managed on your behalf.
  • Take advantage of automatic backups, one-click updates, and predictable pricing, so you can focus on your code rather than infrastructure management.
  • Benefit from high performance and security on a private, dedicated infrastructure. Your environment is isolated and protected.

Save time and streamline your workflow: your code can be up and running with Stackhero's Python cloud hosting in just 5 minutes.

A well-prepared development environment streamlines your workflow and enhances productivity.

Setting up Python locally involves installing the runtime, dependencies, and development tools directly on your own machine. This approach gives you complete control, but you are responsible for updates, backups, and maintaining a consistent environment.

For a flexible and consistent setup, you can use asdf, a tool designed to manage multiple runtime versions. asdf supports not only Python, but also many other languages such as Node.js, Ruby, and PHP. It makes switching between versions straightforward and helps keep your projects isolated.

Traditional Python workflows use virtual environments (like python venv, virtualenv, or mkvirtualenv) to separate dependencies. With asdf, you can manage both Python versions and project environments more robustly, reducing friction and avoiding common version conflicts.

Follow the official asdf installation guide to set up asdf on your system.

After installation, check that asdf is correctly configured by running:

asdf version

This should display the installed version, confirming that asdf is ready to use.

To add Python support and install the latest version, run:

asdf plugin add python https://github.com/danhper/asdf-python.git
asdf install python latest
asdf global python latest

Once complete, verify your Python version:

python --version

This output confirms your Python installation is ready for development.

You can create a new Python project in just a few steps:

mkdir my_project
cd my_project

To set the Python version for this project and initialise a Git repository:

asdf install python latest \
  && asdf local python latest

echo "__pycache__/" >> .gitignore

git init
git add -A .
git commit -m "First commit"

These commands create a new directory, configure your Python version for the project, and start version control with an initial commit. You can begin development immediately.

A local Git repository has been initialised for your Python project, but it is not yet connected to a remote hosting service.

For reliable backups and easier collaboration, you can create a repository on platforms such as GitLab, GitHub, or Bitbucket.

If you require a dedicated and secure Git hosting solution, Stackhero offers a GitLab cloud service running on private infrastructure in Europe or the USA. This option provides rapid setup and ensures the confidentiality of your code.