草庐IT

matching

全部标签

python - pip install numpy 不起作用 : "No matching distribution found"

我是Python新手。我安装了Python2.7.10,它已经带有pip。我尝试运行此命令来下载NumPy库。D:\workspace\python>pipinstallnumpyCollectingnumpyCouldnotfindaversionthatsatisfiestherequirementnumpy(fromversions:)Nomatchingdistributionfoundfornumpy但是我得到了这个错误。我该如何解决这个问题?我也想知道easy_install和pip的区别。 最佳答案 您现在应该可以使用

python - wxPython 中的 "no matching architecture in universal wrapper"问题?

我在MacOS10.6.4下运行Python2.7,我刚刚从wxPython2.8-osx-unicode-2.8.11.0-universal-py2.7.dmg二进制文件安装了wxPython。我的Python脚本中的importwx行出现奇怪的错误。仅供引用,我可以从PyCrust导入wx模块。我真的不明白我在这里做错了什么。有人可以帮忙吗?File"prod_cons_wx.py",line6,inimportwxFile"/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-packages/wx-2.8-ma

php - 对应于 Python 中 PHP 的 preg_match

我打算将我的一个爬虫迁移到Python。我很乐意使用preg_match和preg_match_all在PHP中。我没有在Python中找到类似于preg_match的合适函数.有人可以帮我这样做吗?比如我想获取之间的内容和,我在PHP中使用以下函数:preg_match_all('/aclass="title"(.*?)/si',$input,$output);而在Python中我无法找出类似的函数。 最佳答案 你正在寻找python的remodule.看看re.findall和re.search.正如您所提到的,您正在尝试使用h

python - Django : Case insensitive matching of username from auth user?

默认情况下,Django将用户名实现为区分大小写,现在为了身份验证,我编写了自己的AuthenticationBackend以在身份验证时处理不区分大小写的用户名。如图:http://blog.shopfiber.com/?p=220现在,问题是:我有各种View和实用方法,可以将username与一些stings进行比较。即request.user.username==username_from_some_other_system_as_str现在,如果用户名是yugal那么:request.user.username=='Yugal'#ReturnsFalse现在,它应该返回Tru

python - 不成功的 TensorSliceReader 构造函数 : Failed to find any matching files for bird-classifier. tfl.ckpt-50912

我正在学习本教程http://www.bitfusion.io/2016/08/31/training-a-bird-classifier-with-tensorflow-and-tflearn/我假设训练已经完成,但系统已重新启动,所以我无法验证100个epoch是否已完成。您能提出修复建议吗?mona@pascal:~/computer_vision/python_playground$pythoninfer.pytest_images/bird_african_fish_eagle.jpgbird_mount_bluebird.jpgnot_a_bird_creativecomm

python - 为什么我得到 "ufunc ' multiply' did not contain a loop with signature matching types dtype ('S32' ) dtype ('S32' ) dtype ('S32' )"with values from raw_input

我正在尝试创建一个非常简单的程序,它将绘制一条抛物线图,其中v是速度,a是加速度,x是时候了。用户将输入v和a的值,然后是v和a以及x将确定y。我试图用这个来做到这一点:x=np.linspace(0.,9.,10)a=raw_input('Acceleration=')v=raw_input('Velocity=')y=v*x-0.5*a*x**2.但是,我一直收到这个错误:TypeError:ufunc'multiply'didnotcontainaloopwithsignaturematchingtypesdtype('S32')dtype('S32')dtype('S32')这

python - 当 re.search() 可以做同样的事情时,为什么要使用 re.match()?

从文档中可以清楚地看出:match()->在字符串的开头应用模式匹配search()->搜索字符串并返回第一个匹配项并且使用'^'且不使用re.M标志的search与match的工作方式相同。那为什么python会有match()呢?不是多余的吗?在Python中保留match()是否有任何性能优势? 最佳答案 pos参数在重要方面表现不同:>>>s="aababcabcd">>>re.compile('a').match(s,pos=2)>>>re.compile('^a').search(s,pos=2)Nonematch使编写

python - 类型错误 : '_sre.SRE_Match' object has no attribute '__getitem__'

我目前遇到此错误,但不知道是什么意思。这是一个scrapypython项目,这是我看到的错误:File"/bp_scraper/bp_scraper/httpmiddleware.py",line22,infrom_crawlerreturncls(crawler.settings)File"/bp_scraper/bp_scraper/httpmiddleware.py",line12,in__init__ifparts[1]:TypeError:'_sre.SRE_Match'objecthasnoattribute'__getitem__'代码:importreimportran

python - Django 南错误 : "there is no enabled application matching ' myapp'"

所以,我终于屈服了,捕获了南方。问题是,每次我尝试按照教程运行"pythonmanage.pyschemamigrationmyapp--initial"我得到一个错误"Thereisnoenabledapplicationmatching'myapp'"--我尝试过的东西--我已经三重检查了我的设置文件,从djangoshell运行ImportSouth没有返回任何错误,并且我已经将包含manage.py的文件夹添加到PYTHONPATH,以及wsgi.py和settings.py。我已经运行了pythonmanage.py和pythonC:\path\to\manage.py变体,

android - match_parent 宽度在 RecyclerView 中不起作用

我的RecyclerView和项目具有match_parent宽度,但结果是:和项目:满: 最佳答案 在onCreateViewHolder中为项目充气的适配器中,inflate调用的第二个参数是null?。如果是这样,请将其更改为parent,这是onCreateViewHolder函数签名中的第一个参数。ViewrootView=LayoutInflater.from(context).inflate(R.layout.itemLayout,parent,false);如果您需要第二个参数为null,那么当您获得有关inflat