Questions tagged «python-3.7»




8
Python 3.7数据类中的类继承
我目前正在尝试Python 3.7中引入的新数据类构造。我目前坚持尝试做一些父类的继承。看来参数的顺序已被我当前的方法所破坏,使得子类中的bool参数在其他参数之前传递。这导致类型错误。 from dataclasses import dataclass @dataclass class Parent: name: str age: int ugly: bool = False def print_name(self): print(self.name) def print_age(self): print(self.age) def print_id(self): print(f'The Name is {self.name} and {self.name} is {self.age} year old') @dataclass class Child(Parent): school: str ugly: bool = True jack = Parent('jack snr', 32, ugly=True) …

9
在无法调用更新错误“模块”对象后,pip不再起作用
点更新后,点已完全停止工作。 Z:\>pip install matplotlib Traceback (most recent call last): File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\program files\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Program Files\Python37\Scripts\pip.exe\__main__.py", line 9, in <module> TypeError: 'module' object is not callable 有什么帮助吗? 编辑:我正在Windows 10

3
在Mac上同时安装Python3.6和Python3.7
我正在尝试使用Python3.7在Mac上安装tensorflow。但是,我得到了错误: $ pip3 -v install tensorflow ... Skipping link https://files.pythonhosted.org/packages/56/7a/c6bca0fe52a94ca508731d8b139e7dbd5a36cddc64c19f422f97e5a853e8/tensorflow-1.10.0rc1-cp36-cp36m-win_amd64.whl#sha256=3ab24374888d6a13d55ce2e3cf4ba0c9cd6f824723313db5322512087525cb78 (from https://pypi.org/simple/tensorflow/); it is not compatible with this Python Could not find a version that satisfies the requirement tensorflow (from versions: ) Cleaning up... Removed build tracker '/private/var/folders/4n/9342s4wd3jv0qzwjz8rxrygr0000gp/T/pip-req-tracker-3p60r2lo' No matching distribution found for tensorflow 据我所知,这是因为tensorflow尚不支持Python3.7。作为一种解决方法,我想将Python3.6与3.7一起安装,然后将tensorflow安装到该版本。但是,我是Mac的新手,不确定在不混淆现有的Python版本的情况下执行此操作的正确方法。 我已经尝试过使用brew,但是Python3看起来像它一样具体。做我追求的正确方法是什么?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.