首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在ubuntu 14.04上安装无头渲染的Pyrender?

如何在ubuntu 14.04上安装无头渲染的Pyrender?
EN

Stack Overflow用户
提问于 2019-07-16 05:12:51
回答 1查看 620关注 0票数 0

我想在Ubuntu 14.04上安装带有headless rendering的Pyrender。具体来说,我希望将其安装在Dockerfile中。如何才能正确安装OSMesa (以及其他所有内容)?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-07-16 05:12:51

下面是我的Dockerfile (Ubuntu 14.04,python 3.6)中的几行代码。它主要涉及遵循installation guide,以及一些额外的东西,以确保deps正确安装(llvm-6.0是最棘手的事情)。

如果你不想在Docker中运行,你基本上可以从命令行(按顺序)运行这些东西。

代码语言:javascript
复制
# Install pyrender
RUN pip3 install pyrender

# Copy and rename an apt lib file so that apt-add-repository 
# works (cleaner way would be to symlink it but Dockerfiles don't seem
# to like symlinks). Might be due to some screwy python3.6/3.4 conflicts 
# on my Docker image
RUN cp /usr/lib/python3/dist-packages/apt_pkg.cpython-34m-x86_64-linux-gnu.so /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so

# Add new apt repositories and then apt-add some OSMesa deps
RUN add-apt-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main"
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install --yes llvm-6.0 freeglut3 freeglut3-dev pkg-config

# Download OSMesa, then build and install it
RUN curl -o mesa-18.3.3.tar.gz ftp://ftp.freedesktop.org/pub/mesa/mesa-18.3.3.tar.gz
RUN tar xfv mesa-18.3.3.tar.gz
WORKDIR ./mesa-18.3.3
RUN ./configure --prefix=/usr/local                           \
            --enable-opengl --disable-gles1 --disable-gles2   \
            --disable-va --disable-xvmc --disable-vdpau       \
            --enable-shared-glapi                             \
            --disable-texture-float                           \
            --enable-gallium-llvm --enable-llvm-shared-libs   \
            --with-gallium-drivers=swrast,swr                 \
            --disable-dri --with-dri-drivers=                 \
            --disable-egl --with-egl-platforms= --disable-gbm \
            --disable-glx                                     \
            --disable-osmesa --enable-gallium-osmesa          \
            ac_cv_path_LLVM_CONFIG=llvm-config-6.0
RUN make -j8
RUN make install

# Add some new environment variables so the OSMesa libs can be found
ENV MESA_HOME /usr/local
ENV LIBRARY_PATH $LIBRARY_PATH:$MESA_HOME/lib
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$MESA_HOME/lib
ENV C_INCLUDE_PATH $C_INCLUDE_PATH:$MESA_HOME/include/
ENV CPLUS_INCLUDE_PATH $CPLUS_INCLUDE_PATH:$MESA_HOME/include/

# Get rid of the crappy old version of pyopengl, install a sweet new one
RUN pip3 uninstall -y pyopengl
RUN pip3 install git+https://github.com/mmatl/pyopengl.git
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57047269

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档