Questions tagged [python-3.7]

Version of the Python programming language released in June 27, 2018. For issues that are specific to Python 3.7. Use the more generic [python] and [python-3.x] tags where possible.

Python 3.7 was released on June 27, 2018 (PEP 537).


Use this tag if your question is specifically related to Python 3.7. Otherwise, use the following guidelines to determine which tag(s) you should add to your question:

  • If your question applies to Python in general, use only the tag.
  • If your question applies to Python 3.x but not to Python 2.x, add the tag .
  • If you aren't sure, tag your question with and mention which version you're using in the post.

References

3992 questions
228
votes
4 answers

What are data classes and how are they different from common classes?

With PEP 557 data classes are introduced into python standard library. They make use of the @dataclass decorator and they are supposed to be "mutable namedtuples with default" but I'm not really sure I understand what this actually means and how…
kingJulian
  • 3,353
  • 2
  • 15
  • 28
118
votes
9 answers

Class inheritance in Python 3.7 dataclasses

I'm currently trying my hands on the new dataclass constructions introduced in Python 3.7. I am currently stuck on trying to do some inheritance of a parent class. It looks like the order of the arguments are botched by my current approach such that…
Mysterio
  • 1,550
  • 2
  • 10
  • 19
100
votes
1 answer

Will OrderedDict become redundant in Python 3.7?

From the Python 3.7 changelog: the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec. Would this mean that OrderedDict will become redundant? The only use I can think of it…
James Hiew
  • 3,514
  • 4
  • 21
  • 33
89
votes
6 answers

update to python 3.7 using anaconda

Python 3.7 alpha version is out, but I haven't been able to find any post on how to update to python 3.7 using Anaconda - maybe they will wait for the official release? Any suggestions?
Dnaiel
  • 6,884
  • 21
  • 58
  • 113
82
votes
3 answers

Data Classes vs typing.NamedTuple primary use cases

Long story short PEP-557 introduced data classes into Python standard library, that basically can fill the same role as collections.namedtuple and typing.NamedTuple. And now I'm wondering how to separate the use cases in which namedtuple is still a…
Oleh Rybalchenko
  • 3,977
  • 2
  • 13
  • 30
76
votes
10 answers

pip no longer working after update error 'module' object is not callable

After a pip update, pip has stopped working completely. 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…
Agustin
  • 1,312
  • 1
  • 5
  • 19
73
votes
3 answers

Installing Python3.6 alongside Python3.7 on Mac

I'm trying to install tensorflow onto a Mac with Python3.7. However, I'm getting the error: $ pip3 -v install tensorflow ... Skipping link…
Sam
  • 1,893
  • 2
  • 21
  • 37
67
votes
6 answers

"RuntimeError: generator raised StopIteration" every time I try to run app

I am trying to run this code: import web urls = ( '/', 'index' ) if __name__ == "__main__": app = web.application(urls, globals()) app.run() But it gives me this error everytime C:\Users\aidke\Desktop>python app.py Traceback (most…
no4syn
  • 673
  • 1
  • 4
  • 4
53
votes
2 answers

AttributeError: type object 'Callable' has no attribute '_abc_registry'

When I open my jupyter notebook I get errors. I use google for help, but I can't find an answer. I'm on macOS mojave and using python 3.7.2.I reinstalled my Jupiter notebook but no change. When I input jupyter notebook. It show me these Last login:…
朱嘉宇
  • 531
  • 1
  • 4
  • 5
50
votes
1 answer

Python 3.7 - asyncio.sleep() and time.sleep()

When I go to the asyncio page, the first example is a hello world program. When I run it on python 3.73, I can't see any different from the normal one, can anyone tell me the difference and give a non-trivial example? In [1]: import asyncio ...: …
an offer can't refuse
  • 2,814
  • 3
  • 22
  • 40
44
votes
2 answers

How to fix " AttributeError at /api/doc 'AutoSchema' object has no attribute 'get_link' " error in Django

We are practicing an example of REST API on the Internet. However, the following error occurred. I tried a way in this link, but the situation hasn't changed. why swagger raises unclear error - Django from django.contrib import admin from…
Tim
  • 457
  • 1
  • 4
  • 7
41
votes
7 answers

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

Importing from pyxdameraulevenshtein gives the following error, I have pyxdameraulevenshtein==1.5.3, pandas==1.1.4 and scikit-learn==0.20.2. Numpy is 1.16.1. Works well in Python3.6, Issue in Python3.7. Has anyone been facing similar issues…
Sachit Jani
  • 411
  • 1
  • 2
  • 4
38
votes
2 answers

Python 3.7 on Ubuntu 20.04

I am preparing a docker image for Ubuntu 20.04 and due to TensorFlow 2.0 requirement, I need Python 3.7. TensorFlow runs on Python 3.5 to 3.7. Running apt install python3 installs Python 3.8 by default and that breaks my TensorFlow installation. Is…
Kunal Shah
  • 721
  • 1
  • 5
  • 12
31
votes
2 answers

How to install python3.7 and create a virtualenv with pip on Ubuntu 18.04?

I'm trying to set up a standard virtual-environment(venv) with python 3.7 on Ubuntu 18.04, with pip (or some way to install packages in the venv). The standard way to install python3.7 seems to be: % sudo apt install python3.7 python3.7-venv %…
GaryO
  • 4,872
  • 1
  • 24
  • 40
31
votes
12 answers

Dataclasses and property decorator

I've been reading up on Python 3.7's dataclass as an alternative to namedtuples (what I typically use when having to group data in a structure). I was wondering if dataclass is compatible with the property decorator to define getter and setter…
GertVdE
  • 575
  • 1
  • 4
  • 9
1
2 3
99 100