ImportError: Library "GLU" not found - Stack Overflow

文章推薦指數: 80 %
投票人數:10人

For some reason executing python programs from the flatpak version fails to find the relevant OpenGL libraries (As mentioned here). Howarewedoing?PleasehelpusimproveStackOverflow.Takeourshortsurvey Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. LearnmoreaboutCollectives Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. LearnmoreaboutTeams Howarewedoing? Takeourshortsurvey ImportError:Library"GLU"notfound AskQuestion Asked 4years,4monthsago Modified 10monthsago Viewed 15ktimes 9 OnCentOS7.5system,runpython3andexecutethefollowingcode: importgym importtime env=gym.make('CartPole-v0') observation=env.reset() count=0 fortinrange(100): action=env.action_space.sample() observation,reward,done,info=env.step(action) ifdone: break env.render() count+=1 time.sleep(0.2) Reportthefollowingerrorafterexecutingtheabovecode: Traceback(mostrecentcalllast): File"",line6,in File"/root/gym/gym/core.py",line284,inrender returnself.env.render(mode) File"/root/gym/gym/envs/classic_control/cartpole.py",line106,inrender fromgym.envs.classic_controlimportrendering File"/root/gym/gym/envs/classic_control/rendering.py",line25,in reraise(prefix="Erroroccuredwhilerunning`frompyglet.glimport*`",suffix="HINT:makesureyouhaveOpenGLinstall.OnUbuntu,youcanrun'apt-getinstallpython-opengl'.Ifyou'rerunningonaserver,youmayneedavirtualframebuffer;somethinglikethisshouldwork:'xvfb-run-s\"-screen01400x900x24\"python'") File"/root/gym/gym/utils/reraise.py",line17,inreraise reraise_impl(e,traceback) File"/root/gym/gym/utils/reraise_impl_py3.py",line4,inreraise_impl raisee.with_traceback(traceback)fromNone File"/root/gym/gym/envs/classic_control/rendering.py",line23,in frompyglet.glimport* File"/root/anaconda3/envs/gymlab/lib/python3.6/site-packages/pyglet/gl/__init__.py",line100,in frompyglet.gl.libimportGLException File"/root/anaconda3/envs/gymlab/lib/python3.6/site-packages/pyglet/gl/lib.py",line143,in frompyglet.gl.lib_glximportlink_GL,link_GLU,link_GLX File"/root/anaconda3/envs/gymlab/lib/python3.6/site-packages/pyglet/gl/lib_glx.py",line51,in glu_lib=pyglet.lib.load_library('GLU') File"/root/anaconda3/envs/gymlab/lib/python3.6/site-packages/pyglet/lib.py",line158,inload_library raiseImportError('Library"%s"notfound.'%names[0]) gym.utils.reraise.ReraisedException:Erroroccuredwhilerunning`frompyglet.glimport*` Theoriginalexceptionwas: ImportError:Library"GLU"notfound. HINT:makesureyouhaveOpenGLinstall.OnUbuntu,youcanrun'apt-getinstallpython-opengl'.Ifyou'rerunningonaserver,youmayneedavirtualframebuffer;somethinglikethisshouldwork:'xvfb-run-s"-screen01400x900x24"python' Accordingtotheerrorprompt,afterinstallingOpenGL,therunningcodewillstillreportthesameerror.ThefollowingistheprocessofinstallingOpenGL: [root@devmaster~]#yum-yinstallpython-opengl Loadedplugins:fastestmirror,langpacks Loadingmirrorspeedsfromcachedhostfile *base:mirrors.aliyun.com *extras:mirrors.tuna.tsinghua.edu.cn *updates:ftp.iij.ad.jp PackagePyOpenGL-3.0.1-6.el7.noarchalreadyinstalledandlatestversion Nothingtodo [root@devmaster~]# python-3.x Share Improvethisquestion Follow editedMay21,2018at11:28 soetaertie 6477bronzebadges askedMay21,2018at10:28 JackonJackon 14322goldbadges22silverbadges55bronzebadges 6 Haveyouinstallfreegluttoo? – DanielRodríguez May21,2018at11:39 Ihaveinstalledfreeglut。

