我想在我的Windows7 Anaconda安装中使用一个名为Cage的旧细胞自动机包(链接)。问题是它使用了模块,而官方没有提供安装程序。我从http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses下载了非官方二进制文件,然后/认为/我已经安装了它。
我原以为安装curses会自动安装其所需的依赖包...
C:\Users\mds>pip install c:\Users\mds\Downloads\curses-2.2-cp27-none-win_amd64.w
hl
Processing c:\users\mds\downloads\curses-2.2-cp27-none-win_amd64.whl
Installing collected packages: curses
Successfully installed curses-2.2
You are using pip version 8.1.1, however version 9.0.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
但是从Spyder内部运行cage包中的一个模块(conway.py
)时,它会在_curses
模块处报错。
runfile('C:/Users/mds/Dropbox/_python/automata/cage-1.1.4/conway.py', wdir='C:/Users/mds/Dropbox/_python/automata/cage-1.1.4')
C:/Users/mds/Dropbox/_python/automata/cage-1.1.4/conway.py:13: RuntimeWarning: Parent module 'cage' not found while handling absolute import
import curses
Traceback (most recent call last):
File "<ipython-input-7-74fbffe46b40>", line 1, in <module>
runfile('C:/Users/mds/Dropbox/_python/automata/cage-1.1.4/conway.py', wdir='C:/Users/mds/Dropbox/_python/automata/cage-1.1.4')
File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile
execfile(filename, namespace)
File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File "C:/Users/mds/Dropbox/_python/automata/cage-1.1.4/conway.py", line 13, in <module>
import curses
File "C:\Anaconda2\lib\curses\__init__.py", line 15, in <module>
from _curses import *
ImportError: No module named _curses
我原以为安装curses会自动安装其所需的依赖包...