No module named hoc37

Post Reply
RBJ
Posts: 62
Joined: Sun Aug 02, 2015 4:28 am
Location: UK
Contact:

No module named hoc37

Post by RBJ »

I have Neuron successful installed on OSX and Windows 7/10... but I have failed with two separate linux (Ubuntu) machines now and so I think it is time to call for help. I don't have much experience with linux, so it is highly probably I am being an idiot. I have been trying off and on for days, though and read through similar sounding issues. I have the exact same error on both of the Ubuntu systems I tried, so it looks like I am doing something systematically wrong rather than this being due to a bug.
What I did:
Installed Anaconda as ever (3: Python 3.7, Ipython 7.4). I use Spyder.
Hello World is fine.
Downloaded the latest (7.6) neuron debian pre-built binary and accepted all the defaults.
Added the .../lib/python folder to the PYTHONPATH in Spyder.
Checked/added that nrn..../bin is in the PATH.
Then from Spyder.. from neuron import h, gui, rxd results in the hoc37 error of this title.
within the PYTHONPATH there is no hoc37.
Please can you help me diagnose and fix this?
Thank you
Richard
ramcdougal
Posts: 267
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

Re: No module named hoc37

Post by ramcdougal »

Two questions:
  • Does NEURON work from a regular python prompt (i.e. not Spyder)
  • What is the full NEURON part of your PYTHONPATH?
Because of reasons NEURON installs two versions of the library. Only one has the "missing" file.

In particular, on my machine the two paths are:

/usr/local/nrn/lib/python/neuron/
/usr/local/nrn/share/nrn/lib/python/neuron/

The first one is the one that I need.
RBJ
Posts: 62
Joined: Sun Aug 02, 2015 4:28 am
Location: UK
Contact:

Re: No module named hoc37

Post by RBJ »

Thank you for your reply,
So firstly, no NEURON does not work from a regular python prompt. In fact it gets less far, failing to find neuron at all, because I only set PYTHONPATH within the PYTHONPATH preferences of Spyder. Same as I do on my mac.
Secondly, the PYTHONPATH I am using on these UBUNTU systems is /usr/local/nrn/lib/python
I didn't know there was an alternative. I will try that!
...tried the alternative path ( /usr/local/nrn/share....) and get exactly the same error as with the other path.
If no PYTHONPATH is set it cannot find the "neuron" package. If PYTHONPATH is set, apparently correctly, it cannot find "hoc37".

BW
Richard
ps...so I also tried Python 35 and 36 and got, of course cannot find hoc35 and hoc36 respectively with those...
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: No module named hoc37

Post by hines »

Does your NEURON module have the contents:

Code: Select all

$ ls /usr/local/nrn/lib/python/neuron
crxd         hclass3.pyc                          nonvint_block_supervisor.py
doc.py       help_data.dat                        nonvint_block_supervisor.pyc
doc.pyc      hoc.cpython-35m-x86_64-linux-gnu.so  psection.py
gui2         hoc.cpython-36m-x86_64-linux-gnu.so  psection.pyc
gui.py       hoc.cpython-37m-x86_64-linux-gnu.so  __pycache__
gui.pyc      hoc.so                               rxd
hclass2.py   __init__.py                          sections.py
hclass2.pyc  __init__.pyc                         sections.pyc
hclass3.py   neuroml                              tests
If so, and this is in your PYTHONPATH, then launch
python3 -v
import neuron

This last will be very voluminous, but what is desired is a an error message that will hint as to what went wrong. In my case (nothing is crashingly wrong) it loaded
# extension module 'neuron.hoc' executed from '/usr/local/nrn/lib/python/neuron/hoc.cpython-37m-x86_64-linux-gnu.so'
and after another thousand lines or so ended up with
# wrote '/usr/local/nrn/lib/python/neuron/__pycache__/psection.cpython-37.pyc'
import 'neuron.psection' # <_frozen_importlib_external.SourceFileLoader object at 0x562e7d6213c8>
import 'neuron' # <_frozen_importlib_external.SourceFileLoader object at 0x562e7c9f23e8>
>>>
>>> neuron.__version__
'7.6.6'
>>>
RBJ
Posts: 62
Joined: Sun Aug 02, 2015 4:28 am
Location: UK
Contact:

Re: No module named hoc37

Post by RBJ »

Thank you, so yes tried these:
firstly

Code: Select all

