我有一个 Docker 文件,内容如下:
FROM ubuntu:18.04
RUN apt-get update --fix-missing
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa
RUN apt-get install -y build-essential
RUN apt-get install -y python3.8
RUN apt-get install -y python3-pip python3.8-venv python3.8-dev
ENV VIRTUAL_ENV=/run/env
RUN python3.8 -m venv $VIRTUAL_ENV
Run Code Online (Sandbox Code Playgroud)
构建时出现此错误:
Step 8/8 : RUN python3.8 -m venv $VIRTUAL_ENV
---> Running in d05326069de2
Error: Command '['/run/env/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']'
returned non-zero exit status 2.
Run Code Online (Sandbox Code Playgroud)
当我尝试在它之前添加这一行时:
RUN python3.8 -m ensurepip --upgrade
Run Code Online (Sandbox Code Playgroud)
我收到错误:
File "/usr/lib/python3.8/distutils/sysconfig.py", line 466, in _init_posix …Run Code Online (Sandbox Code Playgroud) 我有一个使用 GraphQL 后端运行的 Vue.js 应用程序,以及作为 Vue.js 样板生成器的 Gridsome。
我正在尝试编写一个 GraphQL 查询以仅返回登录用户的数据,如下所示:
query Blah($test: String!) {
db {
settings (where: {user_id: {_eq: $test}})
{
key
value
}
}
Run Code Online (Sandbox Code Playgroud)
在这里定义了 $test 变量:
export default {
data() {
return {
test: "Va123",
user: null
};
}
}
Run Code Online (Sandbox Code Playgroud)
但我收到此错误消息:
An error occurred while executing query for src/pages/Profile.vue
Error: Variable "$test" of required type "String!" was not provided.
Run Code Online (Sandbox Code Playgroud)
这是用于 Girdsome页面,而不是模板
我正在尝试使用时间序列数据进行多元回归,但是当我将时间序列列添加到模型时,它最终将每个唯一值视为一个单独的变量,就像这样(我的'date'列的类型为datetime) :
est = smf.ols(formula='r ~ spend + date', data=df).fit()
print est.summary()
coef std err t P>|t| [95.0% Conf. Int.]
Intercept -6.249e-10 inf -0 nan nan nan
date[T.Timestamp('2014-10-08 00:00:00')] -2.571e-10 inf -0 nan nan nan
date[T.Timestamp('2014-10-15 00:00:00')] 9.441e-11 inf 0 nan nan nan
date[T.Timestamp('2014-10-22 00:00:00')] 5.619e-11 inf 0 nan nan nan
date[T.Timestamp('2014-10-29 00:00:00')] -8.035e-12 inf -0 nan nan nan
date[T.Timestamp('2014-11-05 00:00:00')] 6.334e-11 inf 0 nan nan nan
date[T.Timestamp('2014-11-12 00:00:00')] 7.9e+04 inf 0 nan nan nan
date[T.Timestamp('2014-11-19 00:00:00')] 1.58e+05 inf 0 …Run Code Online (Sandbox Code Playgroud) 我能够连接到Kubernetes中我的pod中运行的应用程序,但这是基于以下文档的负载均衡器网关:
https://cloud.google.com/container-engine/docs/tutorials/http-balancer
有没有办法在Google Container Engine上运行Web服务器,而无需为每个单独的负载均衡器支付18美元/月?
我经常在Google Kubernetes Engine上的Kubernetes群集上收到有关pod不同步的错误/ ImagePullBackOff错误。但由于无法确定根本原因,因此不确定如何调试问题。
在Google仪表板中,我可以看到ReplicaSet发出警告:Pod错误:ImagePullBackOff
如果我深入到Pod,则可以在日志中看到:消息:Pod同步出错原因:FailedSync
但没有其他。为什么广告连播无法同步?
更新:在日志中进一步查看:
Failed to pull image "cockroachdb/cockroach:v1.1.3": rpc error: code = Unknown desc = failed to register layer: ApplyLayer exit status 1 stdout: stderr: open /usr/share/zoneinfo/right/America/Pangnirtung: no space left on device
Run Code Online (Sandbox Code Playgroud)
我已经为cockroachdb分配了1 GB的持久性存储-尝试增加到10 GB来查看是否可以解决任何问题。或者,我需要增加的节点池的磁盘大小?
我一直在使用sys.settrace函数为我的程序编写一个跟踪器,该跟踪器工作得很好,除了它似乎没有被诸如open('filename.txt')之类的内置函数调用。这种行为似乎没有记录在案,所以我不确定我做错了什么还是预期的行为。我从此处使用Doug Hellmann的“ trace_calls_and_returns”代码作为我的跟踪功能。
如果我无法使用settrace进行此操作,是否有任何方法可以跟踪对open()的调用?我不想使用Linux的strace,因为它将在整个程序中运行(不仅是我要跟踪的部分),而且不会显示我的python行号/文件名等。我考虑的另一个选项是通过包装程序对开放函数进行猴子修补,例如:
import traceback, __builtin__
def wrapped_open(*arg,**kw):
print 'open called'
traceback.print_stack()
f = __builtin__.open(*arg,**kw)
return f
open = wrapped_open
Run Code Online (Sandbox Code Playgroud)
但这对我来说似乎很脆弱。
有人可以建议一种更好的方法吗?
当我将realm.io库添加到我的Android应用程序并尝试运行应用程序时,我在编译期间收到此错误:
错误:任务':compileDebugJava'的执行失败.> java.lang.ClassCastException:com.sun.tools.javac.code.Symbol $ ClassSymbol不能转换为javax.lang.model.element.PackageElement
这是我的build.gradle:
buildscript {
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.2'
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
classpath 'com.jakewharton.hugo:hugo-plugin:1.1.0'
}
}
apply plugin: 'android'
apply plugin: 'crashlytics'
apply plugin: 'com.android.application'
apply plugin: 'hugo'
repositories {
mavenCentral()
jcenter()
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 19
buildToolsVersion '19.1'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude …Run Code Online (Sandbox Code Playgroud) 我可以在Cloud Datalab中导入tensorflow和运行模型,但是如何配置它以使用GPU?
这里的文档只讨论机器,我不知道如何通过Datalab进行配置:https: //cloud.google.com/ml-engine/docs/how-tos/using-gpus
我试过这个:
datalab create --machine-type standard_gpu ml
Run Code Online (Sandbox Code Playgroud)
当我选择us-east1区域时,我收到错误:
Creating the instance ml
ERROR: (gcloud.compute.instances.create) Some requests did not succeed:
- Invalid value for field 'resource.machineType': 'https://www.googleapis.com/compute/v1/projects/project-160204/zones/us-east1-d/machineTypes/standard_gpu'. Machine type with name 'standard_gpu' does not exist in zone 'us-east1-d'.
Run Code Online (Sandbox Code Playgroud) 我已经把gcloud更新到了最新版本(159.0.0)
我创建了一个Google Container Engine节点,然后按照提示中的说明进行操作。
gcloud container clusters get-credentials prod --zone us-west1-b --project myproject
Fetching cluster endpoint and auth data.
kubeconfig entry generated for prod
kubectl proxy
Unable to connect to the server: error executing access token command
"/Users/me/Code/google-cloud-sdk/bin/gcloud ": exit status
Run Code Online (Sandbox Code Playgroud)
知道为什么它无法连接吗?
python ×2
ajax ×1
android ×1
dockerfile ×1
graphql ×1
gridsome ×1
javascript ×1
kubernetes ×1
python-3.x ×1
realm ×1
statsmodels ×1
ubuntu-18.04 ×1
vue.js ×1