Problems installing Nengo on Windows 10

I cannot seem to get a working install of Nengo on Windows 10.

First, I uninstalled all Python libraries, and then uninstalled Python itself, and then removed any Python reference from the environmental variables. So, I had a clean system to start with.

Next, following the detailed installation instructions, I installed Anaconda, using the install file: Anaconda3-2020.11-Windows-x86_64.exe

So far, so good.

Then I opened the Anaconda command prompt and entered: pip install nengo nengo-gui

Then everything went bad. I got these messages:

Collecting nengo
  Using cached nengo-3.1.0-py3-none-any.whl (523 kB)
Collecting nengo-gui
  Using cached nengo_gui-0.4.7-py3-none-any.whl (843 kB)
Requirement already satisfied: numpy>=1.13 in c:\users\mark\anaconda3\lib\site-packages (from nengo) (1.19.2)
Installing collected packages: nengo, nengo-gui
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

nengo-gui 0.4.7 requires nengo<=3.0.0,>=2.6.0, but you'll have nengo 3.1.0 which is incompatible.
Successfully installed nengo-3.1.0 nengo-gui-0.4.7

I then attempted to run Nengo anyway, and got pages and pages of errors. Any ideas? I’m relatively unexperienced with Python, so be gentle!

Hi @erewhon and welcome to the forum! Thanks for sharing all the details of what you tried. I think the issue is in this part in your console messages:

What is happening is pip install nengo nengo-gui is trying to install the newest versions of both Nengo and the GUI. But nengo==3.1.0 is not currently compatible with the newest GUI; instead the GUI (currently) requires a slightly older version: nengo<=3.0.0.

Could you try running this instead?

pip install "nengo<=3.0.0" nengo-gui

I believe this should force it to downgrade your installed version of Nengo to be compatible with the GUI.

1 Like

Hi @erewhon,

I was intrigued by the error message you received (about the pip feature resolver), so I spun up several Conda environments and tested them, and I couldn’t replicate what you are observing. While @arvoelke suggestion will work, I suspect that you might not have removed all references to a previous python installation.

In your Anaconda command prompt, can you issue the following command: where pip
This should display something like, and tell you which pip executable your command line is using to execute pip:

>where pip
E:\ProgramFiles\Miniconda3\Scripts\pip.exe
E:\ProgramFiles\Python39\Scripts\pip.exe 

If your system is using a pip executable that is of an older version, it may not be handling the version dependencies appropriately, which is why you are encountering the error.

I’d also recommend creating a Conda environment first before installing Nengo. Having multiple environments allows you to create separate instances of python so that you can test code that require different package dependencies without them conflicting with each other. I’d recommend using Python 3.7+ when creating the Conda environment. As an example of the full installation proceedure:

  1. Install Anaconda
  2. Start Anaconda command prompt
  3. Run conda create -n <env_name> python=3.7 (replace <env_name> with whatever you want to call your environment.
  4. Run conda activate <env_name> to activate your Conda environment.
  5. Run pip install nengo nengo-gui to install Nengo and NengoGUI
1 Like

Thank you, arvoelke!

I made progress, but haven’t reached the finish line yet.

From the Anaconda command prompt, I first uninstalled nengo-gui:
pip uninstall nengo-gui

Then, I uninstalled nengo:
pip uninstall nengo

So, with the stage cleared somewhat, I followed your suggestion:
pip install "nengo<=3.0.0" nengo-gui

Great! No worrisome messages.

Once again, from the Anaconda comand prompt, I invoked nengo, and got:
(The text below may not have formatted properly…)

Traceback (most recent call last):
  File "c:\users\mark\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\mark\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Mark\anaconda3\Scripts\nengo.exe\__main__.py", line 4, in <module>
  File "c:\users\mark\anaconda3\lib\site-packages\nengo_gui\__init__.py", line 1, in <module>
    from .gui import GUI, InteractiveGUI
  File "c:\users\mark\anaconda3\lib\site-packages\nengo_gui\gui.py", line 20, in <module>
    from nengo_gui.guibackend import GuiServer
  File "c:\users\mark\anaconda3\lib\site-packages\nengo_gui\guibackend.py", line 26, in <module>
    import nengo_gui.page
  File "c:\users\mark\anaconda3\lib\site-packages\nengo_gui\page.py", line 12, in <module>
    import nengo
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\__init__.py", line 39, in <module>
    from .base import Process
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\base.py", line 7, in <module>
    from nengo.config import SupportDefaultsMixin
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\config.py", line 18, in <module>
    from nengo.params import Default, is_param, iter_params
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\params.py", line 7, in <module>
    from nengo.rc import rc
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\rc.py", line 67, in <module>
    import nengo.utils.paths
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\utils\__init__.py", line 14, in <module>
    from . import simulator
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\utils\simulator.py", line 5, in <module>
    from .stdlib import groupby
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\utils\stdlib.py", line 256, in <module>
    class Timer:
  File "c:\users\mark\anaconda3\lib\site-packages\nengo\utils\stdlib.py", line 283, in Timer
    TIMER = time.clock if sys.platform == "win32" else time.time
AttributeError: module 'time' has no attribute 'clock'

xchoo has some helpful comments in a post shortly after yours, and I will try those suggestions shortly.

Again - thanks!

Ah! Drats. I’ve forgotten about that. Turns out NengoGUI does have an upper limit of Python 3.7. If you are using the latest Anaconda installer, it will install Python 3.8, so you’ll need to create a new python environment with Python 3.7. I’ve amended my original post to reflect this.

As a side note, if you continue to encounter this error when installing other packages in the future:

You’ll want to upgrade your pip version by doing this in your Anaconda environment:
pip install --upgrade pip

arvoelke and xchoo - there was yet another problem which I think I resolved myself.

After incorporating all the suggested changes, I started nengo one more time and got more errors, ending with:
RuntimeError: The current Numpy installation ('c:\\users\\mark\\anaconda3\\envs\\nengo1-py3.7\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86

I went to the tinyurl link and found that there is a problem with numpy 1.19.4 on Windows 10 versions 2004 and 20H2. There may be a fix to Windows 10 sometime in January 2021, if I understand the link correctly. There are several possible temporary fixes. The one I tried involved reverting to numpy 1.19.3.

From my conda environment:
pip install numpy==1.19.3

I restarted my conda environment, started nengo, and things seemed to work.

To summarize:
(1) Installed Anaconda (Anaconda3-2020.11-Windows-x86_64.exe) on Windows 10 version 20H2.
(2) Within Anaconda, created an environment running Python 3.7:
create -n nengo1-py3.7 python=3.7
(3) Within my new nengo1-py3.7 environment, went back a level on numpy:
pip install numpy==1.19.3
(4) Did nengo install:
pip install "nengo<=3.0.0" nengo-gui
(5) I think I installed the jedi module at some point, based on other error messages. My brains were feeling a bit scrambled at this point.
(6) This is what I have in my nengo1-py3.7 environment:

Package      Version
------------ -------------------
certifi      2020.12.5
jedi         0.17.2
nengo        3.0.0
nengo-gui    0.4.7
numpy        1.19.3
parso        0.7.1
pip          20.3.1
setuptools   51.0.0.post20201207
wheel        0.36.1
wincertstore 0.2

(7) Running nengo from my nengo1-py3.7 environment brings up a gui in my browser, usually with no error messages.

Thanks, people!

That’s great to hear!

For future reference (and I really should have clarified), I usually install numpy through conda before installing anything else, like so:

  1. Create Conda environment
  2. Activate Conda environment
  3. Install numpy with conda install numpy (this installed numpy using the Conda repositories, where the packages are verified to work on the specific operating systems)
  4. Install Nengo and whatever other packages