【问题标题】:Can't install mdfreader version 3 due to numpy NameError in pip由于 pip 中的 numpy NameError 无法安装 mdfreader 版本 3
【发布时间】:2019-06-30 05:23:48
【问题描述】:

我想更新 mdfreader 但使用 pip upgrade 命令时收到错误:NameError: name numpy is not defined

我已将 pip 和 setuptools 更新到最新版本,并且错误没有改变。

Traceback (most recent call last):
File "C:\Users\myname\AppData\Local\Temp\pip-install-85wfmgif\mdfreader\setup.py", line 111, in <module>
entry_points = entry_points, ext_modules=ext_modules, include_dirs= 
[numpy.get_include<>])
NameError:name `numpy` is not defined

during handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\myname\AppData\Local\Temp\pip-install-85wfmgif\mdfreader\setup.py", line 120, in <module>
entry_points = entry_points, ext_modules=ext_modules, include_dirs= 
[numpy.get_include<>])
NameError:name `numpy` is not defined
   ---------------------------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\myname\AppData\Local\Temp\pip-install-85wfmgif\mdfreader\

我发现有人使用过的类似问题: 将 numpy 导入为 np

然后尝试用它的全名调用 numpy。我假设如果这是问题所在,那么没有人能够安装最新版本

我去了文件路径,但文件不在那里我猜它只是被删除,因为它是临时的。

【问题讨论】:

    标签: python numpy pip installation


    【解决方案1】:

    你试过asammdf吗?免责声明:我是这个包的主要开发者

    【讨论】:

      【解决方案2】:

      mdfreader doesn't import numpy if Cython is not available。试试

      pip install cython
      

      这是他们setup.py 中的一个错误,它已经是reported

      【讨论】:

      • 你的意思是 pip install cython 吗?我已经有了 numpy,但是您链接的错误日志说您需要 cython 才能使设置正常工作。我安装了 cython,然后安装了 mfdreader。
      • 是的,已修复。很抱歉造成混乱。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-29
      • 2019-02-27
      • 2019-06-17
      • 2020-09-08
      • 2020-06-11
      • 2021-05-24
      • 2016-04-19
      相关资源
      最近更新 更多