python3 -v
Gives:

Code: Select all

import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# /home/richard/anaconda3/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/encodings/__init__.py
# code object from '/home/richard/anaconda3/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/__pycache__/codecs.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/codecs.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/codecs.cpython-37.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986c5a58>
# /home/richard/anaconda3/lib/python3.7/encodings/__pycache__/aliases.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/encodings/aliases.py
# code object from '/home/richard/anaconda3/lib/python3.7/encodings/__pycache__/aliases.cpython-37.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986de470>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986c5518>
# /home/richard/anaconda3/lib/python3.7/encodings/__pycache__/utf_8.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/encodings/utf_8.py
# code object from '/home/richard/anaconda3/lib/python3.7/encodings/__pycache__/utf_8.cpython-37.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986e8198>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /home/richard/anaconda3/lib/python3.7/encodings/__pycache__/latin_1.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/encodings/latin_1.py
# code object from '/home/richard/anaconda3/lib/python3.7/encodings/__pycache__/latin_1.cpython-37.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986e8c50>
# /home/richard/anaconda3/lib/python3.7/__pycache__/io.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/io.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/io.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/__pycache__/abc.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/abc.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/abc.cpython-37.pyc'
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986ee278>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986e8e80>
# /home/richard/anaconda3/lib/python3.7/__pycache__/site.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/site.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/site.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/__pycache__/os.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/os.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/os.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/__pycache__/stat.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/stat.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/stat.cpython-37.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa698688518>
# /home/richard/anaconda3/lib/python3.7/__pycache__/posixpath.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/posixpath.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/posixpath.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/__pycache__/genericpath.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/genericpath.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/genericpath.cpython-37.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa69868cfd0>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa698688c50>
# /home/richard/anaconda3/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/_collections_abc.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa69868b630>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986fc1d0>
# /home/richard/anaconda3/lib/python3.7/__pycache__/_sitebuiltins.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/_sitebuiltins.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/_sitebuiltins.cpython-37.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986fc588>
# /home/richard/anaconda3/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/_bootlocale.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc'
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986b26a0>
# /home/richard/anaconda3/lib/python3.7/__pycache__/types.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/types.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/types.cpython-37.pyc'
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986256a0>
# /home/richard/anaconda3/lib/python3.7/importlib/__pycache__/__init__.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/importlib/__init__.py
# code object from '/home/richard/anaconda3/lib/python3.7/importlib/__pycache__/__init__.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/__pycache__/warnings.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/warnings.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/warnings.cpython-37.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa69862b550>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa698625a58>
# /home/richard/anaconda3/lib/python3.7/importlib/__pycache__/util.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/importlib/util.py
# code object from '/home/richard/anaconda3/lib/python3.7/importlib/__pycache__/util.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/importlib/__pycache__/abc.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/importlib/abc.py
# code object from '/home/richard/anaconda3/lib/python3.7/importlib/__pycache__/abc.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/importlib/__pycache__/machinery.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/importlib/machinery.py
# code object from '/home/richard/anaconda3/lib/python3.7/importlib/__pycache__/machinery.cpython-37.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa698644128>
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa698637898>
# /home/richard/anaconda3/lib/python3.7/__pycache__/contextlib.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/contextlib.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/contextlib.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/collections/__pycache__/__init__.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/collections/__init__.py
# code object from '/home/richard/anaconda3/lib/python3.7/collections/__pycache__/__init__.cpython-37.pyc'
# /home/richard/anaconda3/lib/python3.7/__pycache__/operator.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/operator.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/operator.cpython-37.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6985f0710>
# /home/richard/anaconda3/lib/python3.7/__pycache__/keyword.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/keyword.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/keyword.cpython-37.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6985fb8d0>
# /home/richard/anaconda3/lib/python3.7/__pycache__/heapq.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/heapq.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/heapq.cpython-37.pyc'
# extension module '_heapq' loaded from '/home/richard/anaconda3/lib/python3.7/lib-dynload/_heapq.cpython-37m-x86_64-linux-gnu.so'
# extension module '_heapq' executed from '/home/richard/anaconda3/lib/python3.7/lib-dynload/_heapq.cpython-37m-x86_64-linux-gnu.so'
import '_heapq' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fa6986017f0>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa698601278>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# /home/richard/anaconda3/lib/python3.7/__pycache__/reprlib.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/reprlib.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/reprlib.cpython-37.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986018d0>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986528d0>
# /home/richard/anaconda3/lib/python3.7/__pycache__/functools.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/functools.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/functools.cpython-37.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa698652cc0>
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa698637f60>
import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa69862bba8>
# possible namespace for /home/richard/anaconda3/lib/python3.7/site-packages/mpl_toolkits
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa6986eee10>
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
# extension module 'readline' loaded from '/home/richard/anaconda3/lib/python3.7/lib-dynload/readline.cpython-37m-x86_64-linux-gnu.so'
# extension module 'readline' executed from '/home/richard/anaconda3/lib/python3.7/lib-dynload/readline.cpython-37m-x86_64-linux-gnu.so'
import 'readline' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fa696c072e8>
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# /home/richard/anaconda3/lib/python3.7/__pycache__/rlcompleter.cpython-37.pyc matches /home/richard/anaconda3/lib/python3.7/rlcompleter.py
# code object from '/home/richard/anaconda3/lib/python3.7/__pycache__/rlcompleter.cpython-37.pyc'
import 'rlcompleter' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa696c07400>
>>>
Hello World works fine then

