FG
☁️ Cloud & DevOpsAmazon

PyYAML requires python-dev dependency

Freshabout 21 hours ago
Mar 14, 20260 views
Confidence Score85%
85%

Problem

Hi, It seems the latest release of `awscli` requires PyYAML as its dependency. I noticed that this dependency breaks my CI test in Ubuntu 14.04. It returned the following error: [code block] I'm wondering, is it possible to use `awscli` via `pip install awscli` without adding extra `python-dev` dependency? Or if it's required to use extra dependency, I think it's a good idea to put it in the documentation. Thank you!

Error Output

error: Python.h: No such file or directory

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Install python-dev to Resolve PyYAML Dependency Issue

Low Risk

The error 'Python.h: No such file or directory' indicates that the Python development headers are missing. The PyYAML library requires these headers to compile native extensions, which are provided by the python-dev package. This is a common requirement when installing packages that include C extensions.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Update Package List

    Before installing any packages, ensure that your package list is up to date. This helps prevent issues with outdated packages.

    bash
    sudo apt-get update
  2. 2

    Install python-dev Package

    Install the python-dev package to provide the necessary development headers for Python. This is required for compiling PyYAML and other packages that depend on native extensions.

    bash
    sudo apt-get install python-dev
  3. 3

    Install awscli

    Now that the python-dev package is installed, you can proceed to install awscli using pip. This should now complete without errors related to PyYAML.

    bash
    pip install awscli
  4. 4

    Verify Installation

    Check that awscli is installed correctly by running the version command. This will confirm that the installation was successful and that all dependencies are resolved.

    bash
    aws --version

Validation

If the command 'aws --version' returns the version of awscli without any errors, the installation was successful and the PyYAML dependency issue is resolved.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

awsclicloudclosed-for-staleness