简体   繁体   English

无法导入健身房和宇宙(来自OpenAI)

[英]Trouble importing gym and universe (from OpenAI)

I installed two packages, gym and universe , but can't import them into my IDE (LiClipse) and I'm not totally sure why. 我安装了两个包, 健身房宇宙 ,但无法将它们导入我的IDE(LiClipse),我不完全确定原因。 When installed, both were added to the root directory, so I moved them into the same folder as my project file, which includes the python file I'm working in. However, that didn't help at all. 安装后,两者都被添加到根目录,所以我将它们移动到与我的项目文件相同的文件夹中,其中包括我正在使用的python文件。但是,这根本没有帮助。

I'm guessing I need to move the folders to the same place all my other python modules/ directories, but when I'm not sure how to access that folder. 我猜我需要将文件夹移动到我所有其他python模块/目录的相同位置,但是当我不确定如何访问该文件夹时。 When I go to see where numpy is installed I get: 当我去看看numpy安装在哪里时,我得到:

['/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy'] [ '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy']

When I follow that path in terminal, I get to library, but then can't navigate to Frameworks as it apparently doesn't exist. 当我在终端中遵循该路径时,我进入了库,但随后无法导航到Frameworks,因为它显然不存在。

Am I on the right track here or should I do something else? 我在这里是正确的轨道还是我应该做些什么?

why do you need to move the gym and universe folders to any other folder? 为什么你需要将健身房和宇宙文件夹移动到任何其他文件夹? Assuming that you have installed them the way explained in the openai docs . 假设您已按照openai文档中的说明安装它们。 , these will go directly into places where your python interpreter will be able to find out them automatically. ,这些将直接进入你的python解释器将能够自动找到它们的地方。 So unless I am missing out on some other subtleties of your requirements, I would say just install them correctly, import them into your python program and start using them just like you do with your numpy. 因此,除非我错过了你的要求的其他微妙之处,我会说只需正确安装它们,将它们导入你的python程序并开始使用它们就像你的numpy一样。

Gym and Universe were being saved as their own folders, and my IDE wasn't checking the location they were saved in for modules to use. Gym和Universe被保存为他们自己的文件夹,我的IDE没有检查他们保存的位置以供模块使用。 To fix I 解决我

A) found the location in which Gym and Universe were being saved using the terminal A)找到使用终端保存Gym和Universe的位置

B) Moved them to the folders my IDE checks for modules. B)将它们移动到我的IDE检查模块的文件夹中。 You can find the folders your IDE checks within the settings of your IDE. 您可以在IDE的设置中找到IDE检查的文件夹。

When you download modules they usually all save to the same or similar folders that your IDE automatically checks. 下载模块时,它们通常都会保存到IDE自动检查的相同或类似文件夹中。 Mine were saved to a different folder in this particular instance. 在此特定实例中,我被保存到不同的文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM