我想保留virtualenv中包含的所有内容.这可能与OpenCV有关吗?我可以从头开始构建,我只需要首先设置virtualenv然后使用特殊的编译标志来告诉它安装到哪里?
基本上我的python包设置如下:
module
\_examples
\_folder1
\_file1.py
\_file2.py
\_folder2
\_file1.py
\_file2.py
Run Code Online (Sandbox Code Playgroud)
基本上我只想使用:
package_data = {
'module': ['examples/*'],
},
Run Code Online (Sandbox Code Playgroud)
因为我的项目总是让人们添加示例,我希望从我的应用程序中轻松列出它们.我可以在示例中为任何FILE工作,但不能通过子目录重新编译.这可能吗?
我最初试图运行一个似乎陷入CrashBackoffLoop的Job.这是服务文件:
apiVersion: batch/v1
kind: Job
metadata:
name: es-setup-indexes
namespace: elk-test
spec:
template:
metadata:
name: es-setup-indexes
spec:
containers:
- name: es-setup-indexes
image: appropriate/curl
command: ['curl -H "Content-Type: application/json" -XPUT http://elasticsearch.elk-test.svc.cluster.local:9200/_template/filebeat -d@/etc/filebeat/filebeat.template.json']
volumeMounts:
- name: configmap-volume
mountPath: /etc/filebeat/filebeat.template.json
subPath: filebeat.template.json
restartPolicy: Never
volumes:
- name: configmap-volume
configMap:
name: elasticsearch-configmap-indexes
Run Code Online (Sandbox Code Playgroud)
我尝试删除该作业,但只有在运行以下命令时它才会起作用:
kubectl delete job es-setup-indexes --cascade=false
Run Code Online (Sandbox Code Playgroud)
之后我注意到跑步时:
kubectl get pods -w
Run Code Online (Sandbox Code Playgroud)
我会得到一个处于错误状态的TON的pod,我认为没办法清理它们.以下是运行get pods时输出的一小部分示例:
es-setup-indexes-zvx9c 0/1 Error 0 20h
es-setup-indexes-zw23w 0/1 Error 0 15h
es-setup-indexes-zw57h 0/1 Error 0 21h
es-setup-indexes-zw6l9 0/1 Error 0 16h …Run Code Online (Sandbox Code Playgroud) 所以我有一个类似的问题(请参阅:如何在json模式中执行模式引用的嵌套列表(数组)),但现在我的结构发生了一些变化,似乎无法让它进行验证.
data = {
'VIN': '1234567',
'Vehicle color': blue,
'inspections': [
{'expected': 'MVA',
'found': 0.0,
'inspection': 'Fascia',
'location': 'rear_left',
'state': None},
{'expected': 'MVA',
'found': 0.0,
'inspection': 'Fascia',
'location': 'rear_right',
'state': None},
{'expected': 'UNKNOWN',
'found': 'CPW7',
'inspection': 'liftGateHandle',
'location': 'center_bottom',
'state': True},
{'expected': 'tinted',
'found': 'tinted',
'inspection': 'rearWindowtint',
'location': 'center_top',
'state': True},
],
'model': 'racecar',
'timestamp': '2016-03-03 01:44:00.616000'
}
Run Code Online (Sandbox Code Playgroud)
我使用的是与上一个链接中列出的相同的模式:
schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"inspection": {
"type": "object",
"properties": {
"expected" : { "type" : "string" …Run Code Online (Sandbox Code Playgroud) 有人可以告诉我,我把它打包成一个模块是错误的:https: //github.com/xamox/python-zxing.
我的setup.py如下:
#!/usr/bin/env python
from distutils.core import setup
setup(
name='zxing',
version='0.1',
description="wrapper for zebra crossing (zxing) barcode library",
url='http://simplecv.org',
author='Ingenuitas',
author_email='public.relations@ingenuitas.com',
packages=['zxing'],
)
Run Code Online (Sandbox Code Playgroud)
我想做"进口zxing".我做setup.py install,把它放在/usr/local/lib/python2.7/dist-packages/中,但导入zxing不起作用.
我收到以下错误:
In [1]: import zxing.zxing
---------------------------------------------------------------------------
ResolutionError Traceback (most recent call last)
/home/xamox/<ipython-input-1-9ff7d0755c55> in <module>()
----> 1 import zxing.zxing
/usr/local/bin/zxing.py in <module>()
3 __requires__ = 'zxing==0.1'
4 import pkg_resources
----> 5 pkg_resources.run_script('zxing==0.1', 'zxing.py')
/usr/lib/python2.7/dist-packages/pkg_resources.pyc in run_script(self, requires, script_name)
465 ns.clear()
466 ns['__name__'] = name
--> 467 self.require(requires)[0].run_script(script_name, ns)
468
469
/usr/lib/python2.7/dist-packages/pkg_resources.pyc …Run Code Online (Sandbox Code Playgroud) 我有一个显示滑块的基本程序。我理解它们使用基于事件的回调的概念。我想要做的是说更新一个图像,或者在没有用户交互的情况下自动更新日志,所以它基本上会一直调用这个事件。我不确定是否有回调,但任何建议将不胜感激。
python ×4
distutils ×2
distribution ×1
gtk ×1
install ×1
json ×1
jsonschema ×1
kubectl ×1
kubernetes ×1
module ×1
opencv ×1
pygtk ×1
setup.py ×1
setuptools ×1
virtualenv ×1
vision ×1