2017-09-24 131 views
1

我想要打开ai健身房的工作,但我面临着一个非常持久的错误。当我运行我的程序时(只是简单的演示卡车解算器)我得到这个错误。 (文件“gperm.py”是cartpole解算器)运行健身房时,健康检查返回numpy的属性错误__version__

File "gperm.py", line 1, in <module> 
import gym 
File "/Users/sonyaferraro/Desktop/dpy/gym/__init__.py", line 48, in <module> 
sanity_check_dependencies() 
File "/Users/sonyaferraro/Desktop/dpy/gym/__init__.py", line 20, in sanity_check_dependencies 
if distutils.version.LooseVersion(numpy.__version__) < distutils.version.LooseVersion('1.10.4'): 

最后打印:

AttributeError: module 'numpy' has no attribute '__version__' 

这很奇怪,因为我做了全面的PIP安装numpy的,甚至试图与git克隆它既没有工作。我已经检查过,以确保我没有其他名为numpy的文件,并且一切似乎都在检查中。

如果其他人有这个相同的问题或任何人有一个解决方案,将不胜感激。

它还打印出一个“提示”,提示我尝试:pip install -U numpy。

logger.warn("You have 'numpy' version %s installed, but 'gym' requires at least 1.10.4. HINT: upgrade via 'pip install -U numpy'.", numpy.__version__) 

我有一个版本numpy的的> = 1.10.4,但这样不应该弹出的权利?(记不起到底是什么版本)

使用PIP安装-U NumPy的回报却一个“SNIMissingWarning”,一个“InsequrePlatformWarning”及以下:

The directory '/Users/sonyaferraro/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
The directory '/Users/sonyaferraro/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 

老实说,我不知道那是什么,告诉我做,因为我对这些目录的权限。

回答

0

根据您的终端输出,我认为您使用的是带有brew的MacOS。

brew link --overwrite numpy似乎已经解决了我的问题。