Code: Select all

import neuron
Gives:

Code: Select all

# /usr/local/nrn/lib/python/neuron/__pycache__/__init__.cpython-37.pyc matches /usr/local/nrn/lib/python/neuron/__init__.py
# code object from '/usr/local/nrn/lib/python/neuron/__pycache__/__init__.cpython-37.pyc'
Traceback (most recent call last):
  File "/usr/local/nrn/lib/python/neuron/__init__.py", line 106, in <module>
    import hoc
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'hoc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/nrn/lib/python/neuron/__init__.py", line 111, in <module>
    import neuron.hoc
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: libreadline.so.5: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/nrn/lib/python/neuron/__init__.py", line 114, in <module>
    exec("import neuron.hoc%d%d as hoc" % (sys.version_info[0], sys.version_info[1]))
  File "<string>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'neuron.hoc37'
Thanks!
Richard
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: No module named hoc37

Post by hines »

I was surprised that there did not seem to be an explicit attempt during import to load the file
hoc.cpython-37m-x86_64-linux-gnu.so
I would be curious what happens if you temporarily
cp hoc.cpython-37m-x86_64-linux-gnu.so hoc.so # be sure to make a copy of hoc.so first!!!
cp hoc.cpython-37m-x86_64-linux-gnu.so hoc37.so
and try again.
I'm also wondering about why the second try 'import neuron.hoc' raised
ImportError: libreadline.so.5: cannot open shared object file: No such file or directory

Can you show the output of
ldd /usr/local/nrn/lib/python/neuron/hoc.cpython-37m-x86_64-linux-gnu.so

In my hands one of the output lines is
libreadline.so.5 => /lib/x86_64-linux-gnu/libreadline.so.5 (0x00007fb9bbac0000)

What libreadline exists in your /lib/x86_64-linux-gnu
I have libreadline versions for 5, 6, 7
You might be able to fix with
sudo apt install libreadline5
It that fixes your issue i need to ponder why the neuron install of the deb file did not automatically download and install the correct readline.
(0f course all this assumes i am not barking up the wrong tree.)
RBJ
Posts: 62
Joined: Sun Aug 02, 2015 4:28 am
Location: UK
Contact:

Re: No module named hoc37

Post by RBJ »

Thanks,
cp hoc.cpython-37m-x86_64-linux-gnu.so hoc.so # be sure to make a copy of hoc.so first!!!
cp hoc.cpython-37m-x86_64-linux-gnu.so hoc37.so
so copying that file to those two alternative hoc.so and hoc37.made no difference that I can see.
However:
ldd /usr/local/nrn/lib/python/neuron/hoc.cpython-37m-x86_64-linux-gnu.so
output includes the revealing libreadline.so.5 "not found"

