import numpy会导致NumPy 1.16.0及更高版本的Python崩溃

时间:2019-05-11 07:37:49

标签: python python-2.7 numpy f2py

在Windows Server 2012上全新安装Python 3.7.3

import numpy在安装NumPy 1.16.0或更高版本时会导致Python崩溃。降级到1.15.4可以解决此问题,但是我看不出其原因。

此外,当我尝试直接从脚本目录运行 f2py.exe 时,我得到几乎完全相同的崩溃错误。

我尝试从1.16.3开始一次降级一个发行版,问题从1.15.4开始解决。

NumPy 1.16.0发行说明提到了以下内容,但是我只是怀疑这可能是相关的,因为错误还提到了openBLAS

“ PyPI上的轮子与OpenBLAS v0.3.4 +链接,该版本应修复在以前的OpenBLAS版本中发现的已知线程问题。” https://docs.scipy.org/doc/numpy-1.16.0/release.html

我使用pip安装了软件包,但没有自己构建。

在Python中执行import numpy命令后崩溃信息:

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: python.exe
  Application Version:  3.7.3150.1013
  Application Timestamp:    5c9954fa
  Fault Module Name:    libopenblas.IPBC74C7KURV7CB2PKT5Z5FNR3SIBV4J.gfortran-win_amd64.
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp:   5cbcde25
  Exception Code:   c000001d
  Exception Offset: 00000000010fecc1
  OS Version:   6.3.9600.2.0.0.272.7
  Locale ID:    2057
  Additional Information 1: 42c8
  Additional Information 2: 42c87030f31f34adc07b43111a42b7a7
  Additional Information 3: f88e
  Additional Information 4: f88eb41d35291c2f266e7cad28e0f750

直接从Windows执行f2py.exe时崩溃信息:

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: python.exe
  Application Version:  3.7.3150.1013
  Application Timestamp:    5c9954fa
  Fault Module Name:    libopenblas.IPBC74C7KURV7CB2PKT5Z5FNR3SIBV4J.gfortran-win_amd64.
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp:   5cbcde25
  Exception Code:   c000001d
  Exception Offset: 00000000010fecc1
  OS Version:   6.3.9600.2.0.0.272.7
  Locale ID:    2057
  Additional Information 1: b03f
  Additional Information 2: b03fdfbd3d3cda6de0e3b052cf01b30d
  Additional Information 3: eca9
  Additional Information 4: eca9f354c1f2a69a54ab98e48c42f4c2

我希望能获得有关如何解决此问题的帮助,因此可以将NumPy升级到1.16.x

非常感谢您!

编辑:

import pdb 
pdb.set_trace()
import numpy

从IDE(vscode)开始,大约停留在这里:

> c:\users\administrator\.vscode\extensions\ms-python.python-2019.4.12954\pythonfiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_net_command.py(77)__init__()
-> as_bytes = msg
(Pdb)
> c:\users\administrator\.vscode\extensions\ms-python.python-2019.4.12954\pythonfiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_net_command.py(78)__init__()
-> self._as_bytes = as_bytes
(Pdb)
--Return--
> c:\users\administrator\.vscode\extensions\ms-python.python-2019.4.12954\pythonfiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_net_command.py(78)__init__()->None
-> self._as_bytes = as_bytes
(Pdb)
--Return--
> c:\users\administrator\.vscode\extensions\ms-python.python-2019.4.12954\pythonfiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_net_command_factory_json.py(226)make_io_message()-><_pydevd_bund...000A095FB5240>
-> return NetCommand(CMD_WRITE_TO_CONSOLE, 0, event, is_json=True)
(Pdb)
> c:\users\administrator\.vscode\extensions\ms-python.python-2019.4.12954\pythonfiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py(1773)write()
-> py_db.writer.add_command(cmd)
(Pdb)
--Call--
> c:\users\administrator\.vscode\extensions\ms-python.python-2019.4.12954\pythonfiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py(350)add_command()
-> def add_command(self, cmd):
(Pdb)
> c:\users\administrator\.vscode\extensions\ms-python.python-2019.4.12954\pythonfiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py(352)add_command()
-> if not self.killReceived:  # we don't take new data after everybody die
(Pdb)
> c:\users\administrator\.vscode\extensions\ms-python.python-2019.4.12954\pythonfiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py(353)add_command()
-> self.cmdQueue.put(cmd)
(Pdb)
--Call--
> c:\python37\lib\queue.py(121)put()
-> def put(self, item, block=True, timeout=None):
(Pdb)
> c:\python37\lib\queue.py(132)put()
-> with self.not_full:
(Pdb)
--Call--
> c:\python37\lib\threading.py(240)__enter__()
-> def __enter__(self):
(Pdb)
> c:\python37\lib\threading.py(241)__enter__()
-> return self._lock.__enter__()
(Pdb)
--Return--

直接从命令提示符处

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\Administrator>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb
>>> pdb.set_trace()
--Return--
> <stdin>(1)<module>()->None
(Pdb) next
>>> import numpy
--Call--
> <stdin>(1)<module>()->None
(Pdb) step
> <stdin>(1)<module>()->None
(Pdb)
--Call--
> <frozen importlib._bootstrap>(978)_find_and_load()
(Pdb)
> <frozen importlib._bootstrap>(980)_find_and_load()
(Pdb)
--Call--
> <frozen importlib._bootstrap>(143)__init__()
(Pdb)
> <frozen importlib._bootstrap>(144)__init__()
(Pdb)
> <frozen importlib._bootstrap>(145)__init__()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(145)__init__()->None
(Pdb)
--Call--
> <frozen importlib._bootstrap>(147)__enter__()
(Pdb)
> <frozen importlib._bootstrap>(148)__enter__()
(Pdb)
--Call--
> <frozen importlib._bootstrap>(157)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(163)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(164)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(165)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(166)_get_module_lock()
(Pdb)
KeyError: 'numpy'
> <frozen importlib._bootstrap>(166)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(167)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(168)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(170)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(171)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(174)_get_module_lock()
(Pdb)
--Call--
> <frozen importlib._bootstrap>(58)__init__()
(Pdb)
> <frozen importlib._bootstrap>(59)__init__()
(Pdb)
> <frozen importlib._bootstrap>(60)__init__()
(Pdb)
> <frozen importlib._bootstrap>(61)__init__()
(Pdb)
> <frozen importlib._bootstrap>(62)__init__()
(Pdb)
> <frozen importlib._bootstrap>(63)__init__()
(Pdb)
> <frozen importlib._bootstrap>(64)__init__()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(64)__init__()->None
(Pdb)
> <frozen importlib._bootstrap>(176)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(187)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(189)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(191)_get_module_lock()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(191)_get_module_lock()->_ModuleLock('... at 4331702088
(Pdb)
> <frozen importlib._bootstrap>(149)__enter__()
(Pdb)
--Call--
> <frozen importlib._bootstrap>(78)acquire()
(Pdb)
> <frozen importlib._bootstrap>(84)acquire()
(Pdb)
> <frozen importlib._bootstrap>(85)acquire()
(Pdb)
> <frozen importlib._bootstrap>(86)acquire()
(Pdb)
> <frozen importlib._bootstrap>(87)acquire()
(Pdb)
> <frozen importlib._bootstrap>(88)acquire()
(Pdb)
> <frozen importlib._bootstrap>(89)acquire()
(Pdb)
> <frozen importlib._bootstrap>(90)acquire()
(Pdb)
> <frozen importlib._bootstrap>(91)acquire()
(Pdb)
> <frozen importlib._bootstrap>(92)acquire()
(Pdb)
> <frozen importlib._bootstrap>(101)acquire()
(Pdb)
KeyError: 23192
> <frozen importlib._bootstrap>(101)acquire()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(101)acquire()->None
(Pdb)
KeyError: 23192
> <frozen importlib._bootstrap>(101)acquire()->None
(Pdb)
--Return--
> <frozen importlib._bootstrap>(149)__enter__()->None
(Pdb)
KeyError: 23192
> <frozen importlib._bootstrap>(101)acquire()->None
(Pdb)
--Return--
> <frozen importlib._bootstrap>(980)_find_and_load()->None
(Pdb)
KeyError: 23192
> <frozen importlib._bootstrap>(101)acquire()->None
(Pdb)
--Return--
> <stdin>(1)<module>()->None
(Pdb)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 980, in _find_and_load
  File "<frozen importlib._bootstrap>", line 149, in __enter__
  File "<frozen importlib._bootstrap>", line 101, in acquire
KeyError: 23192
>>>
--Call--
> <stdin>(1)<module>()->None
(Pdb)
> <stdin>(1)<module>()->None
(Pdb)
--Return--
> <stdin>(1)<module>()->None
(Pdb)
>>>
--Call--
> <stdin>(1)<module>()->None
(Pdb)
> <stdin>(1)<module>()->None
(Pdb)
--Return--
> <stdin>(1)<module>()->None
(Pdb)
>>>

0 个答案:

没有答案