Ich benutze das Pandas-Modul innerhalb eines Skripts. Es dauert jedoch 3-10 Sekunden, Pandas jedes Mal zu importieren, wenn ich das Skript ausführe. Ich benutze das Anaconda-Paket für Python 2.7 und ich hatte dieses Problem nicht mit anderen Modulen.Pandas-Import ist sehr langsam (Anaconda Python 2.7)
Ich verwendete cProfile auf einem separaten Skript, das nur aus einer "Import Pandas" -Anweisung bestand. Top-Ergebnisse von der Ausgabe sind unter.
C:\Users\*****\AppData\Local\Continuum\Anaconda> python -m cProfile -s cumtime test_pandas_import.py
204229 function calls (199729 primitive calls) in 3.480 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
2 0.216 0.108 3.490 1.745 __init__.py:4(<module>)
1 0.019 0.019 3.482 3.482 test_imports.py:1(<module>)
19 0.155 0.008 1.300 0.068 __init__.py:1(<module>)
1 0.024 0.024 0.895 0.895 config_init.py:11(<module>)
1 0.049 0.049 0.803 0.803 __init__.py:106(<module>)
1 0.024 0.024 0.669 0.669 format.py:2(<module>)
1 0.005 0.005 0.628 0.628 add_newdocs.py:10(<module>)
2 0.029 0.015 0.604 0.302 index.py:2(<module>)
2 0.094 0.047 0.542 0.271 __init__.py:9(<module>)
2 0.092 0.046 0.532 0.266 common.py:1(<module>)
1 0.008 0.008 0.506 0.506 type_check.py:3(<module>)
Irgendwelche Ideen, warum der Import Pandas Aussage für mich so lange dauert, oder wie könnte ich besser diagnostizieren/beheben, was geschieht? Hat jemand anderes dieses Problem erfahren?
festgestellt, dass die Import-Anweisung betrifft tatsächlich andere Module - siehe [Frage mit erweitertem Bereich] (http://stackoverflow.com/questions/34357357/python-imports-are-very-slow-anaconda-python-2 -7) – TKW
Was ist, wenn Sie zuerst Pandas importieren? –
mit demselben Problem mit Anaconda Python 3.5, zum Importieren von Pandas, Matplotlip ... –