ImportError: cannot import name DfpClient

508 views
Skip to first unread message

Seth Riney

unread,
Oct 26, 2012, 1:21:55 PM10/26/12
to google-doubleclick...@googlegroups.com
Hi Folks,

I'm new to python, novice with Dfp API (I have been able to do some things through the ruby API).

I ran the setup and config scripts with no problem, but I get an import error when I run a script from examples.

Is there a PATH environment variable that I need to modify with a directory from the python API directory?

Thanks,

Seth

sriney@sriney:~/workspace-rails/dfp_api_py/dfp_api_python_9.5.1$ sudo python setup.py build install
sudo: unable to resolve host sriney
[sudo] password for sriney: 
running build
running build_py
running install
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/adspygoogle.dfp-9.5.1.egg-info
Writing /usr/local/lib/python2.7/dist-packages/adspygoogle.dfp-9.5.1.egg-info
sriney@sriney:~/workspace-rails/dfp_api_py/dfp_api_python_9.5.1$ python --version
Python 2.7.3
sriney@sriney:~/workspace-rails/dfp_api_py/dfp_api_python_9.5.1/examples/adspygoogle/dfp/v201208$ python get_all_line_items.py 
Traceback (most recent call last):
  File "get_all_line_items.py", line 29, in <module>
    from adspygoogle import DfpClient
ImportError: cannot import name DfpClient

Vincent Tsao (DFP API Team)

unread,
Oct 26, 2012, 1:51:32 PM10/26/12
to google-doubleclick...@googlegroups.com
Hi Seth:

Did you install the dependencies listed here:

that are required for this client library?

Thanks,
Vincent Tsao, DFP API Team
Message has been deleted

Vishan Persaud

unread,
Jan 16, 2013, 7:06:43 PM1/16/13
to google-doubleclick...@googlegroups.com
Hi Vincent,

I am having a similar problem and I believe I have all dependencies installed correctly. To confirm, I have ran the setup.py's for PyXML, ZSI, and the dfp client library, in addition to the config.py for the dfp library. this is wildly peculiar as I have successfully set this up on other machines.

Best,
Vish

Vincent Tsao (DFP API Team)

unread,
Jan 16, 2013, 8:05:53 PM1/16/13
to google-doubleclick...@googlegroups.com
Hi Vish:

What versions of Python, the dependencies, and the DFP client library are you using? What OS are you on? Lastly, can you post the stack trace for the error you are getting?

And please double-check the README again just in case:

Thanks,
Vincent Tsao, DFP API Team

Vishan Persaud

unread,
Jan 17, 2013, 9:46:03 AM1/17/13
to google-doubleclick...@googlegroups.com
Python verions: Python 2.6.6
Dependecies: PyXML-0.8.4, ZSI-2.1-a1
OS: This install is on a Red Hat 4.4.6-4 machine

Is this what you where looking for as the requested error?

  File "get_user.py", line 29, in <module>

    from adspygoogle import DfpClient
ImportError: cannot import name DfpClient


Attached is a list of python modules installed.

Thanks,
Vish
modules.rtf

Vincent Tsao (DFP API Team)

unread,
Jan 17, 2013, 2:10:34 PM1/17/13
to google-doubleclick...@googlegroups.com
What version of the Ads Python client library are you using? And what version of fpconst do you have installed?

Can you double-check that the install script for adspygoogle worked properly by running python and then trying to import "adspygoogle".

Also, when testing can you run get_all_networks.py example instead of get_user.py or any other example since it's the simplest.

Thanks,
Vincent Tsao, DFP API Team

Vincent Tsao (DFP API Team)

unread,
Jan 17, 2013, 4:33:32 PM1/17/13
to google-doubleclick...@googlegroups.com
FYI - for anybody else reading this thread, the problem was that he didn't have fpconst installed.

Vincent Tsao, DFP API Team

Vincent Tsao (DFP API Team)

unread,
Jan 17, 2013, 4:33:48 PM1/17/13
to google-doubleclick...@googlegroups.com
FYI - for anybody else reading this thread, the problem was that he didn't have fpconst installed.

Vincent Tsao, DFP API Team


Reply all
Reply to author
Forward
0 new messages