如何解决Python软件包需要freeglut作为依赖项
我正在创建一个Python包,我想使用freeglut。有什么办法可以使我在安装软件包时为我找到一个freeglut软件包并进行安装?我知道,如果仅从pip安装PyOpenGL,则不能使用freeglut,但如果使用https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopengl中的软件包,则可以使用。不过,这仅适用于Windows。我还尝试将上面的链接添加为依赖项,方法是将其上传到github,然后添加pyopengl @ git+https://raw.githubusercontent.com/rayzchen/PyUnity/master/PyOpenGL-3.1.5-cp38-cp38-win32.whl
作为依赖项,但出现错误TypeError: stat: path should be string,bytes,os.PathLike or integer,not NoneType
。我也尝试在安装程序中使用dependency_links
,但是没有运气。这是我的setup.py:
from setuptools import setup,find_packages
import os
pyopengl_link = "pyopengl @ git+https://raw.githubusercontent.com/rayzchen/PyUnity/master/PyOpenGL-3.1.5-cp38-cp38-win32.whl"
pyopengl_accelerate_link = "pyopengl-accelerate @ git+https://raw.githubusercontent.com/rayzchen/PyUnity/master/PyOpenGL_accelerate-3.1.5-cp38-cp38-win32.whl"
if os.name == "nt":
links = [pyopengl_link,pyopengl_accelerate_link]
else:
links = []
print(links)
with open("README.md","r") as fh:
long_description = fh.read()
setup(
name = "pyunity",version = "0.0.1",author = "Ray Chen",author_email = "tankimarshal2@gmail.com",description = "A Python implementation of the Unity Engine",long_description = long_description,long_description_content_type = "text/markdown",url = "https://github/rayzchen/PyUnity",packages = find_packages(),classifiers = [
"Programming Language :: Python :: 3.7","License :: OSI Approved :: MIT License","Operating System :: Microsoft :: Windows :: Windows 10",],dependency_links = links,install_requires = [
"glfw","pygame",*links,python_requires = '>=3.7',)
这只是为了好玩,所以请不要批评我尝试在Python中实现Unity。
解决方法
我发现的一种方法是将pyopengl @ https://github.com/rayzchen/pyunity/blob/master/PyOpenGL-3.1.5-cp38-cp38-win32.whl
而不是pyopengl @ git+https://github.com/rayzchen/pyunity/blob/master/PyOpenGL-3.1.5-cp38-cp38-win32.whl
用作解决方案。我认为git+
将克隆存储库,然后构建程序包。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。