Hi,
I am confused about importing python modules in user writing packages. I will try to simplify the problem so that it is easier to track down. My problem is that importing a dependency depends on the location of the python file. When I place the python file below in the Packages/User
folder, everything works without a problem. However, when I place the file in Packages/test
, I get an error message when importing paramiko
(see error below). paramiko is a dependency installed through a different package. Typing “import paramiko” in the console works without errors.
Can anyone help me resolve this problem?
Thanks!
py file
import paramiko
import sublime
import sublime_plugin
class TestCommand(sublime_plugin.TextCommand):
def run(self, edit):
print("test")
error message
File "~/Library/Application Support/Sublime Text 3/Packages/test/test.py", line 2, in <module>
import paramiko
File "~/Library/Application Support/Sublime Text 3/Packages/paramiko/all/paramiko/__init__.py", line 30, in <module>
from paramiko.transport import SecurityOptions, Transport
File "~/Library/Application Support/Sublime Text 3/Packages/paramiko/all/paramiko/transport.py", line 34, in <module>
from paramiko import util
ImportError: cannot import name util