ModuleNotFoundError:没有名为'ebaysdk'的模块

时间:2017-07-05 17:10:42

标签: python-3.x ebay-api

我正在尝试执行以下代码,但是我在标题中收到错误。使用pip3安装ebaysdk,然后使用easy_install仍然是错误,尽管在安装时满足所有依赖项,但没有ebaysdk.py文件,请参阅下面的代码:

import datetime
from ebaysdk.exception import ConnectionError
from ebaysdk.finding import Connection

try:
    api = Connection(appid=**<mykey>**, config_file='ebay.yaml')
    response = api.execute('findItemsAdvanced', {'keywords': 'legos'})

    assert(response.reply.ack == 'Success')
    assert(type(response.reply.timestamp) == datetime.datetime)
    assert(type(response.reply.searchResult.item) == list)

    item = response.reply.searchResult.item[0]
    assert(type(item.listingInfo.endTime) == datetime.datetime)
    assert(type(response.dict()) == dict)

except ConnectionError as e:
    print(e)
    print(e.response.dict())

我正在使用Python 3.6(Anaconda),使用 timotheus' ebaysdk - https://github.com/timotheus/ebaysdk-python

非常感谢你的帮助。

2 个答案:

答案 0 :(得分:0)

问题解决了。

除了3.6我还有3.5.2和2.7。摆脱所有版本并重新安装干净的3.6。

答案 1 :(得分:0)

以下解决方案对我有用:

我在安装ebaysdk时遇到了这个问题:

pip3 install ebaysdk

卸载后,我再次使用:

pip install ebaysdk

这对我来说很好