简体   繁体   English

在Windows 7 python上诅咒

[英]curses on windows 7 python

I want to use an old cellular automata package called cage on my windows7 anaconda install. 我想在我的windows7 anaconda安装上使用一个名为cage的旧蜂窝自动包

Problem is that is uses curses module, for which there is no official install of. 问题是使用curses模块,没有正式安装。

I downloaded the unofficial binary at http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses and then /think/ that I installed it. 我在http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses下载了非官方二进制文件,然后/ think /我安装了它。

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. 但是从Spyder里面,当我运行一个笼子包的模块( 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

Would have thought installing curses would have installed whatever dependent pacakges it requires... 本来以为安装curses会安装它需要的任何依赖pacakges ...

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. 正如@Thomas Dickey所说,Anaconda没有正式安装。 What I did was using pip to install curses on my virtual environment created using Anaconda. 我所做的是使用pip在我使用Anaconda创建的虚拟环境中安装curses You can see the full solution here: Using Pip to install packages to Anaconda Environment 您可以在此处查看完整解决方案: 使用Pip将软件包安装到Anaconda Environment

As I'm on Windows 7, the pip path is something like this: 当我在Windows 7上时,pip路径是这样的:

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

Then I installed windows-curses 1.0 : 然后我安装了windows-curses 1.0

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM