Page 1 of 1

Update to __init__.py?

Posted: Mon Mar 01, 2021 1:55 pm
by cvaaga
Hello,

I have been running simulations through NEURON implemented in python for a while with no issues. However, my computer (Windows) just ran a helpful update, and now NEURON no longer works in the python environment. It calls an error to the __init__.py file, which has multiple instances of print functions being called without parentheses. These seemed easy enough to fix, so I went in and added the parentheses, but there is another error in referencing a logging variable in the hoc_execute function (code copied below):

Code: Select all

def hoc_execute(hoc_commands, comment=None):
    assert isinstance(hoc_commands,list)
    if comment:
        logging.debug(comment)
    for cmd in hoc_commands:
        logging.debug(cmd)
        success = hoc.execute(cmd)
        if not success:
            raise HocError('Error produced by hoc command "%s"' % cmd)

def hoc_comment(comment):
    logging.debug(comment)
Were there perhaps recent updates to the python NEURON files? If so, can you provide an update to remedy this problem, or provide me with an alternate solution?

Thanks,
Chris


PS I have tried importing neuron alone and h from neuron, both replicate the problem.

Re: Update to __init__.py?

Posted: Mon Mar 01, 2021 2:15 pm
by ramcdougal
As this is running on your own machine, consider updating your version of NEURON. The current release is 7.8.2.

You can get it from the NEURON website or directly from GitHub at https://github.com/neuronsimulator/nrn/ ... /tag/7.8.2