Ich bin neu bei Python, also gibt es vielleicht eine einfache Lösung dafür. Ich habe Anaconda installiert und dachte, dass alles einfach wäre, aber obwohl Jupyter gut funktioniert, kann ich numpy und matplotlib nicht in mein Notebook importieren. Stattdessen ich diesen Fehler:Python: Installierte Anaconda, kann aber numpy oder matplotlib nicht in Jupyter-Notebook importieren
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-1e0540761e0c> in <module>()
----> 1 import matplotlib.pyplot as plt
2 vals = [1, 2, 3, 4]
3 plt.plot(vals)
//anaconda/lib/python3.5/site-packages/matplotlib/__init__.py in <module>()
120 # cbook must import matplotlib only within function
121 # definitions, so it is safe to import from it here.
--> 122 from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label
123 from matplotlib.compat import subprocess
124 from matplotlib.rcsetup import (defaultParams,
//anaconda/lib/python3.5/site-packages/matplotlib/cbook.py in <module>()
31 from weakref import ref, WeakKeyDictionary
32
---> 33 import numpy as np
34 import numpy.ma as ma
35
//anaconda/lib/python3.5/site-packages/numpy/__init__.py in <module>()
144 return loader(*packages, **options)
145
--> 146 from . import add_newdocs
147 __all__ = ['add_newdocs',
148 'ModuleDeprecationWarning',
//anaconda/lib/python3.5/site-packages/numpy/add_newdocs.py in <module>()
11 from __future__ import division, absolute_import, print_function
12
---> 13 from numpy.lib import add_newdoc
14
15 ###############################################################################
//anaconda/lib/python3.5/site-packages/numpy/lib/__init__.py in <module>()
6 from numpy.version import version as __version__
7
----> 8 from .type_check import *
9 from .index_tricks import *
10 from .function_base import *
//anaconda/lib/python3.5/site-packages/numpy/lib/type_check.py in <module>()
9 'common_type']
10
---> 11 import numpy.core.numeric as _nx
12 from numpy.core.numeric import asarray, asanyarray, array, isnan, \
13 obj2sctype, zeros
//anaconda/lib/python3.5/site-packages/numpy/core/__init__.py in <module>()
12 os.environ[envkey] = '1'
13 env_added.append(envkey)
---> 14 from . import multiarray
15 for envkey in env_added:
16 del os.environ[envkey]
ImportError: dlopen(//anaconda/lib/python3.5/site-packages/numpy/core/multiarray.so, 10): Symbol not found: _strnlen
Referenced from: /anaconda/lib/python3.5/site-packages/numpy/core/../../../..//libmkl_intel_lp64.dylib
Expected in: flat namespace
in /anaconda/lib/python3.5/site-packages/numpy/core/../../../..//libmkl_intel_lp64.dylib
Da beide Pakete in $ conda list
seine wahrscheinlich eine Art zeigen, der Verknüpfung Fehler, aber das ist leider etwas ein Anfänger für sich kaum lösen kann (?). Kann jemand helfen?
Auf den ersten Blick sieht dies wie ein ernstes Problem mit Ihrer Installation aus, da sich der Fehler auf eine Datei namens ".dylib" (DYnamic LIBrary) bezieht, die mit NumPy-Interna und nicht mit Ihrem Code zu tun hat. – ForceBru
@ForceBru Ich habe nichts anderes getan, als Anaconda herunterzuladen und zu installieren, ein Jupyter-Notizbuch zu öffnen und ein paar einfache Skripte auszuführen. – mgtheater
Ich sehe, aber das ist immer noch ein ziemlich seltsamer Fehler für mich, wie es sich über die Tatsache beschwert, dass das '_strnlen' C-Standard-Bibliothekssymbol fehlt, und dieses Symbol ist ein bisschen Standard, _es sollte vorhanden sein, aber es ist nicht. .. – ForceBru