Python-pushsafer Client error during import

Pushsafer make it easy and safe to get push-notifications in real time on your Android or Windows mobile device, iPhone, iPad and Desktop!

Mit Pushsafer kann man in Echtzeit, einfach und sicher, Push-Benachrichtigungen auf sein iPhone, iPad, Android oder Windows Gerät sowie auf den Desktop senden lassen!

======================
Google Play
App Store
Windows 10 Store
Homepage
skezie
Posts: 3
Joined: 18. Sep 2018, 18:57

Python-pushsafer Client error during import

Postby skezie » 18. Sep 2018, 19:49

Dear,

After installing the python module, I receive the following error when executing the my script.
I'm getting the same error on Windows as on Debian.

from pushsafer import Client
ImportError: cannot import name Client



Any idea what is going wrong ?


sudo pip3 install python-pushsafer
Collecting python-pushsafer
Downloading https://www.piwheels.org/simple/python- ... ne-any.whl
Requirement already satisfied: requests>=1.0 in /usr/local/lib/python3.5/dist-packages (from python-pushsafer)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.5/dist-packages (from requests>=1.0->python-pushsafer)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.5/dist-packages (from requests>=1.0->python-pushsafer)
Requirement already satisfied: idna<2.8,>=2.5 in /usr/local/lib/python3.5/dist-packages (from requests>=1.0->python-pushsafer)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in /usr/local/lib/python3.5/dist-packages (from requests>=1.0->python-pushsafer)
Installing collected packages: python-pushsafer
Successfully installed python-pushsafer-0.4

User avatar
admin
Site Admin
Posts: 336
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: Python-pushsafer Client error during import

Postby admin » 19. Sep 2018, 22:13

works like charme, I just tested it!

You already installed the python-pushsafer package successfully.
Now create a file like pushsafer.py

Past the script:

Code: Select all

from pushsafer import init, Client

init("yourprivatekey")
Client("").send_message("Message", "Hello", "119", "1", "4", "2", "https://www.pushsafer.com", "Open Pushsafer", "0", "2", "60", "600", "1", "", "", "")
Replace your private key and the other parameter to your needs! Save the modification!

Now run the script
Zwischenablage01.png
Zwischenablage01.png (32.31 KiB) Viewed 513 times
DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10

User avatar
admin
Site Admin
Posts: 336
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: Python-pushsafer Client error during import

Postby admin » 19. Sep 2018, 22:22

try to use absolute paths, like discribed here
https://www.pythoncentral.io/execute-py ... ile-shell/
DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10

skezie
Posts: 3
Joined: 18. Sep 2018, 18:57

Re: Python-pushsafer Client error during import

Postby skezie » 20. Sep 2018, 07:37

Strange as I receive the error when it tries to execute the first line in the script: from pushsafer import init, Client
Did you test it also on Python version 3.5 or higher?

skezie
Posts: 3
Joined: 18. Sep 2018, 18:57

Re: Python-pushsafer Client error during import

Postby skezie » 20. Sep 2018, 10:59

Hello, I just did a test again on PythonAnywhere with copy/paste of your code. I just changed the key of course.
Again the installation was succesful but the scripts gives the same error on python 2.5 and 3.7.
I've no idea what I'm missing

10:51 ~ $ cat pushsafer.py
from pushsafer import init, Client
init("?????????????")
Client("").send_message("Message", "Hello", "119", "1", "4", "2", "https://www.pushsafer.com", "Open Pushsafer", "0", "2", "60", "600", "1", "", "", "")

10:51 ~ $ python2 --version
Python 2.7.12
10:51 ~ $ python2 pushsafer.py
Traceback (most recent call last):
File "pushsafer.py", line 1, in <module>
from pushsafer import init, Client
File "/home/skezie/pushsafer.py", line 1, in <module>
from pushsafer import init, Client
ImportError: cannot import name init

10:51 ~ $ python3 --version
Python 3.7.0
10:51 ~ $ python2 pushsafer.py
Traceback (most recent call last):
File "pushsafer.py", line 1, in <module>
from pushsafer import init, Client
File "/home/skezie/pushsafer.py", line 1, in <module>
from pushsafer import init, Client
ImportError: cannot import name init

User avatar
admin
Site Admin
Posts: 336
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: Python-pushsafer Client error during import

Postby admin » 20. Sep 2018, 18:43

yes, tested with version 3.6
Please try to get help in a pyton board, iam not a python developer!

Kevin
DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10


Who is online

Users browsing this forum: No registered users and 3 guests