小编Vin*_*eph的帖子

UnicodeDecodeError:'ascii'编解码器无法解码位置0的字节0xe5:序数不在范围内(128)

我正在使用Flask和Google App Engine构建Web应用程序.此网络应用程序中的一个页面通过YouTube API拨打电话,以获取带有搜索字词的视频.

我尝试查询时收到以下错误YoutubeVids.html.

这只发生在我通过Jinja2模板将某个参数传递给页面时.

file "/Users/xxxxx/App-Engine/src/templates/YoutubeVids.html", line 1, in top-level template code
    {% extends "master.html" %}
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)

INFO     2014-01-27 22:39:40,963 module.py:612] default: "GET /xxx/yyyy HTTP/1.1" 500 291
Run Code Online (Sandbox Code Playgroud)

youtube api google-app-engine flask

35
推荐指数
2
解决办法
6万
查看次数

docker compose 构建因 IO 超时而失败

我已经安装了 WSL 2.0,我的 docker 版本是

Client:
 Cloud integration: 1.0.17
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.16.4
 Git commit:        f0df350
 Built:             Wed Jun  2 12:00:56 2021
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true
Run Code Online (Sandbox Code Playgroud)

当我尝试构建图像时出现以下错误

Error response from daemon: i/o timeout
Run Code Online (Sandbox Code Playgroud)

docker

14
推荐指数
2
解决办法
2万
查看次数

在Ubuntu 18.04 LTS上安装Google Cloud SDK后,Apt-get损坏

我正在使用以下命令在Ubuntu VM上安装Google Cloud SDK

# Add the Cloud SDK distribution URI as a package source
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

# Update the package list and install the Cloud SDK
sudo apt-get update && sudo apt-get install google-cloud-sdk
Run Code Online (Sandbox Code Playgroud)

我认为它现在坏了。

 apt-get install unixODBC unixODBC-dev
E: Conflicting values set for option Signed-By regarding source https://packages.cloud.google.com/apt/ cloud-sdk: /usr/share/keyrings/cloud.google.gpg != 
E: …
Run Code Online (Sandbox Code Playgroud)

unix unixodbc apt-get google-cloud-sdk ubuntu-18.04

12
推荐指数
2
解决办法
3243
查看次数

错误:“./docker-compose.yml”中的版本不受支持

我正在一个包含相关 docker 文件和 yml 文件的文件夹中运行 docker-compose build。我看到以下错误

root@ubuntu187_demo_2:~/IDOLDockerContainers_12.4.0_COMMON/basic-idol# docker-compose build
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
Run Code Online (Sandbox Code Playgroud)

docker-compose.yml 如下 …

docker docker-compose

12
推荐指数
3
解决办法
2万
查看次数

情节数据框架熊猫不工作

我正在使用熊猫绘制图表.以下是我的功能

count_subset.plot(kind='barh', stacked=True)
Run Code Online (Sandbox Code Playgroud)

我得到的回应是

<matplotlib.axes.AxesSubplot at 0x111fc4ad0>
Run Code Online (Sandbox Code Playgroud)

我无法在任何地方看到图表.我错过了一些图书馆吗?

pandas

10
推荐指数
1
解决办法
5961
查看次数

如何在Google Apps脚本中导入功能

我有两个Apps Script Code.gs和Code2.gs

我想在Code2.gs中导入函数A并在Code.gs中的函数B中使用它.

有任何想法吗 ?

google-apps-script

9
推荐指数
2
解决办法
3528
查看次数

来自gmail新邮件的触发事件

是否存在可以在gmail中捕获的API或事件,以便我可以启动工作流甚至激活python脚本.

我正在尝试自动化一项工作,该工作将从已经到达gmail的电子邮件中提取csv附件.然后它将csv ETL转换为BigQuery.

有什么想法吗 ?

gmail google-bigquery

7
推荐指数
1
解决办法
1844
查看次数

Pandas和Python3.4与Python 2.7共存

我用python2.7安装了pandas.我也安装了python 3.4.

我无法在python3中加载pandas

Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'pandas'
>>> 
Run Code Online (Sandbox Code Playgroud)

我知道我需要单独安装它.我如何在python 2.7和3.4中使用pandas?我顺便使用mac.

pandas python-3.4

7
推荐指数
2
解决办法
7487
查看次数

使用ElementTree获取python3中的所有xml属性值

我有以下xml文件

<?xml version="1.0"?>
<data>
    <country name="Liechtenstein">
        <rank updated="yes">2</rank>
        <year>2008</year>
        <gdppc>141100</gdppc>
        <neighbor name="Austria" direction="E"/>
        <neighbor name="Switzerland" direction="W"/>
    </country>
    <country name="Singapore">
        <rank updated="yes">5</rank>
        <year>2011</year>
        <gdppc>59900</gdppc>
        <neighbor name="Malaysia" direction="N"/>
    </country>
    <country name="Panama">
        <rank updated="yes">69</rank>
        <year>2011</year>
        <gdppc>13600</gdppc>
        <neighbor name="Costa Rica" direction="W"/>
        <neighbor name="Colombia" direction="E"/>
    </country>
</data>
Run Code Online (Sandbox Code Playgroud)

我想使用 ElementTree 编写 python 3 代码来获取所有国家/地区名称。所以最终结果应该是 a dictor arrayof

['列支敦士登'、'新加坡'、'巴拿马']

我正在尝试使用 Xpath 执行此操作,但一无所获。所以我的代码如下

import xml.etree.ElementTree as ET
tree = ET.parse(xmlfile)
root = tree.getroot()

names = root.findall("./country/@name")
Run Code Online (Sandbox Code Playgroud)

但是,以上不起作用,因为我觉得我的 xpath 是错误的。

python xml elementtree python-3.x

6
推荐指数
1
解决办法
1万
查看次数

无法在配置源中找到"日志记录"的配置部分

我得到以下异常.我正在使用Enterprise Library 6.0 Application Logging Block.

    System.InvalidOperationException was unhandled by user code
  HResult=-2146233079
  Message=The configuration section for Logging cannot be found in the configuration source.
  Source=Microsoft.Practices.EnterpriseLibrary.Logging
  StackTrace:
       at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterFactory.LogWriterConfigurationBuilder.Create()
       at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterFactory.Create()
       at Logger..ctor() in \MBSLogger.cs:line 19
       at EventLoggingTest.test_log_simple_exception() in c:\Users\Vinay.Joseph\Documents\Visual Studio 2013\EventLoggingTest.cs:line 20
  InnerException: 
Run Code Online (Sandbox Code Playgroud)

代码库如下.

       IConfigurationSource configurationSource = ConfigurationSourceFactory.Create();
        LogWriterFactory logWriterFactory = new LogWriterFactory(configurationSource);
        Logger.SetLogWriter(logWriterFactory.Create());


        if (!Logger.IsLoggingEnabled())
        {

        }
        else { 
            Logger.Write(new LogEntry(){
                Severity = System.Diagnostics.TraceEventType.Information,
                TimeStamp = DateTime.Now,
                Message = "Hello World"
            });
        }
Run Code Online (Sandbox Code Playgroud)

请告诉我哪里出错了.

c# enterprise-library-6

6
推荐指数
1
解决办法
8124
查看次数