【问题标题】:Python- Import error of peakutilsPython-peakutils的导入错误
【发布时间】:2017-08-21 01:01:02
【问题描述】:

我正在尝试使用 peakutils 库并已使用

pip install peakutils

但是当我尝试在我的 jupyter 笔记本中导入相同的内容时,它会显示导入错误 在此之前,我从未遇到过这样的问题。 我没有设置 PYTHONPATH。

另外,在this 中,第二个答案要求取消设置 python 路径

unset PYTHONPATH

显示

'unset' is not recognised as an internal or external command, operable program or batch file.

我已检查该软件包是否安装在我正在使用的环境中:

(C:\Users\DELL\Anaconda3) C:\Users\DELL>activate DAND

(DAND) C:\Users\DELL>pip install peakutils
Requirement already satisfied: peakutils in c:\users\dell\anaconda3\envs\dand\li
b\site-packages
Requirement already satisfied: scipy in c:\users\dell\anaconda3\envs\dand\lib\si
te-packages (from peakutils)
Requirement already satisfied: numpy in c:\users\dell\anaconda3\envs\dand\lib\si
te-packages (from peakutils)

【问题讨论】:

  • unset 是 linux 操作系统命令,您使用的是 windows C:\Users\DELL
  • @hemraj 好吧,我的错!

标签: python anaconda importerror pythonpath peakutils


【解决方案1】:

我尝试通过 Jupyter 终端安装库时遇到了问题,但是当我回到笔记本电脑尝试“导入 peakutils”时,它仍然无法正常工作。所以,我尝试了这三步方法,效果很好。

!pip install PeakUtils
!pip install msgpack
!pip install --upgrade pip

【讨论】:

    【解决方案2】:

    我浏览了目录

    c:\users\dell\anaconda3\envs\dand\lib\site-packages\peakutils
    

    我没有找到任何 setup.py,所以我继续查看源代码 here 并注意到我只有文件夹 peakutils 并且需要 setup.py 以及 manifest 和 readmd.rst。我只是下载了文件并将它们包含在文件夹 site-packages 中,然后运行

    python setup.py install
    

    在 c:\users\dell\anaconda3\envs\dand\lib\site-packages\ 目录 然后就成功了

    【讨论】:

      猜你喜欢
      • 2016-05-07
      • 1970-01-01
      • 1970-01-01
      • 2016-11-04
      • 2015-09-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多