2017-09-24 130 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似乎已經解決了我的問題。