ImportError: No module named OpenGL.GL - Stack Overflow

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

basically you need to install opengl but the library in python is called pyopengl not opengl you can ... Lessthan10daystoRSVP!Virtuallyjoinusatourinauguralconference,everyoneiswelcome. 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 ImportError:NomodulenamedOpenGL.GL AskQuestion Asked 10years,2monthsago Modified 2years,7monthsago Viewed 76ktimes 44 4 I'mtryingtorunNeHe'stutorialhereusingPython2.7.3,butIt'sthrowingtheerrorImportError:NomodulenamedOpenGL.GL SohowdoIfixthat?Thisisthecode: fromOpenGL.GLimport* pythonopengl Share Improvethisquestion Follow editedJun26,2012at20:55 genpfault 49.9k1010goldbadges8181silverbadges132132bronzebadges askedJun26,2012at20:23 CyanPrimeCyanPrime 4,8881212goldbadges5555silverbadges7777bronzebadges 1 7 Sillyquestion.DidyouinstallPyOpenGL?UsingOpenGLinPython – César Jun26,2012at20:25 Addacomment  |  6Answers 6 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) 40 DoyouhavePyOpenGLinstalledcorrectly?Ifyouarehavingn00bieissuesgettingnewmodulessetupcorrectly,Irecommendinstallingsetuptools.Onceyouhavesetuptoolsinstalled,youwillfindaprograminyourpython27/Scriptsdirectorycalled"easy_install"thatyoucanusetogetpackagesinstalledcorrectly. Forinstanceonmywindowssetup,Iuse: C:\Python27\scripts\easy_installpyopengl tosetupPyOpenGLonmysystem,andthenyourexamplecaseworksfine.IrememberwhenIstartedusingPythonIhadthesameissuestryingtogetaworkingPyOpenGLsetupcorrectlysoIcouldruntheNeHecode,andallofmyissueswentawaywhenIlearnedabouteasy_install OnLinux: sudoeasy_installpyopengl Aswellas: sudoapt-getinstallpythonpython-numpypython-openglpython-qt4python-qt4-gl Share Improvethisanswer Follow editedApr21,2014at21:30 DaveJarvis 29.9k3838goldbadges176176silverbadges306306bronzebadges answeredJun26,2012at20:34 K.BraffordK.Brafford 3,69922goldbadges2525silverbadges3030bronzebadges 2 7 withpip:/path/to/python-mpipinstallpyopengl – ThorSummoner Aug4,2014at7:47 WhatistheadvantageofusingSetupToolsoverjustaPIPInstall? – BruceSeymour Dec12,2021at15:17 Addacomment  |  20 basicallyyouneedtoinstallopenglbutthelibraryinpythoniscalledpyopenglnotopenglyoucanusethepipinstallcommandinsideanacondapromptwhichcanbedonebythefollowingcommand: pipinstallpyopengl Share Improvethisanswer Follow editedFeb15,2019at11:00 gehbiszumeis 3,30544goldbadges2626silverbadges3838bronzebadges answeredFeb15,2019at10:12 KarimSherifKarimSherif 35922silverbadges55bronzebadges Addacomment  |  10 anacondaisagreatpythonpackagemanager,ifyouhaveanaconda,just: condainstallpyopengl Share Improvethisanswer Follow answeredJun28,2016at8:32 dorbodwolfdorbodwolf 32222silverbadges1212bronzebadges Addacomment  |  6 Itmeansyoudon"thavethatmodule,, Installitbyusinganypythonpacketmanager. ForLINUX justexecuteeitheroneofthingsdownbelow Debianbased forpythonv3.x apt-getinstallpython3-opengl thisisforpythonv2.x apt-getinstallpython-opengl witheasy_install easy_installpyopengl withcondapakagemanager condainstallpyopengl bypythonitself python-mpipinstallpyopengl forWINDOWS: runtheeasy_installerincommandpromptlocatedinrootdirectoryofpython,whereuhaveinstalled ex:D:\Python36\scripts\easy_installpyopengl Forapplecomputer brewinstallpyopengl Share Improvethisanswer Follow editedNov21,2017at11:38 DenimDatta 3,71033goldbadges2626silverbadges5353bronzebadges answeredNov21,2017at11:29 ravishravish 6111silverbadge33bronzebadges Addacomment  |  0 IamusingopenSUSELinuxTumbleweedandhadthesameerror(yesIhaveinstalledpython3-opengl[viazypperpackagemanager]andPyOpenGL[viapip]). Solvedtheproblembyusingpython3explicitlytoruncommand,becauseitseemsthattheinstallationisdoneforthenewesversionofpython.Thenormalpythoncommandrunsolderpython2. Inshort: pythonopengl_test.py#DoesNOTwork python3opengl_test.py#Works Share Improvethisanswer Follow answeredJul6,2016at13:11 MasterOfDeathMasterOfDeath 7344bronzebadges Addacomment  |  -2 Edit:foundtheanswer: fromtheuppermenugotoFile>>Settings>>Project:projectname fromthereselectthesuitableinterpreterpath. Note:somehowbydefaultitwassetto"venv"folderpathwhichmyPyOpenGLisnotinstalled.throughthedropdown,Iselectedthe"python"folder. Share Improvethisanswer Follow editedFeb15,2020at0:26 answeredFeb13,2020at17:21 danmechadanmecha 111bronzebadge 1 Incasesomeonestumblesacrossthisandiswonderingwhyitgotdownvotes,thisiscurvingbestpracticesinsuggestingthatOPshouldnotbeusingavirtualenvironmentandinsteadbeusingtheirglobalenvironment,somethingthatisnotrecommendedinalmostallcaseswhenworkingwithPython.Whatthisrespondershouldhavedonewasinstallthecorrespondingpackagesintheirvirtualenvironmentfortheproject("venv"folderpath)andleavetheinterpreterpathas-is. – crock May25at17:24 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?Browseotherquestionstaggedpythonopengloraskyourownquestion. TheOverflowBlog IspenttwoyearstryingtodowhatBackstagedoesforfree Aserialentrepreneurfinallyembracesopensource(Ep.486) FeaturedonMeta PlannedmaintenancescheduledforWednesday,21September,00:30-03:00UTC... RecentColorContrastChangesandAccessibilityUpdates Revieweroverboard!Orarequesttoimprovetheonboardingguidancefornew... ShouldIexplainotherpeople'scode-onlyanswers? Visitchat Related 12253 Whatdoesthe"yield"keyworddo? 3416 HowdoIsortadictionarybyvalue? 962 Importingmodulesfromparentfolder 1663 ProperwaytodeclarecustomexceptionsinmodernPython? 1531 HowdoIgettimeofaPythonprogram'sexecution? 2109 WhyisreadinglinesfromstdinmuchslowerinC++thanPython? 1453 UnicodeEncodeError:'ascii'codeccan'tencodecharacteru'\xa0'inposition20:ordinalnotinrange(128) 1812 HowdoIsplitthedefinitionofalongstringovermultiplelines? 1434 Relativeimportsforthebillionthtime 2800 Whyis"1000000000000000inrange(1000000000000001)"sofastinPython3? HotNetworkQuestions WhywasJWSTcancelledin2011? 110.15High-LegMarking IsEPSGdefinedseparatelyforeachgeometrycolumn? Whyissendingtroopsdifferentfromsendingmilitaryequipment? IsitGoodPracticetoOnlyExposeInterfaces Coniferwithredfruit Whydoballoonsnolongerhavenets? Combiningalistwithacertainindexofalist WhichrunwayshouldIuseandhowcanIrecogniseitinfurtherflights? WhenpastinginTerminal.app,`00~`ispastedatthestartand`01~`attheend Rolejustbelowroot? Whydon'tcarshavecircuitbreakersinsteadoffuses? WhyaTLScertificatewithadomainnamemaskthatdoesn'tmatchsitepatterndoesn'ttriggerawarninginthebrowser UsingQGISFieldCalculatorondelimiterseparatedvalues WhyDidOldSovietCityBikesHaveLongerFramesinGeneral Notesnotaddinguptotimesignature,withweirdwhiteovalnote Bassnotesonthetreblescale(wavylines) IsitachievabletokeepallofHalacha? ForwhatVulpes-->Vulpecula,butSorexneverwillbeSoreculus Whatexactlyismeantbyisotropicandanisotropicwithwordvectors Ifhumanswerethesizeofantscouldwehavecampfires? HowlongaretheeventsofHalf-Life2in-universe? Howtoproperlyacknowledgeanoldfamousmathematicianinmyarticle? Whowerethetwolargehobbits? morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. lang-py Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?