Cannot import name 'Paynow'


#1

I am getting this error. ImportError: cannot import name 'Paynow'. I installed paynow==1.0.4 and i am getting this error when i try importing it. Like:

from paynow import Paynow

Can anyone help?


#2

are you using a virtual enviroment ?


#3

Yes i’m using a virtual environment. I want to integrate it into Django


#4

Activate your enviroment and Try running
pip freeze, if on linux use
pip freeze | grep paynow

If you don’t notice paynow in the output it means paynow is not installed, if in case it is run the following command

pip install paynow --upgrade
else run
pip install paynow
or install directly from git repositories

pip install git+git://github.com/paynow/Paynow-Python-SDK

#5
>>> from paynow import Paynow
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/myname/Documents/myprojectfolder/myproject/paynow.py", line 9, in <module>
    from paynow import Paynow
ImportError: cannot import name 'Paynow'

this is the error that i’m getting after following the instructions that you gave me. I am using Ubuntu 18.04


#6

Okay i have discovered where i went wrong… I had created a file named paynow.py so python was trying to import Paynow from that file instead of site packages. I renamed that file and all is working well now Thanks for the help.


#7

lol such minor mistakes can break everything.