ssanderson / python-interface

Minimal Pythonic Interface Definitions
https://interface.readthedocs.io/en/latest/
Apache License 2.0
111 stars 16 forks source link

unable to import interface: ModuleNotFoundError: No module named 'interface' #43

Closed budhiraja closed 3 years ago

budhiraja commented 3 years ago

I installed python-interface package via pip: pip install python-interface with the following output:

Requirement already satisfied: python-interface in c:\users\amar budhiraja\.conda\envs\keras\lib\site-packages (1.6.0)
Requirement already satisfied: six in c:\users\amar budhiraja\.conda\envs\keras\lib\site-packages (from python-interface) (1.12.0)

I then try to call it using the following import statement: from interface import implements, Interface but it results in the following import error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'interface'

Can someone point me to what I might be missing? I did restart my terminal after the installation of the package.

ssanderson commented 3 years ago

@budhiraja that looks like the correct command for installation. It sounds to me like the environment you're installing to might not be the one that you're running. From the pip output in your first snippet, it looks like python-interface is being installed to a conda env in c:\users\amar budhiraja\.conda\envs\keras. Is it possible that the command that's failing is using a different python environment? You should be able to check what environment your script is in by printing sys.prefix or sys.executable.

ssanderson commented 3 years ago

Closing this as stale.