如何在树莓派3上安装Hadoop用户环境(HUE)及解决安装报错
Hey there, let's work through this cryptography build error you're facing. I've dealt with similar issues on ARM-based boards like the Pi 3, and it almost always comes down to missing system dependencies or compatibility tweaks for the older cryptography version HUE is trying to install. Here's how to fix it step by step:
Step 1: Install Required System Dependencies
Cryptography needs several low-level libraries and build tools to compile successfully. First, make sure you have all of them installed:
sudo apt-get update && sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev python-pip
These packages provide the compiler, SSL libraries, and Python development headers that are mandatory for building cryptography from source.
Step 2: Update Pip and Setuptools
Older versions of pip can struggle with ARM-compatible package builds. Upgrade them first to avoid unnecessary issues:
sudo pip install --upgrade pip setuptools
Step 3: Manually Install Cryptography 1.3.1 with ARM Optimizations
The default compilation flags might not work well with the Pi 3's ARM architecture. Set a specific optimization flag and install the required cryptography version manually before running HUE's make command:
export CFLAGS="-mfpu=neon" pip install cryptography==1.3.1
The -mfpu=neon flag enables NEON floating-point optimizations, which helps the compiler handle the cryptography code correctly on the Pi 3's CPU.
Step 4: Adjust HUE's Cryptography Dependency (If Step 3 Fails)
If the manual install still fails, the 1.3.1 version of cryptography has known compatibility issues with newer ARM environments. You can tweak HUE's dependency to use a more ARM-friendly version:
- Open the requirements file for HUE's core module:
nano /usr/local/hue-4.1.0/desktop/core/requirements.txt - Find the line that says
cryptography==1.3.1and replace it with:cryptography>=2.8 - Save the file (Ctrl+O, Enter) and exit (Ctrl+X).
Step 5: Re-Run HUE's Installation
Now clean up any partial builds and start the installation again:
cd /usr/local/hue-4.1.0 make clean make
Why This Happens
HUE 4.1.0 specifies an older version of cryptography (1.3.1) which wasn't fully optimized for ARM architectures like the Raspberry Pi 3. By ensuring you have all the build dependencies, updating your package tools, and either adding ARM-specific optimizations or using a newer cryptography version, you can get past this compilation failure.
内容的提问来源于stack exchange,提问作者linthu