Code: Select all

	linux-vdso.so.1 (0x00007ffce7de3000)
	libnrnpython3.so.0 => /usr/local/nrn/x86_64/lib/libnrnpython3.so.0 (0x00007fa4ac420000)
	libnrnoc.so.0 => /usr/local/nrn/x86_64/lib/libnrnoc.so.0 (0x00007fa4ac1c5000)
	liboc.so.0 => /usr/local/nrn/x86_64/lib/liboc.so.0 (0x00007fa4abf8d000)
	libnrniv.so.0 => /usr/local/nrn/x86_64/lib/libnrniv.so.0 (0x00007fa4abc4c000)
	libivoc.so.0 => /usr/local/nrn/x86_64/lib/libivoc.so.0 (0x00007fa4ab92a000)
	libmemacs.so.0 => /usr/local/nrn/x86_64/lib/libmemacs.so.0 (0x00007fa4ab712000)
	libmeschach.so.0 => /usr/local/nrn/x86_64/lib/libmeschach.so.0 (0x00007fa4ab4bd000)
	libneuron_gnu.so.0 => /usr/local/nrn/x86_64/lib/libneuron_gnu.so.0 (0x00007fa4ab2af000)
	libscopmath.so.0 => /usr/local/nrn/x86_64/lib/libscopmath.so.0 (0x00007fa4ab08a000)
	libsparse13.so.0 => /usr/local/nrn/x86_64/lib/libsparse13.so.0 (0x00007fa4aae76000)
	libsundials.so.0 => /usr/local/nrn/x86_64/lib/libsundials.so.0 (0x00007fa4aac42000)
	libreadline.so.5 => not found
	libIVhines.so.3 => /usr/local/iv/x86_64/lib/libIVhines.so.3 (0x00007fa4aa83a000)
	libpython3.7m.so.1.0 => not found
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa4aa4b1000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa4aa0c0000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa4a9ea8000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa4a9b0a000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa4a9906000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa4a96e7000)
	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fa4a93af000)
	libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fa4a9185000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fa4ac858000)
	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fa4a8f5d000)
	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fa4a8d59000)
	libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fa4a8b53000)
	libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fa4a893e000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa4a8736000)
sudo apt install libreadline5
sorts out the libreadline.so.5 not found error... but

Code: Select all

libpython3.7m.so.1.0 => not found
remains (and still neuron no va -same HOC37 error).
...so where do I get libpython3.7mso.1.0?
Kind Regards
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: No module named hoc37

Post by hines »

so copying that file to those two alternative hoc.so and hoc37.made no difference
Actually, I'm relieved that I don't have to hunt up further documentation on variations of the python3 shared library module naming standard.
libpython3.7m.so.1.0 => not found
This is the main anaconda python library and something similar was undoubtedly loaded when you launched python3
I'm kind of curious about what you see with

Code: Select all

ldd `which python3`
On my machine I see the line
libpython3.7m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0 (0x00007f1afd160000)
Anyway, is there a file of that name within your anaconda installation.
In the old days we'd start thinking in terms of LD_LIBRARY_PATH but I think the right approach nowadays is to run ldconfig

I think we are close in the sense that things will work if the system can find all the referenced shared libraries that are explicitly listed with
ldd
RBJ
Posts: 62
Joined: Sun Aug 02, 2015 4:28 am
Location: UK
Contact:

Re: No module named hoc37

Post by RBJ »

I am sorry, I don't know the
ldd `which python3`
instruction, but it returned this

Code: Select all

linux-vdso.so.1 (0x00007ffdbc3fb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff4e8c09000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff4e8818000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff4e8614000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007ff4e8411000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff4e8209000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff4e7e6b000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff4e9199000)
...I still kind of think this will turn out to be something stupid I have done though, because I have the same error on both the two Ubuntu systems I setup!
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: No module named hoc37

Post by hines »

Although my default python3 comes from python.org, I also have anaconda3 (python3.7) installed and I see that the library you need is in
/where/you/installed/anaconda3/lib
So try
export LD_LIBRARY_PATH=/where/you/installed/anaconda3/lib
and see if things launch correctly.

I mean
export LD_LIBRARY_PATH=/home/richard/anaconda3/lib
RBJ
Posts: 62
Joined: Sun Aug 02, 2015 4:28 am
Location: UK
Contact:

Re: No module named hoc37

Post by RBJ »

Ah ha!!
so now I loaded python with simply

Code: Select all

python3

Code: Select all

from neuron import gui
successfully brings up the menus!!

In fact still no go through spyder, but I am sure I can work it out from here!
Thanks!
..,.and so to bed (UK)...
R.
RobinDS
Posts: 22
Joined: Mon Nov 04, 2019 12:17 pm

Re: No module named hoc37

Post by RobinDS »

I had the same issue, using python -v quickly led me to the same missing libreadline5. sudo apt install libreadline5 resolved the issue
Post Reply