I want to use FedEx API for shipping in python. I installed fedex lib:
pip install fedex
but when I try to use it I got an error. Help, please.
from fedex.config import FedexConfig
CONFIG_OBJ = FedexConfig(key='<key>',
password='<pass>',
account_number='<account_no>',
meter_number='<meter_no>')
error
Traceback (most recent call last):
File "test.py", line 1, in <module>
from fedex.config import FedexConfig
ImportError: No module named config
the install, and upgrade
root@server:~# pip install fedex
Requirement already satisfied (use --upgrade to upgrade): fedex in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): suds-jurko in /usr/local/lib/python2.7/dist-packages (from fedex)
root@server:~# pip install fedex --upgrade
Requirement already up-to-date: fedex in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: suds-jurko in /usr/local/lib/python2.7/dist-packages (from fedex)
Cleaning up...
Were you able to get this package to work? While i was able to define everything in the config_obj, i keep getting a "FedexTrackRequests is not defined " error when trying to track a package via code below (with a proper tracking number entered in).
track = FedexTrackRequest(CONFIG_OBJ)
tracking_num = '############3'
track.SelectionDetails.PackageIdentifier.Type = 'TRACKING_NUMBER_OR_DOORTAG'
track.SelectionDetails.PackageIdentifier.Value = tracking_num
track.send_request()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With