Azelphur / pyPushBullet

Python library to interface with PushBullet
GNU General Public License v3.0
180 stars 48 forks source link

Import Error #50

Open emailtoalex opened 6 years ago

emailtoalex commented 6 years ago

Hello, I have a problem and I ask for help. I am sing Python 3.4.2, downloaded from github the pyPushBullet, which created a folder. I copied the script: pushbullet.py into my project folder and installed additional packages via:

when running a test script as following:

import time from pushbullet import PushBullet api_key t=time.strftime("%Y-%m-%d-%H:%M:%S") api_key = "xxxxxxxx" pb = PushBullet(api_key) devices = pb.getDevices() pb.pushNote(devices[0]["iden"], 'Monitoring is active!', t)

I am gettting the following ERROR code, that: No module named 'websocket'

I am getting crazy, I have downloaded websocket-client several times and tried out several possible solutions, but I can not solve this problem. I am glad for any help. Thank you in advance, best regards, Alex

Azelphur commented 6 years ago

How are you running Python? Are you using python or python3? I am guessing that you're using pip for python 2, while running the script with python 3.

emailtoalex commented 6 years ago

Hello Azelphur, thanks for the fast answer, you are right, I am using python3, was my installation wrong? I guess, that pushbullet is running also with python3. I am not quite familiar and any help would be aprechiated. Thanks.

Azelphur commented 6 years ago

You probably need to use pip3 install to install the packages, then things should work.

emailtoalex commented 6 years ago

Hello, I have still a problem, with Python2 it'll work ;-) But I want to get it working, when using Python3, so I used for the installation in the command window following code: pip3 install websocket-client

Traceback (most recent call last): File "/usr/bin/pip3", line 9, in load_entry_point('pip==1.5.6', 'console_scripts', 'pip3')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load ['name']) File "/usr/lib/python3/dist-packages/pip/init.py", line 74, in from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/usr/lib/python3/dist-packages/pip/vcs/mercurial.py", line 9, in from pip.download import path_to_url File "/usr/lib/python3/dist-packages/pip/download.py", line 25, in from requests.compat import IncompleteRead ImportError: cannot import name 'IncompleteRead'

Running the script, I am getting following error message:

Python 3.4.2 (default, Oct 19 2014, 13:31:11) [GCC 4.9.1] on linux Type "copyright", "credits" or "license()" for more information.

============= RESTART ========>>> Traceback (most recent call last): File "/home/pi/Projekt_Pushover/pushbullet_test.py", line 4, in from pushbullet import PushBullet File "/home/pi/Projekt_Pushover/pushbullet.py", line 18, in from websocket import create_connection ImportError: No module named 'websocket'

Thanks.

emailtoalex commented 6 years ago

Hello, I tried several things, as import websocket, ... installing via pip3 did not function and did not solve the problem. Has anyone an idea? Thanks, Alex

Azelphur commented 6 years ago

You need to provide more information about the problem, you tried via pip3, but it "did not function" - what does this mean? what error did you get?

Make sure the version of python mentioned in the output of pip3 --version and python3 --version are the same.