我试图在Eclipse和PyDev中使用Python。
我可以导入多个包,例如numpy的。但是当我想导入pylab来绘制一些函数时,我得到一个WindowsError: [Error 5] Access denied
。
当我点击Eclipse中的Window>Preferences>PyDev>Interpreters>Python Interpreter
时,我可以看到PyDev找到了我所有的库。由于我已经安装了Anaconda,因此已经安装了Pylab软件包。
当我将pylab添加为强制内置时,我仍然会遇到相同的错误。
以下是完整的错误报告
Traceback (most recent call last):
File "C:\Users\user\Documents\scripts\test\test\test.py", line 1, in <module>
import pylab as pl
File "C:\Programme\Anaconda\lib\site-packages\pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "C:\Programme\Anaconda\lib\site-packages\matplotlib\pylab.py", line 269, in <module>
from matplotlib.pyplot import *
File "C:\Programme\Anaconda\lib\site-packages\matplotlib\pyplot.py", line 98, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "C:\Programme\Anaconda\lib\site-packages\matplotlib\backends\__init__.py", line 28, in pylab_setup
globals(),locals(),[backend_name],0)
File "C:\Programme\Anaconda\lib\site-packages\matplotlib\backends\backend_qt4agg.py", line 13, in <module>
from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,\
File "C:\Programme\Anaconda\lib\site-packages\matplotlib\backends\backend_qt4.py", line 21, in <module>
import matplotlib.backends.qt4_editor.figureoptions as figureoptions
File "C:\Programme\Anaconda\lib\site-packages\matplotlib\backends\qt4_editor\figureoptions.py", line 13, in <module>
import matplotlib.backends.qt4_editor.formlayout as formlayout
File "C:\Programme\Anaconda\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py", line 51, in <module>
from matplotlib.backends.qt4_compat import QtGui,QtCore
File "C:\Programme\Anaconda\lib\site-packages\matplotlib\backends\qt4_compat.py", line 80, in <module>
from PySide import QtCore, QtGui, __version__, __version_info__
File "C:\Programme\Anaconda\lib\site-packages\PySide\__init__.py", line 41, in <module>
_setupQtDirectories()
File "C:\Programme\Anaconda\lib\site-packages\PySide\__init__.py", line 11, in _setupQtDirectories
pysideDir = _utils.get_pyside_dir()
File "C:\Programme\Anaconda\lib\site-packages\PySide\_utils.py", line 93, in get_pyside_dir
return _get_win32_case_sensitive_name(os.path.abspath(os.path.dirname(QtCore.__file__)))
File "C:\Programme\Anaconda\lib\site-packages\PySide\_utils.py", line 84, in _get_win32_case_sensitive_name
path = _get_win32_long_name(_get_win32_short_name(s))
File "C:\Programme\Anaconda\lib\site-packages\PySide\_utils.py", line 74, in _get_win32_long_name
raise WinError()
WindowsError: [Error 5] Zugriff verweigert