gpt4 book ai didi

python fedex api问题

转载 作者:太空宇宙 更新时间:2023-11-04 04:45:47 25 4
gpt4 key购买 nike

我想使用 FedEx API 在 python 中进行运输。我安装了 FedEx express 库:

pip install fedex

但是当我尝试使用它时出现错误。请帮忙。

from fedex.config import FedexConfig

CONFIG_OBJ = FedexConfig(key='<key>',
password='<pass>',
account_number='<account_no>',
meter_number='<meter_no>')

错误

Traceback (most recent call last):
File "test.py", line 1, in <module>
from fedex.config import FedexConfig
ImportError: No module named config

安装和升级

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...

最佳答案

你能让这个包工作吗?虽然我能够在 config_obj 中定义所有内容,但在尝试通过下面的代码(输入正确的跟踪编号)跟踪包裹时,我不断收到“FedexTrackRequests is not defined”错误。

track = FedexTrackRequest(CONFIG_OBJ)
tracking_num = '############3'
track.SelectionDetails.PackageIdentifier.Type = 'TRACKING_NUMBER_OR_DOORTAG'
track.SelectionDetails.PackageIdentifier.Value = tracking_num
track.send_request()

关于python fedex api问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49678975/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com