python-3.6

flask_uploads: ImportError: cannot import name 'secure_filename'

妖精的绣舞 提交于 2020-08-24 10:21:34
问题 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 app.py Traceback (most recent call last): File "app.py", line 10, in <module> from flask.ext.uploads import UploadSet, configure_uploads, IMAGES ModuleNotFoundError: No module named 'flask.ext' I had to replace flask.ext.uploads by flask_uploads but now I

flask_uploads: ImportError: cannot import name 'secure_filename'

落花浮王杯 提交于 2020-08-24 10:19:52
问题 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 app.py Traceback (most recent call last): File "app.py", line 10, in <module> from flask.ext.uploads import UploadSet, configure_uploads, IMAGES ModuleNotFoundError: No module named 'flask.ext' I had to replace flask.ext.uploads by flask_uploads but now I

flask_uploads: ImportError: cannot import name 'secure_filename'

末鹿安然 提交于 2020-08-24 10:18:34
问题 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 app.py Traceback (most recent call last): File "app.py", line 10, in <module> from flask.ext.uploads import UploadSet, configure_uploads, IMAGES ModuleNotFoundError: No module named 'flask.ext' I had to replace flask.ext.uploads by flask_uploads but now I

ModuleNotFoundError: No module named 'distutils.core'

僤鯓⒐⒋嵵緔 提交于 2020-08-20 19:15:41
问题 I've recently upgraded from Ubuntu 18.04 to 19.04 which has python 3.7 . But I work on many projects using Python 3.6 . Now when I try to create a virtualenv with Python 36 in PyCharm, it raises: ModuleNotFoundError: No module named 'distutils.core' I can't figure out what to do. I tried to install distutils: milano@milano-PC:~$ sudo apt-get install python3-distutils Reading package lists... Done Building dependency tree Reading state information... Done python3-distutils is already the

ModuleNotFoundError: No module named 'distutils.core'

旧巷老猫 提交于 2020-08-20 19:12:26
问题 I've recently upgraded from Ubuntu 18.04 to 19.04 which has python 3.7 . But I work on many projects using Python 3.6 . Now when I try to create a virtualenv with Python 36 in PyCharm, it raises: ModuleNotFoundError: No module named 'distutils.core' I can't figure out what to do. I tried to install distutils: milano@milano-PC:~$ sudo apt-get install python3-distutils Reading package lists... Done Building dependency tree Reading state information... Done python3-distutils is already the

Why don't f-strings change when variables they reference change?

怎甘沉沦 提交于 2020-08-19 06:17:06
问题 While playing with new f-strings in the recent Python 3.6 release, I've noticed the following: We create a foo variable with value bar : >>> foo = 'bar' Then, we declare a new variable, which is our f-string, and it should take foo to be formatted: >>> baz = f'Hanging on in {foo}' Ok, all going fine and then we call baz to check its value: >>> baz 'Hanging on in bar' Let's try to change the value of foo and call baz again: >>> foo = 'spam' >>> baz 'Hanging on in bar' Shouldn't it be dynamic?