Questions tagged [python-3.8]

This tag is for issues that are specific to Python 3.8. For general questions use the more generic [python] and [python-3.x] tags.

Python 3.8 was released on 2019-10-14 (PEP 569).


Use this tag if your question is specifically related to Python 3.8. 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

1757 questions
5
votes
2 answers

Can't use OpenCV-Python in AWS Lambda

I've been trying to get OpenCV into an S3 bucket and then assign it to a lambda layer. Theres very little about this online and what I have seen hasn't worked. I've managed to use docker with the amazon linux environment, and followed this tutorial.…
5
votes
4 answers

Get environment variables in a cloud function

I have a Cloud Function in GCP that queries BigQuery in a specific project/environment. As I have multiple environments I would like to get the current project/environment of the cloud function. This is so that I can access BigQuery in the…
5
votes
1 answer

How to Install python3.8 on debian 10?

i've installed debian 10.0.4 yesterday on my pc. it had python version 3.7.3 installed on it , so i tried to update it to version 3.8.3 and now i have version 3.8.3 installed but when i try to install pip using the official get-pip.py it throws an…
ERAGON
  • 99
  • 1
  • 2
  • 7
5
votes
2 answers

Discordbot using threading raise "RuntimeError: set_wakeup_fd only works in main thread" only on linux

I use the threading module to start a web server and the Discodbot at the same time. Everything runs fine on Windows but as soon as I load it onto my Linux server I get the error: Starting Bot Exception in thread Bot: Traceback (most recent call…
MonteCore
  • 53
  • 3
5
votes
2 answers

How to call Rust async method from Python?

I want to use a Rust async method in Python. I'm trying to use PyO3 or rust-cpython. For example, for sync Rust functions, I can use, #[pyfunction] fn myfunc(a: String) -> PyResult { let mut contents = String::new(); contents =…
Hotte Shen
  • 615
  • 4
  • 19
5
votes
2 answers

for loop - Not enough values to unpack (expected 3, got 2) but I am providing it with 3

def func(a,b,c): for x,y,z in a,b,c: pass func(((1,2),(1,3)),((1,4),(1,5)),(1,2)) I expect x,y,z to get the values (1,2), (1,4), and 1. Instead I'm getting an error: ValueError: not enough values to unpack (expected 3, got 2)
ammhyrs
  • 53
  • 3
5
votes
3 answers

Is it possible to specify the pickle protocol when writing pandas to HDF5?

Is there a way to tell Pandas to use a specific pickle protocol (e.g. 4) when writing an HDF5 file? Here is the situation (much simplified): Client A is using python=3.8.1 (as well as pandas=1.0.0 and pytables=3.6.1). A writes some DataFrame using…
Pierre D
  • 13,780
  • 6
  • 42
  • 72
5
votes
3 answers

AttributeError: 'NoneType' object has no attribute 'time' paramiko

import paramiko key = paramiko.RSAKey.from_private_key_file("abc.pem") ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) print("connecting") ssh.connect(hostname="1.1.1.1", username="abc",…
ForeverNews
  • 73
  • 1
  • 6
5
votes
3 answers

How do I have to match the format between time data ' 01/27/1998' to '%d/%m/%y'?

I just tried to display my birthday(dd/mm/yyyy). And then, I got "ValueError" which is like "time data %r does not match format %r" % and "time data ' 01/27/1998' does not match format '%d/%m/%y'" Here is my code from datetime import datetime,…
user11995259
5
votes
2 answers

How to install opencv-python in python 3.8

I'm having problem during the installation of opencv-python in pycharm. After opening pycharm I click on settings and then project interpreter, I click on '+' and search for the correct module, I started the installation but it fails with Could…
JayJona
  • 429
  • 1
  • 7
  • 24
5
votes
1 answer

Comparing object methods leads to different results in 3.8

Consider this simple class: class A: def method(self): pass def __eq__(self, other): return True Now if I create two instances of the class and compare their 'method' attributes, I get different results in Python 3.7 and 3.8: meth1 =…
planetp
  • 10,603
  • 14
  • 62
  • 124
5
votes
1 answer

Spyder IDE fails to start on Windows 10 with Python 3.8

Note: this issue is fixed in Spyder 4.1.3! (original question) checking out Python 3.8 (x64) on Windows 10, I got into trouble when trying to setup Spyder. Note: the issue was reproducible with a fresh Python installation on a clean Windows-10…
MrFuppes
  • 11,829
  • 3
  • 17
  • 46
5
votes
1 answer

Why is sqrt(x*x + y*y) != math.hypot(x, y) in Python 3.8?

I'm trying to run some tests on the shiny new Python 3.8 and noticed an issue with math.hypot. From the docs: For a two dimensional point (x, y), this is equivalent to computing the hypotenuse of a right triangle using the Pythagorean theorem, …
Eugene Yarmash
  • 119,667
  • 33
  • 277
  • 336
4
votes
2 answers

Different runtime behavior for non-generic typing

Consider these two scenarios: from queue import Queue my_q: Queue[int] = Queue() print(f"queue={my_q}") and from queue import Queue class MyClass(object): def __init__(self): self.my_q: Queue[int] = Queue() my_class =…
cjp94
  • 53
  • 4
4
votes
1 answer

Can bool(datetime) evaluate to False in Python?

If you have a value: Optional[X], a common way to check if it is None is by by using the pattern: from typing import Optional def some_function(value: Optional[str]): if not value: print("oopsie! value is either None or the empty…
Martin Thoma
  • 91,837
  • 114
  • 489
  • 768