Spyder finds a module, but not it's submodule. Works in terminal
See original GitHub issueDescription of your problem
Spyder doesn’t find the submodule of a module, although it finds the module fine. Thus it is finding the location but not recognising the file maybe? It loads the submodule fine in a python or ipython session of the terminal
What steps will reproduce the problem?
- pip install git+https://github.com/markcwill/hashpy.git
- run spyder
- import hashpy
What is the expected output? What do you see instead? Expected output is for it to load normally. It loads normally in a python or ipython session in the normal terminal window. However in Spyder, it seems to only find the normal module (hashpy) and not the submodule (libhashpy) and produces the following error:
import hashpy
Traceback (most recent call last):
File "<ipython-input-4-c4b8cd1c5277>", line 1, in <module>
import hashpy
File "hashpy/__init__.py", line 13, in <module>
from hashpype import HashPype, HashError
File "hashpy/hashpype.py", line 22, in <module>
from hashpy.libhashpy import (mk_table_add, angtable, ran_norm, get_tts, get_gap,
ImportError: No module named libhashpy
The file with libhashpy is directly within the normal module’s folder:
/home/user/anaconda2/lib/python2.7/site-packages/hashpy

Please provide any additional information below I have already done the following:
- uninstalled and reinstalled Spyder
- updated conda and spyder to the newest versions
- uninstalled and reinstalled hashpy
- added the exact path of hashpy’s site-packages folder to the PYTHONPATH window in Spyder
- ran out of ideas
Versions and main components
- Spyder Version: 3.1.4
- Python Version: 2.7.13 64bit
- Qt Version: 5.6.2
- PyQt Version: PyQt5 5.6
- Operating system: Ubuntu 16.04 LTS
Dependencies
Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:
jedi >=0.9.0 : 0.9.0 (OK)
matplotlib >=1.0 : 2.0.2 (OK)
nbconvert >=4.0 : 5.1.1 (OK)
numpy >=1.7 : 1.12.1 (OK)
pandas >=0.13.1 : 0.20.1 (OK)
pep8 >=0.6 : 1.7.0 (OK)
psutil >=0.3 : 5.2.1 (OK)
pyflakes >=0.5.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.6.5 (OK)
qtconsole >=4.2.0: 4.3.0 (OK)
rope >=0.9.4 : 0.10.5 (OK)
sphinx >=0.6.6 : 1.6.1 (OK)
sympy >=0.7.3 : 1.0 (OK)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
Another note: It also doesn’t work in the normal python console of the Spyder IDE. I’m not sure if it’s a true, pure python console or if there’s more happening behind the scenes but I would guess that that implies that it’s something deeper not working than the iPython console?
I’ll try it and let you know what happens in my case.