Try this, as per this thread. You will get an error gym 0.17.3 anycodings_python requires pyglet<=1.5.0,>=1.4.0, anycodings_python but ...
ANYCODINGS.COM
☰
Home
Categories
HTML
Javascript
CSS
ReactJs
AboutUs
ContactUs
PrivacyPolicy
Terms&Conditions
☼
☾
GettinganerrorwhileexecutingmypythonfilewhichusesgymlibraryforreinforcementlearningQuestions:Gettinganerrorwhileexecutingmypythonfilewhichusesgymlibraryforreinforcementlearning2022-09-19T01:37:22+00:002022-09-19T01:37:22+00:00823
Mypythonprogram:
importgym
env=gym.make('CartPole-v0')
env.reset()
for_inrange(1000):
env.render()
env.step(env.action_space.sample())#takearandomaction
env.close()
ErrorthatIamseeing:
(base)Meets-MacBook-Pro:Documentsmeetpandya$pythongym-test.py
Traceback(mostrecentcalllast):
File"/opt/anaconda3/lib/python3.8/site-packages/gym/envs/classic_control/rendering.py",line25,in
frompyglet.glimport*
File"/opt/anaconda3/lib/python3.8/site-packages/pyglet/gl/__init__.py",line95,in
frompyglet.gl.libimportGLException
File"/opt/anaconda3/lib/python3.8/site-packages/pyglet/gl/lib.py",line147,in
frompyglet.gl.lib_aglimportlink_GL,link_GLU,link_AGL
File"/opt/anaconda3/lib/python3.8/site-packages/pyglet/gl/lib_agl.py",line43,in
gl_lib=pyglet.lib.load_library(framework='/System/Library/Frameworks/OpenGL.framework')
File"/opt/anaconda3/lib/python3.8/site-packages/pyglet/lib.py",line124,inload_library
returnself.load_framework(kwargs['framework'])
File"/opt/anaconda3/lib/python3.8/site-packages/pyglet/lib.py",line279,inload_framework
raiseImportError("Can'tfindframework%s."%path)
ImportError:Can'tfindframework/System/Library/Frameworks/OpenGL.framework.
Duringhandlingoftheaboveexception,anotherexceptionoccurred:
Traceback(mostrecentcalllast):
File"gym-test.py",line5,in
env.render()
File"/opt/anaconda3/lib/python3.8/site-packages/gym/core.py",line240,inrender
returnself.env.render(mode,**kwargs)
File"/opt/anaconda3/lib/python3.8/site-packages/gym/envs/classic_control/cartpole.py",line174,inrender
fromgym.envs.classic_controlimportrendering
File"/opt/anaconda3/lib/python3.8/site-packages/gym/envs/classic_control/rendering.py",line27,in
raiseImportError('''
ImportError:
Erroroccurredwhilerunning`frompyglet.glimport*`
HINT:makesureyouhaveOpenGLinstall.OnUbuntu,youcanrun'apt-getinstallpython-opengl'.
Ifyou'rerunningonaserver,youmayneedavirtualframebuffer;somethinglikethisshouldwork:
'xvfb-run-s"-screen01400x900x24"python'
Ihaveinstalledgymlibrarysuccessfullyonanycodings_pythonmylaptop.Idonotunderstandthemeaninganycodings_pythonof'findframeworkanycodings_python/System/Library/Frameworks/OpenGL.framework.'.
Admins
PYTHONOPENAI-GYMTotalAnswers1
29
Answers1:ofGettinganerrorwhileexecutingmypythonfilewhichusesgymlibraryforreinforcementlearning
Trythis,asperthisthread.
Youwillgetanerrorgym0.17.3anycodings_openai-gymrequirespyglet<=1.5.0,>=1.4.0,anycodings_openai-gymbutyou'llhavepyglet1.5.11whichisanycodings_openai-gymincompatiblebutthecodeshouldworkanycodings_openai-gymnow.
pipinstallpyglet==1.5.11
Edit:
Thisshouldworknow
pipinstall--user--upgradegit+http://github.com/pyglet/[email protected]
0
2022-09-19T01:37:22+00:002022-09-19T01:37:22+00:00AnswerLink
mRahman
Topratedtopics
CansomeonehelpmeunderstandthecorrectwaytouseaDo/Loop-ThisisforaschoolprojectHowtosolvethefollowingproblemonMATLABAppendingtoatextfilefromawhileloop
LinkedInRESTAPIAuthenticationUnauthorizederrorwhenusingJWTinGiraffe,F#CreateuniquenamefromarrayofnamesinNodeJSHowtopop2screenatonceinflutter
WhyTensorflow-gpuonlygivestheobjectpredictiononceWhydoesxhaveanunexpectedvalueaftertryingtoinitializeitwithx,y=a,b?HowtohandleinvalidrequestorinvalidurlinapigetwayDeletefileswithspecificextensionlocatedasalistinatextfilePHP/ConnecttobackendfailedwithCONNECTION_RESETonsendingrequestHowtogetalistofcelerytasksthatarequeuedbutnotyetstartedNowaytogetuploadedimagesfromSpreadsheetviaAPI?HowtoprintSpecificPartofStringinDart?AuthenticationerrorinthebackendloginofTYPO3v10.4KendoUIdoubleheaderandfilterCallingamethodinmultiplethreadsHowtoreadfromfileinc++andinsertdatafromfileintovectorthatsistypeofanclass?PythonassociationrulesbetweentwotypesofdataWhatiswrongwiththisNestedIfsyntax?Herokulogs--tailerror:sh:1:nodemon:notfoundNewDjangoprojectadminurlsaresomehowbeingoverriddenbypriorprojectDjango-AllauthsettingsHowcanIconnect2classeswiththeirScannervariablesinJava?IwanttoknowWhetheruserratedmyappalreadyornotinflutter?Howtoboldasinglewordinastringoftextinmatplotlib?Appcmdcannotaddduplicatecollectionentryoftype'add'withuniquekeyattribute'fileextension'setto'.txt'HowcanIrestoreagitclonetowhatitwasthesecondtothelasttimeitpushedtoOM?HowtopermitcodetorunfromotherdomainsXamarinconnecttobluetoothble.TheapplicationmaybedoingtoomuchworkonitsmainthreadHowtofindthesumfromvalueofsqlcolumnIsthereawaytodothesesetsofstepsquicker-lessstepsandhowcanIre-organiseastringoflistsbasedonthestringvalue?HowwouldIrunascriptwherethe.exerunsinonelocationandthescriptinanotherlocation?WhydoesJavaMessageDigestusethetermupdateinsteadofadd?HowtogeneratemultiplefilepathsandsavethemintoaexcelwithpythonAddnewcolumnindataframewithvlookupvaluesWhyamIgettingnoreversematcherrorindjango3.2?HowcanuseCollections.sort()infragmentandadpater?PointersonprogrammaticallyrecordingiOSscreen/audioWordPressElementorPromakenavmenuwidgetitemsdropdownonlyPhp-arrayelementeditCan'tbringlistofobjectsintoafor_eachCreaterecurrencewithiCal4jconsideringdaylightsavingtimeCorrectwebsocketconnectionclosureGradlecustomtasktypedefinedinbuildSrcnotaccessibleinsubprojectsformulti-projectstructureConditionalformattinghighlightinglastrepeatedproductinamonthingooglesheetXmlSerializer'CompilingJScript/CSharpscriptsisnotsupported'CreatingmultipletablesHowtoexecuteablockofcodeonlyonceonamultithreadingenvironment?Exceptionorg.openqa.selenium.json.JsonException:Unabletodeterminetypefrom:E.Last1charactersread:erroronlyinJenkinsruns
Top
©2022
ANYCODINGS.COM-AllRightsReserved.
AboutUs
ContactUs
DMCA
PrivacyPolicy
Disclaimer
Terms&Conditions