草庐IT

distributed-computing

全部标签

python - Django 模型 : Save computed value in a model field

我想保存带有计算字段的Django模型,以便我可以对其应用搜索。classTestModel(models.Model):x=models.CharField(max_length=16)z=models.CharField(max_length=16)#Iwantafieldlikebelowandalsosavesindatabse#computed=computed()defcomputed(self):result=self.x+self.yreturnresult 最佳答案 classTestModel(models.Mo

python - 为什么在 Dask/Distributed worker 中计算要慢得多?

与在本地运行相比,我有一个计算在Dask/Distributedworker中运行得慢得多。我可以在不进行任何I/O的情况下重现它,因此我可以排除它与传输数据有关。以下代码是一个最小的复制示例:importtimeimportpandasaspdimportnumpyasnpfromdask.distributedimportClient,LocalClusterdefgen_data(N=5000000):"""Dummydatagenerator"""df=pd.DataFrame(index=range(N))forcinrange(10):df[str(c)]=np.rando

python - salt 栈 : Properties (computed values) for data from SLS files?

我们在salt管理的minions上运行多个Python虚拟环境。系统的名称是按此架构构建的:project_customer_stage例子:supercms_favoritcustomer_p支柱数据:systems:-customer:favoritcustomerproject:supercmsstage:p-customer:favoritcustomerproject:supercmsstage:q对于每个virtualenv,我们都有一个linux用户。到目前为止,我们像这样计算像“home”这样的值:{%forsysteminpillar.systems%}{%sets

python - 安装 "distribute": NameError: name 'sys_platform' is not defined 时遇到问题

我正在尝试安装Python包“distribute”。我已经下载了它并开始工作,但随后退出并显示此处的错误:我感觉这个解决方案在某种程度上与我进入并定义sys_platform相关,但我对实际上的错误没有足够的了解,不知道要修复什么。谢谢你的帮助!我总是对你们的帮助感到震惊。 最佳答案 正如Burhan所述,您必须安装setuptools包:只需使用以下命令:pipinstallsetuptools最重要的是,不要忘记同时卸载distribute包(因为该包提供的工具已包含在setuptools中)。只需使用命令:pipuninst

python - 错误 : No matching distribution found for pip

我正在尝试在我的python2.6.6中安装pip,我有OracleLinux6我按照此链接给出的答案Link我下载了get-pip.py文件并运行了以下命令sudopython2.6get-pip.py但是我得到以下错误[root@bigdatadev3Downloads]#sudopython2.6get-pip.pyDEPRECATION:Python2.6isnolongersupportedbythePythoncoreteam,pleaseupgradeyourPython.AfutureversionofpipwilldropsupportforPython2.6Coll

python - 使用 Google Compute Engine 时,“EntryPoint”对象没有属性 'resolve'

我有一个与Python中的密码学包相关的问题。如果可能的话,你能帮忙解决这些问题吗?(尝试了很多,但无法找出确切的解决方案)引发此错误的python代码:print("Salt:%s"%salt)server_key=pyelliptic.ECC(curve="prime256v1")#----->>Line2print("Server_key:%s"%server_key)#----->>Line3server_key_id=base64.urlsafe_b64encode(server_key.get_pubkey()[1:])http_ece.keys[server_key_id

python - 如何让 virtualenv 默认使用最新版本的 distribute?

我经常使用virtualenv来保持为项目安装的依赖项的正确版本。virtualenvapps--distribute问题是当使用它时,virtualenv继续安装distribute==0.6.19我需要每次都先运行:pipinstalldistribute-U为什么会这样,我怎样才能让它直接安装正确版本的distribute?谢谢。 最佳答案 关于在python-virtualenv上更新pip也有类似的问题列表。为了方便起见,我在这里重复了一遍:如果您使用的是最新的virtualenv,您还可以使用--extra-search

python - 我可以在 Dask/Distributed 中使用从 .py 文件导入的函数吗?

我有一个关于序列化和导入的问题。函数应该有自己的导入吗?likeI'veseendonewithPySpark以下是完全错误的吗?mod.py是否需要是conda/pip包?mod.py已写入共享文件系统。In[1]:fromdistributedimportExecutorIn[2]:e=Executor('127.0.0.1:8786')In[3]:eOut[3]:In[4]:importsocketIn[5]:e.run(socket.gethostname)Out[5]:{'172.20.12.7:53405':'n1015','172.20.12.8:53779':'n101

python - 使用 setuptools/distribute 打包资源

我正在开发一个Pythonegg,它有几个.txt依赖项(它们是egg本身用来生成文件的模板),我正在努力将这些依赖项复制到site-packages在setup.pyinstall期间。根据distributedocumentation...我的包的文件系统:setup.pypackage|---__init__.py|---main.py|---binary(callsmain.pywithpkg_resources.load_entry_point)|---templates|--file1.txt|--file2.txt在setup.py中:setup([...]eager_r

python - 如何在单线程中运行 dask.distributed 集群?

如何在单个线程中运行完整的Dask.distributed集群?我想用它来调试或分析。注意:这是一个常见问题。我将这里的问题和答案添加到StackOverflow以供将来重用。 最佳答案 本地调度器如果您可以使用单机调度程序的API(只是计算),那么您可以使用单线程调度程序x.compute(scheduler='single-threaded')分布式调度器-单机如果你想在单台机器上运行dask.distributed集群,你可以不带参数启动客户端fromdask.distributedimportClientclient=Cli