Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'rawpy' #4

Open
ManudattaG opened this issue Sep 15, 2021 · 23 comments
Open

No module named 'rawpy' #4

ManudattaG opened this issue Sep 15, 2021 · 23 comments

Comments

@ManudattaG
Copy link

ManudattaG commented Sep 15, 2021

I'm getting ModuleNotFoundError for 'rawpy' library on my MacOS. I tried installing rawpy directly using 'pip install' / 'brew install' and also using .whl files of multiple versions downloading from org website. Didn't seem to be working anyways. Please help me with this? Thanks.

Traceback (most recent call last): File "photo_raw_converter_svc/converter.py", line 5, in <module> import rawpy ModuleNotFoundError: No module named 'rawpy'

This is my installed libraries in my venv

Cython==0.29.24 imageio==2.9.0 numpy==1.21.2 Pillow==8.3.2

@achimoraites
Copy link
Owner

@ManudattaG Thanks for letting me know !

I will have a look !!!

@achimoraites
Copy link
Owner

@ManudattaG What MacOS version are you using ?

@ManudattaG
Copy link
Author

ManudattaG commented Oct 1, 2021

@achimoraites Yeah. I tried running pip install Pillow rawpy imageio inside my environment and this is the stacktrace

Collecting rawpy ERROR: Could not find a version that satisfies the requirement rawpy (from versions: none) ERROR: No matching distribution found for rawpy

Tried installing different rawpy versions as well (from org and .whl files). Some or the other dependencies fail.

MacOS version -- Big Sur 11.6

@achimoraites
Copy link
Owner

Have you tried using Anaconda ?

You could also try to update pip

pip install --upgrade pip

And then try to run

pip install Pillow rawpy imageio

@ManudattaG
Copy link
Author

@achimoraites Unfortunately conda also didn't work. I managed to install 'rawpy' by following this link. It seemed to work and installed latest version of libraw and rawpy like mentioned in "Installation from source on Linux/macOS" from the docs.
But while running the app --> cd app --> python convert.py --s ./images I'm getting the below error

Traceback (most recent call last):
  File "convert.py", line 5, in <module>
    import rawpy
  File "/Users/PythonExamples/Python-Image-Converter/env/lib/python3.8/site-packages/rawpy/__init__.py", line 5, in <module>
    import rawpy._rawpy
ImportError: dlopen(/Users/PythonExamples/Python-Image-Converter/env/lib/python3.8/site-packages/rawpy/_rawpy.cpython-38-darwin.so, 2): Symbol not found: __ZN6LibRaw11open_bufferEPvm
  Referenced from: /Users/PythonExamples/Python-Image-Converter/env/lib/python3.8/site-packages/rawpy/_rawpy.cpython-38-darwin.so
  Expected in: flat namespace
 in /Users/PythonExamples/Python-Image-Converter/env/lib/python3.8/site-packages/rawpy/_rawpy.cpython-38-darwin.so

@pmm36
Copy link

pmm36 commented Apr 12, 2022

im getting this same issue on a m1 Mac on Monterey 12.3.1 and would love help with a resolution

@adrienohana
Copy link

Same issue here on M1 Pro macOS Monteray 12.1

  • pip install rawpy -
    ERROR: Could not find a version that satisfies the requirement rawpy (from versions: none)
    ERROR: No matching distribution found for rawpy

  • conda install rawpy - (with miniforge)
    Collecting package metadata (current_repodata.json): done
    Solving environment: failed with initial frozen solve. Retrying with flexible solve.
    Collecting package metadata (repodata.json): done
    Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  • rawpy

Current channels:

@achimoraites
Copy link
Owner

I will have a look !

meanwhile does this work for you ?
https://anaconda.org/appfanu/rawpy

@adrienohana
Copy link

Hello thanks,
I get the same error as "conda install rawpy" with both suggestions on the given link

@achimoraites
Copy link
Owner

achimoraites commented Apr 15, 2022

@ManudattaG @adrienohana @pmm36
I just tried it in MacOS Monterey using Python v3.8.13
It worked without issues 🤔

Note that unfortunately i don't have an M1 machine to test it 😞

Here are the exact versions that were used

imageio==2.16.2
Pillow==9.1.0
rawpy==0.17.1
numpy==1.22.3

I have included the requirements.txt file in the project as well

Here there is some extra info about my anaconda setup

 conda version : 4.12.0
 conda-build version : 3.21.4
 python version : 3.8.8.final.0
 virtual packages : __osx=10.16=0
                          __unix=0=0
                          __archspec=1=x86_64
  conda av metadata url : None
  channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch

 platform : osx-64
 user-agent : conda/4.12.0 requests/2.25.1 CPython/3.8.8 Darwin/21.4.0 OSX/10.16

