Python的新手.我想安装python的多处理模块.我使用的是python 3.6和pip 9.1版.
我收到一个错误,让我相信,由于没有与python 3兼容的多处理模块,可能会发生以下错误.
$ pip3 install multiprocessing
Collecting multiprocessing
Using cached multiprocessing-2.6.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8m/2fkldrg12lg0qzlhpm8yvyq00000gn/T/pip-build-dqdczlx9/multiprocessing/setup.py", line 94
Run Code Online (Sandbox Code Playgroud)
所以,我使用安装模块的pip install multiprocessing安装了模块.我已经在python 3中编写了很多代码,所以我想使用它,我使用pycharm编辑器,我已经配置使用python3.现在,如果我在编辑器中执行代码,它会抛出错误
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Users/kkk/Desktop/testing/multiprocessing.py
Traceback (most recent call last):
File "/Users/testing/multiprocessing.py", line 11, in <module>
p = multiprocessing.Process(target=worker)
AttributeError: module 'multiprocessing' has no attribute 'Process'
Process finished with exit code 1
Run Code Online (Sandbox Code Playgroud)
代码
import multiprocessing
def worker():
"""worker function"""
print ('Worker')
return
if …Run Code Online (Sandbox Code Playgroud) 我正在使用jquery验证框架,我要验证的表单有很多字段,在名称中有连字符,例如退休年龄,街道名称等.
当我验证这些字段时
rules:{
street-name:{
required:true
},
retirement-age:{
required:true
}
} // have error messages for the same.
Run Code Online (Sandbox Code Playgroud)
这些字段生成错误消息Uncaught ReferenceError:赋值中的左侧无效.我无法更改字段的名称,因为这会影响已编写的许多代码.任何人都可以建议替代方案.
PS:页面的Html标记由CMS生成,因此我无法控制它.字段的名称将始终具有连字符,直到我明确地将它们更改为代码.