在 Linux 上安装 AssimpCy

Installing AssimpCy on Linux

我正在关注 this guide 但是当我 运行 命令时:

pip3 install numpy Pillow PyOpenGL PyOpenGL-accelerate glfw

命令失败并出现错误:

ERROR: Complete output from command python setup.py egg_info:
ERROR: running egg_info
creating pip-egg-info/AssimpCy.egg-info
writing pip-egg-info/AssimpCy.egg-info/PKG-INFO
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-ppb19bgv/AssimpCy/setup.py", line 88, in <module>
    requires=['numpy']
  File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 289, in run
    writer(self, ep.name, os.path.join(self.egg_info, ep.name))
  File "/usr/lib/python3.7/site-packages/setuptools/command/egg_info.py", line 621, in write_pkg_info
    metadata.write_pkg_info(cmd.egg_info)
  File "/usr/lib64/python3.7/distutils/dist.py", line 1117, in write_pkg_info
    self.write_pkg_file(pkg_info)
  File "/usr/lib/python3.7/site-packages/setuptools/dist.py", line 166, in write_pkg_file
    long_desc = rfc822_escape(self.get_long_description())
  File "/usr/lib64/python3.7/distutils/util.py", line 464, in rfc822_escape
    lines = header.split('\n')
TypeError: a bytes-like object is required, not 'str'
----------------------------------------

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ppb19bgv/AssimpCy/

编辑: 现在一切都已安装,但是当我 运行

>>> import glfw

我得到:

ModuleNotFoundError: No module named 'glfw'

据我所知,glfw 已安装。

尝试使用包管理器安装包,在您的情况下:

sudo dnf install "glfw-*" python3-pyopengl

然后

python3 -m pip install assimpcy --user

如果您在使用 Python 3 时遇到问题,您也可以尝试使用 Python 2,如下所示:

sudo dnf install python-pyopengl
python -m pip install assimpcy --user

之后,使用 python(如果它绑定到您的 Python 2 安装)并重试。但不要忘记 Python 2 is eol