重装Ubuntu 14.04 LTS系统时安装rawpy失败,提示文件不存在
Hey there, I’ve dealt with this exact "rawpy/_rawpy.c: No such file or directory" error when installing rawpy on Ubuntu 14.04 before—let’s break down the fixes that got it working for me. The core issue here is that rawpy relies on compiling a C extension, which requires specific system dependencies and an up-to-date packaging toolchain.
Step 1: Install Required System Dependencies
First, you need to install the compilers and development libraries that rawpy’s C extension needs to build. Run this command to grab everything:
sudo apt-get update && sudo apt-get install gcc python-dev libraw-dev
gcc: The C compiler needed to build the extensionpython-dev: Header files for Python’s C API (required to compile Python extensions)libraw-dev: Development files for the LibRaw library, which rawpy wraps around
If you’re using Python 3 instead of the default Python 2.7 on Ubuntu 14.04, swap out python-dev for python3-dev:
sudo apt-get install gcc python3-dev libraw-dev
Step 2: Upgrade pip and Setuptools
Ubuntu 14.04 comes with a pretty outdated version of pip, which can cause issues when handling source distributions like rawpy. Upgrade these tools first:
sudo pip install --upgrade pip setuptools
For Python 3, use pip3 instead:
sudo pip3 install --upgrade pip setuptools
Step 3: Install rawpy
Now that your environment is set up, try installing rawpy again:
pip install rawpy
Or for Python 3:
pip3 install rawpy
If You Still Run Into Issues
If the above steps don’t work, try installing directly from the rawpy source to ensure the files are properly extracted:
- Download the source tarball (use
wgetto grab it directly):
Note: Replace the version number with the latest available that supports Python 2.7/3.4 (Ubuntu 14.04’s default Python versions)wget https://files.pythonhosted.org/packages/source/r/rawpy/rawpy-0.17.1.tar.gz - Extract the tarball and navigate into the directory:
tar -xzf rawpy-0.17.1.tar.gz && cd rawpy-0.17.1 - Build and install the package:
Again, usepython setup.py installpython3if you’re targeting Python 3.
内容的提问来源于stack exchange,提问作者SteveBz

