pycharm怎么安装modul,命令行可以import的module,在Pycharm里怎么使用?

博主在PyCharm中遇到使用Essentia库的困难,通过`brew install essentia --HEAD`安装后,虽然能在命令行中成功导入,但在PyCharm内无法使用。解决方案涉及到Python的sys.path和site-packages的设置,执行了指定的命令后,问题在命令行环境中得到解决,但PyCharm环境仍需进一步配置。
摘要由CSDN通过智能技术生成

我想使用essentia,安装完成后能够在命令行里使用,但是pycharm内无法使用?

我使用brew install essentia --HEAD安装的,安装后提示

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

我执行了这两个命令后,在命令行里打开python

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()

可以import。

执行which python,

/usr/local/bin/python

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值