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
11
votes
3 answers

"TypeError: an integer is required (got type bytes)" when importing pyspark on Python 3.8

Created a conda environment: conda create -y -n py38 python=3.8 conda activate py38 Installed Spark from Pip: pip install pyspark # Successfully installed py4j-0.10.7 pyspark-2.4.5 Try to import pyspark: python -c "import…
Dmitry Deryabin
  • 1,320
  • 11
  • 23
11
votes
1 answer

Can assignment expressions be enabled in Python 3.7 using __future__?

Python 3.8 introduces assignment expressions, described in PEP 572. Is there a way to test this new feature in Python 3.7.x? In the past, new language features have been backported to earlier Python versions using __future__ imports. Is there a…
10
votes
4 answers

How to install TensorFlow with Python 3.8

Whenever I try to install TensorFlow with pip on Python 3.8, I get the error that TensorFlow is not found. I have realized later on that it is not supported by Python 3.8. How can I install TensorFlow on Python 3.8?
user12741707
9
votes
1 answer

Sharing array of objects with Python multiprocessing

For this question, I refer to the example in Python docs discussing the "use of the SharedMemory class with NumPy arrays, accessing the same numpy.ndarray from two distinct Python shells". A major change that I'd like to implement is manipulate…
119631
  • 151
  • 8
9
votes
4 answers

python 3.8 venv missing activate command

I compiled Python 3.8.1 under a user's home directory with configure --prefix=/home/a_user/python3.8 --enable-shared When I tried to use venv, I get: python3 -m venv test_env Error: Command '['/home/a_user/test_env/bin/python3', '-Im',…
Richard
  • 168
  • 1
  • 6
9
votes
1 answer

Cannot set field value in assignment expression

With Python 3.8 Assignment Expressions have been introduced, allowing to assign values in conditionals and lambdas as such: if x := True: print(x) However it appears this does not extends to attribute assignment, as trying to do something like…
Maldus
  • 5,454
  • 4
  • 17
  • 31
9
votes
2 answers

Cannot install "psycopg2" on Windows 10 with Python 3.8

Yesterday I uninstalled python 3.7 version by mistake. Then I install python again (this time 3.8 version) and again set up my environment. But I could not start my Django project which has Postgres connection. Actually I cannot install "psycopg2"…
yuv
  • 360
  • 1
  • 5
  • 12
8
votes
2 answers

Docker how to make python 3.8 as default

I'm trying to update an existing Dockerfile to switch from python3.5 to python3.8, previously it was creating a symlink for python3.5 and pip3 like this: RUN ln -s /usr/bin/pip3 /usr/bin/pip RUN ln -s /usr/bin/python3 /usr/bin/python I've updated…
Aarif
  • 1,169
  • 1
  • 16
  • 26
8
votes
1 answer

Deserialization of large numpy arrays using pickle is order of magnitude slower than using numpy

I am deserializing large numpy arrays (500MB in this example) and I find the results vary by orders of magnitude between approaches. Below are the 3 approaches I've timed. I'm receiving the data from the multiprocessing.shared_memory package, so…
David Parks
  • 25,796
  • 41
  • 148
  • 265
8
votes
2 answers

Is it possible to `mock.patch` functions run in multiprocessing (using `spawn`)?

Is it possible to mock.patch a function that will be run in a subprocess, which is created using the multiprocessing module with the start method set to spawn? If there is no solution to patching a child process which is not forked, what would be…
Alonme
  • 555
  • 5
  • 18
8
votes
1 answer

Msys2 with python 3.8: ImportError: cannot import name 'open_code' from 'io'

NOTE: There have been several EDITs to the question, as per comments. They are indicated below, and separated by lines. As of now, the only remaining issue seems to be that numpy cannot load, possibly (but not certainly) due to two alternative…
8
votes
2 answers

How to perform assignment destructuring using the walrus operator in Python

I can do an assignment destructuring as: a, b = s.split(' ', 1) for a string s which has more than one word. How can we do the same in, say an if or elif, with the latest assignment expression introduced in Python 3.8 (is it possible to have…
Austin
  • 24,608
  • 4
  • 20
  • 43
7
votes
1 answer

When running python 3.9.4 I am unable to import tkinter, but downgrading to 3.8.2 works perfectly fine

Im on macOS Catalina running tcl 8.6.11, I installed python3 using brew install python3 tclsh % info patchlevel 8.6.11 Current version of python 3.9.4 python3 --version Python 3.9.4 >>> import tkinter import _tkinter # If this fails your Python…
Aditya Garg
  • 757
  • 4
  • 16
7
votes
1 answer

`NameError: name 'TypeError' is not defined` in Apache (mod_wsgi)

Install Version Apache apr-1.6.5 apr-util-1.6.1 httpd-2.4.7 mod_wsgi-4.6.8 pcre-8.32 Python 3.8.5 Django 3.1.2 Apache http.conf Listen 3600 WSGISocketPrefix /var/run/wsgi WSGIDaemonProcess project_name…
이경언
  • 146
  • 10
7
votes
3 answers

Installing socketio module on python3 seems to be corrupting pip

While installing the socketio package for python using pip3 install socketio, I got the following results: ERROR: launchpadlib 1.10.13 requires testresources, which is not installed. WARNING: The scripts easy_install and easy_install-3.8 are…