[root@devmastergym]#yum-yinstallfreeglutLoadedplugins:fastestmirror,langpacksLoadingmirrorspeedsfromcachedhostfile*base:mirrors.aliyun.com*extras:mirrors.tuna.tsinghua.edu.cn*updates:ftp.iij.ad.jpbase|3.6kB00:00:00code|2.9kB00:00:00extras|3.4kB00:00:00updates|3.4kB00:00:03Packagefreeglut-2.8.1-3.el7.x86_64alreadyinstalledandlatestversionNothingtodo[root@devmastergym]# – Jackon May21,2018at15:35 Installglutmeanssudoaptinstallfreeglut3-dev....GLandGLUlibs:aptinstalllibgl1-mesa-devlibglu1-mesa-dev – KnudLarsen May21,2018at16:41 Incentos6.5system,therearenofreeglut3-dev,libgl1-mesa-dev,libglu1-mesa-devpackages,whichareallinUbuntusystem. – Jackon May23,2018at3:06 IhaveaRHEL7.4(mostlyCentOS7.5)andIcanfindfreeglut-develpackages.IhavethoseinstalledandIcouldrunyourcode(itcrashsafteramoment,butit"works") – DanielRodríguez May24,2018at6:45  |  Show1morecomment 3Answers 3 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) 16 Forwhoeverstumblesonthisquestionthesolutionistoinstallfreeglut-develpackageforyourOSdistribution: #aptsystems-Ubuntu,Debian aptinstallfreeglut-devel #yum-Centos yum-yinstallfreeglut-devel Share Improvethisanswer Follow answeredOct19,2018at4:46 GranitosaurusGranitosaurus 19.5k44goldbadges5353silverbadges7676bronzebadges 3 18 OnUbuntu16.04:aptinstallfreeglut3-dev – Fons Nov30,2018at13:08 4 OnArch,Iinstalledtheglupackage,pacman-Sglu. – JacquesKvam Sep6,2020at20:57 1 Thanks@JacquesKvam---pacman-Sfreeglutdoesn'tseemtobeenough.Ineededglu. – SigmaX Oct16,2020at0:59 Addacomment  |  3 ForraspberrypizerowithLinuxDietPi4.19.97+#1294armv6lGNU/Linux: sudoapt-getinstallfreeglut3-dev Share Improvethisanswer Follow answeredFeb25,2020at17:39 DragosVasileDragosVasile 42344silverbadges1212bronzebadges Addacomment  |  1 Note:Tosomeonewhocomeswanderinginandcan'tfindasolutiononLinux.First,installthefollowing: sudoaptinstallfreeglut3-devfreeglut3libgl1-mesa-devlibglu1-mesa-devlibxext-devlibxt-dev sudoaptinstallpython3-opengllibgl1-mesa-glxlibglu1-mesa Secondly,ifyou'reusingPyCharmflatpakdon'tusethat.Downloaddirectlyfromthewebsite.ForsomereasonexecutingpythonprogramsfromtheflatpakversionfailstofindtherelevantOpenGLlibraries(Asmentionedhere) Share Improvethisanswer Follow answeredNov2,2021at18:08 RafayKhanRafayKhan 81899silverbadges2222bronzebadges Addacomment  |  YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggedpython-3.xoraskyourownquestion. TheOverflowBlog IspenttwoyearstryingtodowhatBackstagedoesforfree Aserialentrepreneurfinallyembracesopensource(Ep.486) FeaturedonMeta PlannedmaintenancescheduledforWednesday,21September,00:30-03:00UTC... RecentColorContrastChangesandAccessibilityUpdates Revieweroverboard!Orarequesttoimprovetheonboardingguidancefornew... ShouldIexplainotherpeople'scode-onlyanswers? Visitchat Linked 0 PygletfailstoloadGLUlibrary Related 0 TensorflowObjectDetectionAPI/ImportError:cannotimportname'keypoint_box_coder_pb2' 0 ImportErrorfromMatplotlibv.2.2.2underAnaconda5.1MacOSXSierra 1 Inthecentos6.5systemdeploymentgymenvironmenterror 0 ImportError:DLLloadfailed:Adynamiclinklibrary(DLL)initializationroutinefailed.(importingtensorflowerror) 1 ModuleNotFoundError:Nomodulenamed'pixelengine'inpython 2 ImportError:cannotimportname'device_spec'from'tensorflow.python.framework' 0 Tensorflow1.14.0errorinimportingthemodule HotNetworkQuestions TipsonwheretobuyclothesforcoldweatherinLille,France? Isitokaythatpartofthepowerjackisoutsidethedevice? EachhaveorHaveeach Somethingappearsvaluableorpreciousbutitisn't,symbolicallyequivalenttoPyrite? Howtopreventhumansfrombeingkilledbyaliendiseases? addatwo-linetextinsideacomponentincircuitikz HowwouldtheUSmilitaryefficientlydealwithNecromorph-likezombies? CanyoutraveltoIrelandwithanUK+SchengenVisa(ifyouareIndianandaretravellingfromAustria)? AsaPhDstudentintheoreticalphysics,whatfractionofmytime(ifany)shouldIspendonbackgroundmaterialratherthanmyresearchproblem? WhyaTLScertificatewithadomainnamemaskthatdoesn'tmatchsitepatterndoesn'ttriggerawarninginthebrowser WhyDidOldSovietCityBikesHaveLongerFramesinGeneral Jonah2:1-2-whysay"Sheol"torefertotheliteralbellyofaliteralfish? Whyisthe-eoptionnotinthebashcommandmanual? OBBtrainnoreservationseats Principlestoresolveambiguityinacontract Howtoliterallytranslatethe由人类艺术家挥笔in志愿者普遍更喜欢的作品都是由人类艺术家挥笔完成的? Ifhumanswerethesizeofantscouldwehavecampfires? IsitpossibletoidentifyUTXOssignedbyHDwallets? Whatisatuneorsongcalledthatisrecurrentlyusedsopeoplestarttoassociatethetuneorsongwiththatwhatitisusedwith? WhenpastinginTerminal.app,`00~`ispastedatthestartand`01~`attheend Advantagesofalawlicenseotherthantheabilitytopracticelaw Sci-fihorrorshortstoryaboutalienthatwantstobeeaten SciencefictionshortstoryinwhichEinsteinisclonedbutshowsnointerestinmuchexceptplayinghisviolin Howtochangerowwidth? morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. lang-py Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?