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
51
votes
6 answers

flask_uploads: ImportError: cannot import name 'secure_filename'

I want to create a form that allows to send a picture with a description using flask forms. I tried to use this video: https://www.youtube.com/watch?v=Exf8RbgKmhM but I had troubles when launching app.py: ➜ website git:(master) ✗ python3.6…
Santeau
  • 839
  • 3
  • 13
  • 23
47
votes
7 answers

Not able to pip install pickle in python 3.6

I am trying to run the following code: import bs4 as bs import pickle import requests import lxml def save_sp500_tickers(): resp = requests.get("https://en.wikipedia.org/wiki/List_of_S%26P_500_companies") soup = bs.BeautifulSoup(resp.text,…
satyaki
  • 581
  • 2
  • 6
  • 14
47
votes
5 answers

How to use virtualenv with python3.6 on ubuntu 16.04?

I'm using Ubuntu 16.04, which comes with Python 2.7 and Python 3.5. I've installed Python 3.6 on it and symlink python3 to python3.6 through alias python3=python3.6. Then, I've installed virtualenv using sudo -H pip3 install virtualenv. When I…
wgetDJ
  • 1,209
  • 1
  • 10
  • 11
46
votes
2 answers

Are sets ordered like dicts in python3.6

Due to changes in dict implementation in Python 3.6 it is now ordered by default. Do sets preserve order as well now? I could not find any information about it but as both of those data structures are very similar in the way they work under the hood…
Quba
  • 4,776
  • 7
  • 34
  • 60
45
votes
5 answers

Python3.6 error: ModuleNotFoundError: No module named 'src'

I know similar questions have been asked before... But I had a quick doubt... I have been following this link: https://www.python-course.eu/python3_packages.php my code structure: my-project -- __init__.py -- src -- __init__.py --…
user3868051
  • 1,147
  • 2
  • 22
  • 43
45
votes
1 answer

Why can't I 'yield from' inside an async function?

In Python 3.6, I am able to use yield inside a coroutine. However I am not able to use yield from. Below is my code. On line 3 I await another coroutine. On line 4 I try to yield from a file. Why won't Python 3.6 allow me to do that? async def…
Akilesh
  • 1,252
  • 1
  • 9
  • 16
44
votes
2 answers

iter() not working with datetime.now()

A simple snippet in Python 3.6.1: import datetime j = iter(datetime.datetime.now, None) next(j) returns: Traceback (most recent call last): File "", line 1, in StopIteration instead of printing out the classic now() behavior with…
Vidak
  • 1,083
  • 14
  • 29
44
votes
9 answers

Microsoft Windows Python-3.6 PyCrypto installation error

pip install pycrypto works fine with python3.5.2 but fails with python3.6 with the following error: inttypes.h(26): error C2061: syntax error: identifier 'intmax_t'
Konstantin Glukhov
  • 1,898
  • 3
  • 18
  • 25
44
votes
6 answers

pip3 installs inside virtual environment with python3.6 failing due to ssl module not available

(py36venv) vagrant@pvagrant-dev-vm:/vagrant/venvs$ pip3 install pep8 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting pep8 Could not fetch URL …
Py_minion
  • 2,027
  • 1
  • 16
  • 20
44
votes
2 answers

Why were literal formatted strings (f-strings) so slow in Python 3.6 alpha? (now fixed in 3.6 stable)

I've downloaded a Python 3.6 alpha build from the Python Github repository, and one of my favourite new features is literal string formatting. It can be used like so: >>> x = 2 >>> f"x is {x}" "x is 2" This appears to do the same thing as using the…
Aaron Christiansen
  • 11,584
  • 5
  • 52
  • 78
43
votes
2 answers

AWS SQS trigger Step Functions

Quick question: Is it possible to trigger the execution of a Step Function after an SQS message was sent?, if so, how would you specify it into the cloudformation yaml file? Thanks in advance.
42
votes
8 answers

Recommended way to install pip(3) on centos7

I am interrested in knowing the recommended way to install pip3 for python3.6 (as of today, may 2018) on current version of centos7 (7.5.1804) and the accepted answer of How to install pip in CentOS 7? seems to be outdated because: yum search -v…
shrimpdrake
  • 1,476
  • 2
  • 14
  • 25
40
votes
2 answers

Documenting class attributes with type annotations

I want to autogenerate documentation to my code from docstrings. I have some basic class meant to store some data: class DataHolder: """ Class to hold some data Attributes: batch: Run without GUI debug (bool): Show…
Djent
  • 2,877
  • 10
  • 41
  • 66
38
votes
2 answers

Python Asynchronous Comprehensions - how do they work?

I'm having trouble understanding the use of asynchronous comprehensions introduced in Python 3.6. As a disclaimer, I don't have a lot of experience dealing with asynchronous code in general in Python. The example given in the what's new for Python…
Andrew Guy
  • 9,310
  • 3
  • 28
  • 40
37
votes
7 answers

Same name functions in same class - is there an elegant way to determine which to call?

I am trying to do product version control in Python scripts for a specific reason, but I couldn't figure out how to do it in an elegant way. Currently, I am doing something like the below. However, the scripts are hard to maintain when version…
Timmy Lin
  • 716
  • 8
  • 15