OS specific

 System Version: macOS 12.3 (21E230)
 Kernel Version: Darwin 21.4.0

@achimoraites
Copy link
Owner

I have published it as a package 📦 in PyPI, you could try to see if installing it from there works for you

pip3 install raw_image_converter

@adrienohana
Copy link

Dear @achimoraites,

Thank you for your help. I've just set up an environment with your requirements and the same python version . tried all of the above again (and pip3 install raw_image_converter) but it's still not working on my M1...

ERROR: Could not find a version that satisfies the requirement rawpy (from versions: none)
ERROR: No matching distribution found for rawpy

@pmm36
Copy link

pmm36 commented Oct 11, 2022 via email

@SmartDucksWorks
Copy link

Ran in to this yesterday. Thought it might be that I’m testing the latest beta on my M1. Apparently not. Whom do I need to pay? ;)

@pmm36
Copy link

pmm36 commented Nov 22, 2022 via email

@rkshthrmsh
Copy link

rkshthrmsh commented Mar 11, 2023

Seems like this issue still exists on Apple Silicon. Tried installing from source too, as mentioned in the documentation, but repeatedly got ModuleNotFoundError. Should $PYTHONPATH be updated after the install?

Installation steps:

gh repo clone letmaik/rawpy
cd rawpy
pip3 intall .

Output:

Installing collected packages: rawpy
  DEPRECATION: rawpy is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for rawpy ... done
Successfully installed rawpy

However, scripts are unable to locate the package.

ModuleNotFoundError: No module named 'rawpy'

@GrousexyHKCN
Copy link

also the same error in M2 Macbook Air. Try all the methods above but still:
pip install rawpy
ERROR: Could not find a version that satisfies the requirement rawpy (from versions: none)
ERROR: No matching distribution found for rawpy

@pmm36
Copy link

pmm36 commented Jan 18, 2024

also the same error in M2 Macbook Air. Try all the methods above but still: pip install rawpy ERROR: Could not find a version that satisfies the requirement rawpy (from versions: none) ERROR: No matching distribution found for rawpy

m2 is the same architecture as m1 they are all Apple silicon arm64
Follow the instructions on the rawpy page, after manually downloading and installing cmake + enable command line tools in the cmake gui menu

ensure that typing cmake in the terminal works.

then install Libraw from source
git clone https://github.com/LibRaw/LibRaw.git libraw
git clone https://github.com/LibRaw/LibRaw-cmake.git libraw-cmake
cd libraw
git checkout 0.20.0
cp -R ../libraw-cmake/* .
cmake .
sudo make install

then install rawpy from source

git clone https://github.com/letmaik/rawpy
cd rawpy
pip install numpy cython
pip install .

@GrousexyHKCN
Copy link

@pmm36 amazing bro, it works. Thanks a lot

@pmm36
Copy link

pmm36 commented Jan 19, 2024 via email

@TClarke2
Copy link

This worked for me a few months ago. Something happened and I had to start from scratch with getting everything I was sing with rawpy reinstalled etc... Now when I try this "Failed to build rawpy
ERROR: Could not build wheels for rawpy, which is required to install pyproject.toml-based projects" Does anyone know what this might be? I have an M1 Pro Mac

@pmm36
Copy link

pmm36 commented May 26, 2024

This worked for me a few months ago. Something happened and I had to start from scratch with getting everything I was sing with rawpy reinstalled etc... Now when I try this "Failed to build rawpy ERROR: Could not build wheels for rawpy, which is required to install pyproject.toml-based projects" Does anyone know what this might be? I have an M1 Pro Mac

I had similar after reinstalling my machine, I ended up deleting all rawpy and Libraw folders created during the previous build and running through the compiling from source process from the beginning (ensuring cmake was installed and callable from the terminal first

@TClarke2
Copy link

TClarke2 commented Jun 5, 2024

This worked for me a few months ago. Something happened and I had to start from scratch with getting everything I was sing with rawpy reinstalled etc... Now when I try this "Failed to build rawpy ERROR: Could not build wheels for rawpy, which is required to install pyproject.toml-based projects" Does anyone know what this might be? I have an M1 Pro Mac

I had similar after reinstalling my machine, I ended up deleting all rawpy and Libraw folders created during the previous build and running through the compiling from source process from the beginning (ensuring cmake was installed and callable from the terminal first

Thank you this worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants