3

I want to use an old cellular automata package called cage on my windows7 anaconda install.

Problem is that is uses curses module, for which there is no official install of.

I downloaded the unofficial binary at http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses and then /think/ that I installed it.

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.

But from inside Spyder, when I run one of the modules (conway.py) of the cage package, it complains at _curses 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')
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

Would have thought installing curses would have installed whatever dependent pacakges it requires...

user3556757
  • 3,469
  • 4
  • 30
  • 70

1 Answers1

1

I know some time has passed, but as I had the same problem, I'm posting my solution.

As @Thomas Dickey said, there's no official install for Anaconda. What I did was using pip to install curses on my virtual environment created using Anaconda. You can see the full solution here: Using Pip to install packages to Anaconda Environment

As I'm on Windows 7, the pip path is something like this:

C:\Users\username\Anaconda3\envs\venv_name\Scripts\pip.exe

Then I installed windows-curses 1.0:

C:\Users\username\Anaconda3\envs\venv_name\Scripts\pip.exe install windows-curses

revy
  • 647
  • 2
  • 10
  • 29