Questions tagged [python-3.6]

Version of the Python programming language released in December 2016. For issues specific to Python 3.6. Use more generic [python] and [python-3.x] tags where possible.

Python 3.6 is the currently newest version of the popular Python programming language (see PEP 0494).

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

5657 questions
37
votes
4 answers

Python 3.6.1 crashed after readline module installed

I've compiled and installed Python 3.6.1 from source code, and run sudo pip3 install readline to install the readline module. But when I start the Python shell, it crashes whatever I enter: Python 3.6.1 (default, Mar 25 2017, 13:40:56) [GCC 5.4.0…
hsfzxjy
  • 1,242
  • 4
  • 14
  • 22
34
votes
3 answers

conda install python=3.6 UnsatisfiableError

I currently have Python 3.5.2 installed via Anaconda Continuum. I'm trying to upgrade to Python 3.6 but I'm getting the below error when I try to run conda install python=3.6: UnsatisfiableError: The following specifications were found to be in…
Tom Hunter
  • 5,714
  • 10
  • 51
  • 76
31
votes
6 answers

PythonL: invalid syntax file "", line 1

When doing python3 Webhook.py (this is the file), it gives me the error: File "", line 1 (%X - %x) ^ SyntaxError: invalid syntax I've tried to print out the raw contents of the file and I also used a hex editor, there is…
incredaboy
  • 364
  • 1
  • 4
  • 12
30
votes
2 answers

AttributeError: module 'asyncio' has no attribute 'create_task'

I'm trying to asyncio.create_task() but I'm dealing with this error: Here's an example: import asyncio import time async def async_say(delay, msg): await asyncio.sleep(delay) print(msg) async def main(): task1 =…
Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
29
votes
2 answers

Can you have an async handler in Lambda Python 3.6?

I've made Lambda functions before but not in Python. I know in Javascript Lambda supports the handler function being asynchronous, but I get an error if I try it in Python. Here is the code I am trying to test: async def handler(event, context): …
Abion47
  • 22,211
  • 4
  • 65
  • 88
28
votes
3 answers

How to route tasks to different queues with Celery and Django

I am using the following stack: Python 3.6 Celery v4.2.1 (Broker: RabbitMQ v3.6.0) Django v2.0.4. According Celery's documentation, running scheduled tasks on different queues should be as easy as defining the corresponding queues for the tasks on…
Ander
  • 5,093
  • 7
  • 41
  • 70
28
votes
5 answers

Multiprocessing on Python 3 Jupyter

I come here because I have an issue with my Jupiter's Python3 notebook. I need to create a function that uses the multiprocessing library. Before to implement it, I make some tests. I found a looooot of different examples but the issue is…
Konate Malick
  • 367
  • 1
  • 3
  • 7
28
votes
1 answer

Running Flask dev server in Python 3.6 raises ImportError for SocketServer and ForkingMixIn

I am trying to run a basic Flask app using Python 3.6. However, I get an ImportError: cannot import name 'ForkingMixIn'. I don't get this error when running with Python 2.7 or 3.5. How can I run Flask with Python 3.6? from flask import Flask app…
SharpCoder
  • 18,279
  • 43
  • 153
  • 249
27
votes
5 answers

Python 3 Boto 3, AWS S3: Get object URL

I need to retrieve an public object URL directly after uploading a file, this to be able to store it in a database. This is my upload code: s3 = boto3.resource('s3') s3bucket.upload_file(filepath, objectname, ExtraArgs={'StorageClass':…
HyperDevil
  • 2,519
  • 9
  • 38
  • 52
26
votes
3 answers

Python TypeError must be str not int

I am having trouble with the following piece of code: if verb == "stoke": if items["furnace"] >= 1: print("going to stoke the furnace") if items["coal"] >= 1: print("successful!") …
Eps12 Gaming
  • 295
  • 1
  • 4
  • 6
25
votes
1 answer

Missing dependencies causing Keyring error when opening Spyder3 on Ubuntu18?

I'm fairly new to programming and such. I'm trying to use Spyder3, and I keep getting this error (below). I am using Geforce 1080ti, Ubuntu 18.04.01, python3.3.6, python2 is not installed. I tried $ pip3 install keyring, which is now installed but…
Yume
  • 446
  • 1
  • 4
  • 10
25
votes
5 answers

Adding a data file in Pyinstaller using the onefile option

I'm trying to add an image to the one file produced by Pyinstaller. I've read many questions/forums like this one and that one and still it's not working. I know that for one file operation, Pyinstller produce a temp folder that could be reached by…
AhmedWas
  • 1,205
  • 3
  • 23
  • 38
25
votes
1 answer

Generic NamedTuple in Python 3.6

I'm trying to create a generic version of a NamedTuple, as follows: T1 = TypeVar("T1") T2 = TypeVar("T2") class Group(NamedTuple, Generic[T1, T2]): key: T1 group: List[T2] g = Group(1, [""]) # expecting type to be Group[int,…
pdowling
  • 470
  • 4
  • 11
25
votes
3 answers

What is the correct way to type hint a homogenous Queue in Python3.6 (especially for PyCharm)?

I'm writing a fractal generator in Python 3.6, and I use multiprocessing.Queues to pass messages from the main thread to the workers. This is what I've tried so far, but PyCharm doesn't seem to be able to infer attribute types for items taken from…
Broseph
  • 1,655
  • 1
  • 18
  • 38
25
votes
2 answers

How to force static typing in Python?

Since static typing is available in Python 3.6, is it possible to force static typing for a Python project or set of Python files?
lowrin
  • 2,155
  • 2
  • 13
  • 10