难以在Pythonanywhere字段中导入多个模块

问题描述 投票:0回答:1

[尝试在pythonanywhere上运行此代码,以在早上向即将面试的人发送自动提醒。它在我第一次运行pythonanywhere.py文件时有效,但以后每次都中断。 .ipynb文件上不会发生此错误。

#Import pandas for dataframes
#Import datetime to check day 
import numpy as np
import pandas as pd 
import datetime
import requests 
from twilio.rest import Client

#datetime_object = datetime.datetime.now() #Get current time
today = datetime.date.today() #Get current day 
today = pd.Timestamp(today) #Convert current day into usable formate
interviewees = pd.ExcelFile('/home/drblessing/InterviewCandidates.xlsx') #Load in list of interview candidates
interviews_df = interviewees.parse() #Parse interview candidates into dataframe
Reminders = (interviews_df['Date'] - datetime.timedelta(days=1)) #Take their interview day and subtract one to send out reminder
Reminders_df = interviews_df[Reminders == today] #Checking which candidates have reminders today 
Reminder_phones = pd.Series.tolist(Reminders_df['Phone'])
Reminder_emails = pd.Series.tolist(Reminders_df['Email'])
account_sid = '****************************'
auth_token = '5**************************'
client = Client(account_sid, auth_token)

for i in Reminder_phones:
    message = client.messages.create(
                              body='Hi there! This is an automated message to remind you about your interview on 2/20 at 1:00 pm. ',
                              from_='**********',
                              to=['******************']
                          )
    print(message.sid)

def send_simple_message():
    return requests.post(
        "https://api.mailgun.net/v3/dbless.net/messages",
        auth=("api", "*********************************"),
        data={"from": "urmom <[email protected]>",
            "to": Reminder_emails,
            "subject": "Test",
            "text": "I had to show python who's BOSS "})

send_simple_message()

但是,第一次运行后出现此错误:

RuntimeError:Implement_array_function方法已经有一个文档字符串

python numpy pythonanywhere
1个回答
1
投票

Twilio开发人员推广人员在这里。

似乎是a problem with numpy。有建议将numpy降级为1.15.4版本可能会有所帮助。

顺便说一句,我知道熊猫教程通常会导入numpy,但它们会继续在脚本中稍后使用。在这种情况下,您似乎在任何地方都没有使用numpy,因此可以删除该导入并查看脚本是否仍然有效吗?

© www.soinside.com 2019 - 2024. All rights reserved.