Skip to content

Installation fail? #1

Closed
Closed

Description

@rizwanishaq

Hi,
I am trying to install nvcodec-python using pip3 install pynvcodec
but getting follow error

ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-brzhijz7
       cwd: /tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/
  Complete output (18 lines):
  running bdist_wheel
  running build
  running build_ext
  mkdir -p build/tests
  mkdir -p build/lib
  nvcc -DCUDNN  --compiler-options "-fPIC -lstdc++ -pthread -lm" -c src/cuvid/Utils/ColorSpace.cu -o build/lib/libcolor_space.a
  building 'nvcodec' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/src
  creating build/temp.linux-x86_64-3.6/src/cuvid
  creating build/temp.linux-x86_64-3.6/src/cuvid/NvDecoder
  creating build/temp.linux-x86_64-3.6/src/cuvid/NvEncoder
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc -Isrc/cuvid -I/usr/local/cuda/include -I/usr/include/python3.6m -c nvcodec-python.cpp -o build/temp.linux-x86_64-3.6/nvcodec-python.o
  nvcodec-python.cpp:9:10: fatal error: numpy/arrayobject.h: No existe el archivo o el directorio
   #include <numpy/arrayobject.h>
            ^~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pynvcodec
  Running setup.py clean for pynvcodec
Failed to build pynvcodec
Installing collected packages: pynvcodec
    Running setup.py install for pynvcodec ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xzsy4hlb/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/pynvcodec
         cwd: /tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/
    Complete output (18 lines):
    running install
    running build
    running build_ext
    mkdir -p build/tests
    mkdir -p build/lib
    nvcc -DCUDNN  --compiler-options "-fPIC -lstdc++ -pthread -lm" -c src/cuvid/Utils/ColorSpace.cu -o build/lib/libcolor_space.a
    building 'nvcodec' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    creating build/temp.linux-x86_64-3.6/src/cuvid
    creating build/temp.linux-x86_64-3.6/src/cuvid/NvDecoder
    creating build/temp.linux-x86_64-3.6/src/cuvid/NvEncoder
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc -Isrc/cuvid -I/usr/local/cuda/include -I/usr/include/python3.6m -c nvcodec-python.cpp -o build/temp.linux-x86_64-3.6/nvcodec-python.o
    nvcodec-python.cpp:9:10: fatal error: numpy/arrayobject.h: No existe el archivo o el directorio
     #include <numpy/arrayobject.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xzsy4hlb/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/pynvcodec Check the logs for full command output.

I am using Ubuntu 18.04, with python 3.6 and cuda version of 11.1, with Tesla V4 GPUs.

Activity

  1. zeng-qinghui commented on Apr 18, 2021

    @zeng-qinghui
    Contributor

    The build needs "numpy/arrayobject.h".
    I added include_dir of numpy to setup.py in version 0.0.6. Could you try again?

  2. pinned this issue on Apr 18, 2021
  3. rizwanishaq commented on Apr 19, 2021

    @rizwanishaq
    Author

    now, when I did the test, I am getting Segment violation (generated core).

  4. zeng-qinghui commented on Apr 20, 2021

    @zeng-qinghui
    Contributor

    now, when I did the test, I am getting Segment violation (generated core).

    Can you show me your test code ?

  5. rizwanishaq commented on Apr 20, 2021

    @rizwanishaq
    Author
    
    from nvcodec import VideoSource, VideoDecoder, VideoEncoder
    
    import numpy as np
    import cv2
     
    
    if __name__=="__main__":
        video_stream = cv2.VideoCapture("00021.mp4")
        encFile = open("test.h264", "wb")
        encoder = VideoEncoder(width=224, height=224)
    
        while True:
            success, frame = video_stream.read()
            if not success:
                break
            frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
    
            packets = encoder.encode(frame)
            print(packets)
            
            encFile.write(packet)
        
        
        
        encFile.close()
        
    
    
  6. zeng-qinghui commented on May 24, 2021

    @zeng-qinghui
    Contributor

    Installation with mistake in test code.

    encoder = VideoEncoder(width=224, height=224)

    should be

    encoder = VideoEncoder(224, 224)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions