MCPcopy Create free account
hub / github.com/numpy/numpy / run

Function run

numpy/f2py/diagnose.py:13–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13def run():
14 _path = os.getcwd()
15 os.chdir(tempfile.gettempdir())
16 print('------')
17 print('os.name=%r' % (os.name))
18 print('------')
19 print('sys.platform=%r' % (sys.platform))
20 print('------')
21 print('sys.version:')
22 print(sys.version)
23 print('------')
24 print('sys.prefix:')
25 print(sys.prefix)
26 print('------')
27 print('sys.path=%r' % (':'.join(sys.path)))
28 print('------')
29
30 try:
31 import numpy
32 has_newnumpy = 1
33 except ImportError as e:
34 print('Failed to import new numpy:', e)
35 has_newnumpy = 0
36
37 try:
38 from numpy.f2py import f2py2e
39 has_f2py2e = 1
40 except ImportError as e:
41 print('Failed to import f2py2e:', e)
42 has_f2py2e = 0
43
44 try:
45 import numpy.distutils
46 has_numpy_distutils = 2
47 except ImportError:
48 try:
49 import numpy_distutils
50 has_numpy_distutils = 1
51 except ImportError as e:
52 print('Failed to import numpy_distutils:', e)
53 has_numpy_distutils = 0
54
55 if has_newnumpy:
56 try:
57 print('Found new numpy version %r in %s' %
58 (numpy.__version__, numpy.__file__))
59 except Exception as msg:
60 print('error:', msg)
61 print('------')
62
63 if has_f2py2e:
64 try:
65 print('Found f2py2e version %r in %s' %
66 (f2py2e.__version__.version, f2py2e.__file__))
67 except Exception as msg:
68 print('error:', msg)
69 print('------')
70

Callers 2

diagnose.pyFile · 0.70
mainFunction · 0.50

Calls 2

printFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected