Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Python 3.8 #1672

Open
iworeushankaonce opened this issue Mar 23, 2021 · 5 comments
Open

Compatibility with Python 3.8 #1672

iworeushankaonce opened this issue Mar 23, 2021 · 5 comments

Comments

@iworeushankaonce
Copy link

iworeushankaonce commented Mar 23, 2021

Tried running nengo for the first time after installing, and seems like it's incompatible with python 3.7+, and throws this error
AttributeError: module 'time' has no attribute 'clock'
as starting from 3.8 the function time.clock() has been removed (Src: https://bugs.python.org/issue36895#msg342267)
the newer version of time.clock() starting from Python 3.8 is time.perf_counter(), thus simple replacement might generally work.

@iworeushankaonce iworeushankaonce changed the title Nengo in Python 3.8.5 Compatibility with Python 3.8 Mar 23, 2021
@hunse
Copy link
Collaborator

hunse commented Mar 23, 2021

Nengo should be compatible with Python 3.8 as of 0a5d302, which is included in the v3.1.0 release. What Nengo version are you using? Could you also include the stack trace for the error?

@iworeushankaonce
Copy link
Author

Nengo should be compatible with Python 3.8 as of 0a5d302, which is included in the v3.1.0 release. What Nengo version are you using? Could you also include the stack trace for the error?

nengo_version:

C:\Users\gabdu>pip show nengo
Name: nengo
Version: 3.0.0
Summary: Tools for building and simulating large-scale neural models
Home-page: https://www.nengo.ai/nengo
Author: Applied Brain Research
Author-email: info@appliedbrainresearch.com
License: Free for non-commercial use
Location: c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages
Requires: numpy
Required-by: nengo-gui

error stack:

C:\Users\gabdu>nengo
Traceback (most recent call last):
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\gabdu\AppData\Local\Programs\Python\Python38\Scripts\nengo.exe\__main__.py", line 4, in <module>
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo_gui\__init__.py", line 1, in <module>
    from .gui import GUI, InteractiveGUI
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo_gui\gui.py", line 20, in <module>
    from nengo_gui.guibackend import GuiServer
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo_gui\guibackend.py", line 26, in <module>
    import nengo_gui.page
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo_gui\page.py", line 12, in <module>
    import nengo
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo\__init__.py", line 39, in <module>
    from .base import Process
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo\base.py", line 7, in <module>
    from nengo.config import SupportDefaultsMixin
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo\config.py", line 18, in <module>
    from nengo.params import Default, is_param, iter_params
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo\params.py", line 7, in <module>
    from nengo.rc import rc
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo\rc.py", line 67, in <module>
    import nengo.utils.paths
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo\utils\__init__.py", line 14, in <module>
    from . import simulator
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo\utils\simulator.py", line 5, in <module>
    from .stdlib import groupby
  File "c:\users\gabdu\appdata\local\programs\python\python38\lib\site-packages\nengo\utils\stdlib.py", line 256, in <module>
    class Timer:
  File "c:\users\gabdu\appdata\local\programs\python\python38\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'

@hunse
Copy link
Collaborator

hunse commented Mar 23, 2021

You're running Nengo v3.0.0, which is not compatible with Python 3.8. Unfortunately, nengo_gui currently only supports Nengo v3.0.0 maximum. We're currently doing a complete rewrite of the GUI, but it will still be a number of months before that's available.

The best solution if you want to use nengo_gui is probably to use Python 3.7. The Anaconda platform allows you to specify the Python version when you create a new environment, which can allow you to use e.g. Python 3.7 without having to modify your system-wide Python version.

@xchoo
Copy link
Member

xchoo commented Mar 23, 2021

To add, the naming scheme is confusing, I'd have to admit. The nengo command you run in the command line actually refers to the NengoGUI code base, and as you correctly deduced, NengoGUI is currently not compatible with Python 3.8+. We are aware of the current compatibility restrictions (Python <= 3.7.X, Nengo <= 3.0.0) for the NengoGUI package, and as @hunse we are completely reworking it.

@tcstewar
Copy link
Contributor

Just to add here, there is a patch for NengoGUI that brings it up to the latest Nengo version:

https://github.com/nengo/nengo-gui/tree/update-to-nengo-3

While we're waiting for the new GUI to be released, should we just merge that patch and release an updated version of the old nengo GUI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants