Update to __init__.py?

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
cvaaga
Posts: 1
Joined: Wed Apr 29, 2020 3:13 pm

Update to __init__.py?

Post 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.
ramcdougal
Posts: 224
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

Re: Update to __init__.py?

Post 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
Post Reply