cloudnativelabs / kube-shell

Kubernetes shell: An integrated shell for working with the Kubernetes
Apache License 2.0
2.38k stars 175 forks source link

Import error #19

Closed blakebarnett closed 7 years ago

blakebarnett commented 7 years ago

After:

$ pip install kube-shell
Collecting kube-shell
  Downloading kube-shell-0.0.18.tar.gz
Requirement already satisfied: prompt-toolkit<1.1.0,>=1.0.0 in /usr/local/lib/python2.7/site-packages (from kube-shell)
Requirement already satisfied: Pygments<3.0.0,>=2.1.3 in /usr/local/lib/python2.7/site-packages (from kube-shell)
Collecting fuzzyfinder>=1.0.0 (from kube-shell)
  Downloading fuzzyfinder-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: click<7.0,>=4.0 in /usr/local/lib/python2.7/site-packages (from kube-shell)
Collecting kubernetes>=0.10.0 (from kube-shell)
  Downloading kubernetes-2.0.0-py2.py3-none-any.whl (718kB)
    100% |████████████████████████████████| 727kB 1.9MB/s
Requirement already satisfied: wcwidth in /usr/local/lib/python2.7/site-packages (from prompt-toolkit<1.1.0,>=1.0.0->kube-shell)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python2.7/site-packages (from prompt-toolkit<1.1.0,>=1.0.0->kube-shell)
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: oauth2client in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: urllib3!=1.21 in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Collecting certifi (from kubernetes>=0.10.0->kube-shell)
  Downloading certifi-2017.4.17-py2.py3-none-any.whl (375kB)
    100% |████████████████████████████████| 378kB 2.9MB/s
Collecting ipaddress (from kubernetes>=0.10.0->kube-shell)
  Downloading ipaddress-1.0.18-py2-none-any.whl
Collecting websocket-client (from kubernetes>=0.10.0->kube-shell)
  Downloading websocket_client-0.44.0-py2.py3-none-any.whl (199kB)
    100% |████████████████████████████████| 204kB 4.8MB/s
Requirement already satisfied: pyyaml in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: pyasn1>=0.1.7 in /usr/local/lib/python2.7/site-packages (from oauth2client->kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: pyasn1-modules>=0.0.5 in /usr/local/lib/python2.7/site-packages (from oauth2client->kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: httplib2>=0.9.1 in /usr/local/lib/python2.7/site-packages (from oauth2client->kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: rsa>=3.1.4 in /usr/local/lib/python2.7/site-packages (from oauth2client->kubernetes>=0.10.0->kube-shell)
Building wheels for collected packages: kube-shell
  Running setup.py bdist_wheel for kube-shell ... done
  Stored in directory: /Users/blakebarnett/Library/Caches/pip/wheels/38/8d/ae/81b7a9f2c80a31a326b3b528af832f294307e963c3add2fd24
Successfully built kube-shell
Installing collected packages: fuzzyfinder, certifi, ipaddress, websocket-client, kubernetes, kube-shell
Successfully installed certifi-2017.4.17 fuzzyfinder-1.0.0 ipaddress-1.0.18 kube-shell-0.0.18 kubernetes-2.0.0 websocket-client-0.44.0

I get this when running it:

Traceback (most recent call last):
  File "/usr/local/bin/kube-shell", line 7, in <module>
    from kubeshell.main import cli
  File "/usr/local/lib/python2.7/site-packages/kubeshell/main.py", line 18, in <module>
    from kubeshell.kubeshell import Kubeshell
  File "/usr/local/lib/python2.7/site-packages/kubeshell/kubeshell.py", line 10, in <module>
    from prompt_toolkit.key_binding.defaults import load_key_bindings_for_prompt
ImportError: No module named defaults
blakebarnett commented 7 years ago

MacOS Sierra 10.12.5 Python 2.7 from homebrew

murali-reddy commented 7 years ago

@blakebarnett it seems there is prompt-toolkit already installed.

Requirement already satisfied: prompt-toolkit<1.1.0,>=1.0.0 in /usr/local/lib/python2.7/site-packages (from kube-shell)

there seems to be problem with installed library. can you try "from prompt_toolkit.key_binding.defaults import load_key_bindings_for_prompt" in python interactive shell. If you see same problem please remove the package, re-install kube-shell.

blakebarnett commented 7 years ago

Ah, looks like prompt_toolkit was v1.0.8 and the latest is v1.0.14, looks like v1.0.8 doesn't have that defaults module. Guess the version dependency just needs a bump.

kbroughton commented 7 years ago

pip install -U prompt_toolkit fixed the problem maybe update the setup requirements.txt to set a min version