我在尝试运行以下代码时遇到了ModuleNotFoundError: No module named 'swagger_client'的问题。
如何导入 swagger_client?
我想访问自定义 api。
我的代码:
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.BookingApi()
reservationId = # Long | reservation id
try:
# Cancel reservation
api_response = api_instance.cancel_reservation(reservationId)
pprint(api_response)
except ApiException as e:
print("Exception when calling BookingApi->cancelReservation: %s\n" % e)