Я пытаюсь запустить makefile для определенного проекта, но я получил много ошибок во время make run, даже когда все было успешно при запуске make init. В настоящее время я запускаю этот make-файл в среде conda
. Я даже проверил файл с ошибкой и запустил его напрямую, используя python blablabla.py, и он прекрасно работает, но когда я запускаю make-файл, он отображается как ошибка натот же файл
all: build
init:
@which python3 > /dev/null 2>&1 || (echo "python3 is not installed on this system" && exit 1)
@which pip3 > /dev/null 2>&1 || (echo "pip3 is not installed on this system" && exit 1)
@echo "Installing requirements with pip3..."
@while read package; \
do \
line="$$package"; \
[[ "$$line" == git+* ]] && \
line=`echo "$$line" | sed -e 's/git.*\///g' -e 's/.git$$//g'`; \
pip3 freeze 2>/dev/null | grep -P `echo "$$line" | sed 's/>=/.*/g'` > /dev/null 2>&1 || \
pip3 install --user "$$package"; \
done < requirements.txt
build: init build-lang
@echo "Building python package..."
@mypy --package color_harmonization
@echo "#! /bin/bash" > color-harmonization
@echo "/usr/bin/env python3 -m color_harmonization" >> color-harmonization
@chmod +x color-harmonization
run: build
@echo "Running application..."
@./color-harmonization
lang:
@echo "Generating internationalization files..."
@mkdir -p color_harmonization/gui/locale/de_DE/LC_MESSAGES
@intltool-extract --type=gettext/glade color_harmonization/gui/color-harmonization.glade
@xgettext --from-code=UTF-8 --language=Python --keyword=_ --keyword=N_ \
--output=color_harmonization/gui/locale/locale.pot \
`find . -name "*.py" -type f` \
color_harmonization/gui/color-harmonization.glade.h
@msginit --input=color_harmonization/gui/locale/locale.pot \
--locale=de_DE.UTF-8 --output-file=color_harmonization/gui/locale/de_DE/LC_MESSAGES/de_DE.po
build-lang:
@echo "Compiling internationalization files..."
@msgfmt --output color_harmonization/gui/locale/de_DE/LC_MESSAGES/color_harmonization.mo \
color_harmonization/gui/locale/de_DE/LC_MESSAGES/de_DE.po
Это ошибка при сборке make-файла
Compiling internationalization files...
Building python package...
color_harmonization/gui/gl_widget.py:21: error: No library stub file for module 'gi.repository'
color_harmonization/gui/gl_widget.py:22: error: Cannot find implementation or library stub for module named 'OpenGL'
color_harmonization/gui/__init__.py:19: error: Name 'List' is not defined
color_harmonization/gui/__init__.py:19: note: Did you forget to import it from "typing"? (Suggestion: "from typing import List")
color_harmonization/__init__.py:19: error: Name 'List' is not defined
color_harmonization/__init__.py:19: note: Did you forget to import it from "typing"? (Suggestion: "from typing import List")
color_harmonization/handler.py:20: error: No library stub file for module 'gi.repository'
color_harmonization/gui/hue_sat_wheel_widget.py:20: error: No library stub file for module 'numpy'
color_harmonization/gui/hue_sat_wheel_widget.py:22: error: Cannot find implementation or library stub for module named 'cairocffi'
color_harmonization/gui/hue_sat_wheel_widget.py:25: error: No library stub file for module 'gi.repository'
color_harmonization/gui/gl_quad_renderer.py:19: error: No library stub file for module 'numpy'
color_harmonization/gui/gl_quad_renderer.py:23: error: Cannot find implementation or library stub for module named 'OpenGL'
color_harmonization/gui/gl_quad_renderer.py:24: error: Cannot find implementation or library stub for module named 'pyrr'
color_harmonization/gui/gl_quad_renderer.py:25: error: No library stub file for module 'PIL'
color_harmonization/gui/gl_image.py:19: error: No library stub file for module 'gi.repository'
color_harmonization/gui/assistant.py:24: error: No library stub file for module 'gi.repository'
color_harmonization/gui/assistant.py:24: note: (Stub files are from https://github.com/python/typeshed)
color_harmonization/gui/assistant.py:39: error: Module has no attribute "bindtextdomain"
color_harmonization/gui/assistant.py:104: error: Incompatible types in assignment (expression has type "None", variable has type "List[str]")
color_harmonization/gui/assistant.py:105: error: Incompatible types in assignment (expression has type "None", variable has type "str")
color_harmonization/__main__.py:22: error: Cannot find implementation or library stub for module named 'gi'
color_harmonization/__main__.py:22: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 18 errors in 9 files (checked 12 source files)
Makefile:33: recipe for target 'build' failed
make: *** [build] Error 1
Это один из файлов Python, так как его много, я публикую только первый файл Python наошибка
import abc
from gi.repository import Gtk, Gdk
from OpenGL import GL
class GLRenderer (metaclass = abc.ABCMeta):
@property
def gl_widget (self: 'GLRenderer') -> 'GLWidget':
return self.__gl_widget
@gl_widget.setter
def gl_widget (self: 'GLRenderer', value: 'GLWidget') -> None:
self.__gl_widget = value
def make_current (self: 'GLRenderer') -> None:
self.gl_widget.make_current ()
@abc.abstractmethod
def load (self: 'GLRenderer') -> None:
pass
@abc.abstractmethod
def update (self: 'GLRenderer') -> None:
pass
@abc.abstractmethod
def resize (self: 'GLRenderer', width: int, height: int) -> None:
GL.glViewport (0, 0, width, height)
@abc.abstractmethod
def render (self: 'GLRenderer') -> None:
GL.glClear (GL.GL_COLOR_BUFFER_BIT)
GL.glClearColor (0, 0, 0, 0)
class GLWidget (Gtk.Overlay):
def __init__ (self: 'GLWidget', renderer: GLRenderer,
gl_major_version: int, gl_minor_version: int) -> None:
super ().__init__ ()
self.renderer = renderer
self.renderer.gl_widget = self
self.gl_area = Gtk.GLArea ()
self.gl_area.set_required_version (gl_major_version, gl_minor_version)
self.gl_area.props.has_alpha = True
self.gl_area.props.has_depth_buffer = False
self.gl_area.props.auto_render = True
self.gl_area.connect ('render', self.__handle_render)
self.gl_area.connect ('realize', self.__handle_realize)
self.gl_area.connect ('resize', self.__handle_resize)
self.add_overlay (self.gl_area)
self.props.expand = True
self.__width = 400
self.__height = 300
def __handle_render (self: 'GLWidget', gl_area: Gtk.GLArea, context: Gdk.GLContext) -> None:
self.renderer.render ()
def __handle_realize (self: 'GLWidget', gl_area: Gtk.GLArea) -> None:
self.renderer.load ()
def __handle_resize (self: 'GLWidget', gl_area: Gtk.GLArea, width: int, height: int) -> None:
self.__width = width
self.__height = height
self.renderer.resize (width, height)
@property
def width (self: 'GLWidget') -> int:
return self.__width
@property
def height (self: 'GLWidget') -> int:
return self.__height
def make_current (self: 'GLWidget') -> None:
self.gl_area.make_current ()
Пожалуйста, проверьте эту ссылку на github для полного исходного кода. Буду признателен за любые предложения и помощь, спасибо