Nekmo / amazon-dash

Hack your Amazon Dash to run what you want.
MIT License
828 stars 67 forks source link

ImportError: No module named subprocess32 - But it's installed... #57

Closed gareth305 closed 6 years ago

gareth305 commented 6 years ago

Description

Trying to run the script, it produces an error "ImportError: No module named subprocess32" even though it's installed.

What I Did

pi@raspberrypi:~$ sudo amazon-dash
Welcome to Amazon-dash v1.0.4 using Python 2.7.13
Listening for events. Amazon-dash will execute the events associated with the registered buttons.
Traceback (most recent call last):
  File "/usr/local/bin/amazon-dash", line 6, in <module>
    catch(cli)()
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/exceptions.py", line 91, in wrap
    return fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in `main`
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/management.py", line 99, in run
    from amazon_dash.listener import Listener
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/listener.py", line 6, in <module>
    from amazon_dash.confirmations import get_confirmation
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/confirmations.py", line 5, in <module>
    from amazon_dash._compat import JSONDecodeError
  File "/usr/local/lib/python2.7/dist-packages/amazon_dash/_compat.py", line 18, in <module>
    import subprocess32 as subprocess
 ImportError: No module named subprocess32
pi@raspberrypi:~$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
amazon-dash (1.0.4)
certifi (2018.4.16)
chardet (3.0.4)
click (6.7)
click-default-group (1.2)
cryptography (1.7.1)
enum34 (1.1.6)
functools32 (3.2.3.post2)
idna (2.7)
ipaddress (1.0.17)
jsonschema (2.6.0)
keyring (10.1)
keyrings.alt (1.3)
pip (9.0.1)
pyasn1 (0.1.9)
pycrypto (2.6.1)
pygobject (3.22.0)
pyxdg (0.25)
PyYAML (3.13)
requests (2.19.1)
RPi.GPIO (0.6.3)
scapy (2.4.0)
SecretStorage (2.3.1)
setuptools (33.1.1)
six (1.10.0)
subprocess32 (3.5.2)
urllib3 (1.23)
wheel (0.29.0)
Nekmo commented 6 years ago

Check your pip Python version:

pip --version
gareth305 commented 6 years ago
pi@raspberrypi:~$ pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
Nekmo commented 6 years ago

Your installation directory seems to be different:

pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

/usr/local/lib/python2.7/dist-packages/amazon_dash/management.py

Nekmo commented 6 years ago

Can you reinstall using the latest version of Amazon-dash?

daOoZF8 commented 6 years ago

I have the same error on the rpi. Reinstall with this command sudo python3 -m pip install amazon-dash

pip --version pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

Nekmo commented 6 years ago

@daOoZF8 have you solved the problem?

daOoZF8 commented 6 years ago

@Nekmo yes "sudo python3 -m pip" fixed the error.

Nekmo commented 6 years ago

The support for python 2 gives many problems in some distros. Amazon-dash 2.0 will remove support for python 2.

Regards