【问题标题】:"ModuleNotFoundError: No module named 'kucoin'" but I have it installed and also tried reinstalling but same result. Running python 3.8.10“ModuleNotFoundError:没有名为 'kucoin' 的模块”,但我已安装它并尝试重新安装,但结果相同。运行 python 3.8.10
【发布时间】:2022-01-07 01:16:45
【问题描述】:
import json
import os
import threading
from kucoin.client import Client

api_key = ""
api_secret = ""
passphrase = ""
client = Client(api_key, api_secret, passphrase)

def printit():
    threading.Timer(5.0, printit).start()
    pull = client.get_tick()
    cointType = pull[0]['coinType']
    print(coinType)

printit()

它说: "文件"...",第 4 行,在 从 kucoin.client 导入客户端 ModuleNotFoundError: 没有名为 'kucoin' 的模块"

【问题讨论】:

  • 请添加更多信息,例如,您是如何安装kucoin的?

标签: python module modulenotfounderror


【解决方案1】:

您正在使用相对导入,请检查目录结构。 我建议您使用绝对导入,在运行脚本之前,运行命令 export PYTHONPATH=。

导出 PYTHONPATH=。 python my_module/ma​​in.py

显然您的脚本找不到您正在使用的模块。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-24
    • 2019-09-28
    • 1970-01-01
    • 2023-01-08
    • 1970-01-01
    • 1970-01-01
    • 2020-06-03
    • 1970-01-01
    相关资源
    最近更新 更多