首页 > TAG信息列表 > python-3-7

python-无法安装pyHook软件包“找不到满足pyHook要求的版本”

我试图在pycharm中安装pyHook包,但出现标题错误.我已经使用pip install pyHook-1.5.1-cp37-cp37m-win_amd64.whl在cmd中成功安装了它,但是当我在pycharm中安装它时,出现了上述错误: Collecting pyHook Could not find a version that satisfies the requirement pyHook (from vers

ipython3在python3.7的终端中不起作用

我最近从Python3.6升级到Python3.7.由于已经升级,因此在终端中输入ipython3时出现错误: ~$ipython3 Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 48, in <modu

在Python 3.7中检索长度为零的re.sub()的python 3.6处理

零长度匹配的处理已在python 3.7中更改.考虑使用python 3.6(及更早版本)的以下内容: >>> import re >>> print(re.sub('a*', 'x', 'bac')) xbxcx >>> print(re.sub('.*', 'x', 'bac')) x 我们在python 3.7中获得以下内容

如何在不注释类型的情况下添加数据类字段?

当数据类中存在一个字段,其类型可以是任何类型时,如何省略注释? @dataclass class Favs: fav_number: int = 80085 fav_duck = object() fav_word: str = 'potato' 似乎以上代码实际上并未为fav_duck创建字段.它只是使它成为普通的旧类属性. >>> Favs() Favs(fav_num

在Windows 10上为pthon 3.7安装numpy with pip

我在Windows 10笔记本电脑上安装了python 3.7,因为它已于今天(06/28/2018)正式发布.然后我尝试使用pip安装numpy包 pip install numpy 安装进行但最终失败,出现以下错误: source = func(extension, build_dir) File "numpy\core\setup.py", line 675, in get_mathl

Python 3.7数据类中的类继承

我目前正在尝试使用Python 3.7中引入的新数据类结构.我目前坚持尝试做一些父类的继承.看起来参数的顺序是由我当前的方法拙劣的,这样子类中的bool参数在其他参数之前传递.这导致类型错误. from dataclasses import dataclass @dataclass class Parent: name: str age: in

Tweepy不会安装在python 3.7上;显示“语法错误”

在开始之前,我想作为序言,我对python相对较新,并且在我的这个小项目之前不必使用它.我正在尝试将twitter机器人作为艺术项目的一部分,我似乎无法通过导入来获取.我正在使用macOS High Sierra和Python 3.7.我首先使用安装了tweepy pip3 install tweepy 这似乎工作,因为我能够在fin

cx_Freeze崩溃Python 3.7.0

cx_Freeze 6.0b1(最新版本)是否支持Python 3.7.0?我刚刚创建了一个简单的项目,它适用于Python 3.5.4,但它在Python 3.7.0中没有显示: Fatal Python error: initfsencoding: unable to load the file system codec zipimport.ZipImportError: can’t find module ‘encodings’

Python 3.7:dataclass不会为`eq = False`引发`TypeError`

我在Python 3.7中尝试新的数据类 可以传递dataclass装饰器参数来控制添加到类中的dunder函数. 出于某种原因,装饰器似乎没有为eq = False参数引发TypeError. 根据文档: eq: If true (the default), an __eq__ method will be generated. This method compares the class as if it

python – 如何在pygame中将png图像作为精灵上传,没有黑色背景?

]如何让我的精灵出现在屏幕上.我已经好几天了,我无法让它出现在屏幕上,它一直在屏幕上显示为黑色. 导入pygame pygame.init()win = pygame.display.set_mode((600,600)) pygame.display.set_caption( “拿破仑”) bg = pygame.image.load(“apple.png”).convert()win.blit(bg,[0,0

python – 无法导入数据类模块

今天我从apt-get安装了python 3.7来试用新的dataclasses模块.我单独安装它因为python3.6无法升级到3.7. 当我输入:python3.7 –version时,它给了我:>>> Python 3.7.0a2作为我当前的版本. 问题是我似乎无法导入数据类. 我的import语句是:从dataclasses导入dataclass按照指示here 这是它

Python 3.7 math.remainder和%(模运算符)之间的区别

从What’s New In Python 3.7起  我们可以看到有新的math.remainder.它说 Return the IEEE 754-style remainder of x with respect to y. For finite x and finite nonzero y, this is the difference x - n*y, where n is the closest integer to the exact value of the quot