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

ModuleNotFoundError: No module named 'skbuild' #7

Open
timo-a opened this issue Aug 22, 2020 · 5 comments
Open

ModuleNotFoundError: No module named 'skbuild' #7

timo-a opened this issue Aug 22, 2020 · 5 comments

Comments

@timo-a
Copy link

timo-a commented Aug 22, 2020

When I run

git clone https://github.com/iandow/opencv_aws_lambda
cd opencv_aws_lambda
docker build --tag=lambda-layer-factory:latest .

I get

....
Step 15/23 : RUN pip3.7 install -r /packages/requirements.txt -t /packages/opencv-python-3.7/python/lib/python3.7/site-packages
 ---> Running in afb13501cbed
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3.7 install --user` instead.
Collecting opencv-python (from -r /packages/requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/77/f5/49f034f8d109efcf9b7e98fbc051878b83b2f02a1c73f92bbd37f317288e/opencv-python-4.4.0.42.tar.gz (88.9MB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-vw_fikpx/opencv-python/setup.py", line 9, in <module>
        import skbuild
    ModuleNotFoundError: No module named 'skbuild'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vw_fikpx/opencv-python/
The command '/bin/sh -c pip3.7 install -r /packages/requirements.txt -t /packages/opencv-python-3.7/python/lib/python3.7/site-packages' returned a non-zero code: 1
@mhkey
Copy link

mhkey commented Sep 22, 2020

Needs a line to upgrade pip version

According to: https://pypi.org/project/opencv-python/

RUN pip3.7 install --upgrade pip
RUN pip3.8 install --upgrade pip

@adriantang
Copy link

@timo-a Can I know how you solve this problem???

@dioh
Copy link

dioh commented Oct 30, 2020

Using the pip upgrade would fix this error but using python-opencv requires to install libGL in the latest version. I will open a new ticket with this.

@amirhmk
Copy link

amirhmk commented Dec 1, 2020

Has anyone been able to fix this error?
As @dioh mentioned, libGL is required in the newer version, which is missing in the Amazon linux 2 filesystem used in Lambda. I tried using the original version of opencv-python closest to the date this repo was last updated (3.4.8.29) but I still got the

"Unable to import module 'lambda_function': libgthread-2.0.so.0: cannot open shared object file: No such file or directory"

Any ideas what to do? I'm only sticking to the 3.8 version but I doubt that has any impact on this

EDIT:

It actually seems like this is an issue for python 3.8, python 3.7 seems to work just fine. This is probably because of the fact that 3.8 runtimes uses the amazon linux 2 image compared to lamazon linux for 3.7 and below...

@amirhmk
Copy link

amirhmk commented Dec 3, 2020

Using this package on Serverless helped me streamline this whole process and reduce the package size as well. Would definitely recommend checking it out. Make sure to leave the strip flag to false

Serverless python-requirements plugin

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

5 participants