我通过 brew install essentia --HEAD
消息安装essentia: Python modules have been installed and Homebrew's site-packages is not in your Python sys.path, so you will not be able to import the modules this formula installed. If you plan to develop with these modules, please run: mkdir -p /Users/yangyy/Library/Python/2.7/lib/python/site-packages echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/yangyy/Library/Python/2.7/lib/python/site-packages/homebrew.pth
蟒蛇 - 不能在Pycharm中导入模块,而我可以在终端中导入相同的模块?
我一样的消息,并指示安装成功essentia
。 该模块可以在终端上输入: Python 2.7.11 (default, Feb 23 2016, 00:59:46) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. -import essentia -exit()
$ which python /usr/local/bin/python
我用Pycharm作为我的IDE。我尝试了所有的解释器,但仍然无法导入此模块。
在蟒蛇,我想:
>>> import essentia
>>> reload(essentia)
<module 'essentia' from '/usr/local/lib/python2.7/site-packages/essentia/__init__.pyc'>
我试过了。问题是我找不到安装在那里的模块。 –
你使用的是virtualenv吗?如果不意味着尝试在virtualenv下创建和安装依赖关系,请尝试此操作。因为我只从那个... –
我试图使用virtualenv,但我不太明白它是如何工作的。最终我在全球环境下安装了该模块。我编辑了这个问题。现在我知道模块的路径,并且正在尝试手动添加路径。 –