python-3.6

'ModuleNotFoundError: No module named 'MySQLdb' In Django

浪子不回头ぞ 提交于 2020-07-07 11:05:28
问题 creating my first module in django, I am using mac Tried steps: 1.installed python 3.6.+ version, 2.cloned git project 3.setup local env, to create a module, trying with command env=dev python3 manage.py startapp supriya_module_inflow; getting error in console : Environment Selected :dev Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 24, in <module> import MySQLdb as Database ModuleNotFoundError: No module named 'MySQLdb

Datetime strptime issue with a timezone offset with colons

笑着哭i 提交于 2020-07-07 06:04:08
问题 Currently we are working on an application which is trying to calculate the travel time of a route from a to b, using the 2.db.transport.rest API. Unfortunatly we are receiving timestamps with a timezone offset from that API, such as +01:00 . What we need is a timezone offset without the : , so +0100 . The following example gives an error on Linux, using Python 3.6.7: from datetime import datetime datetimestring = "2019-01-19T15:13:00.000+01:00" datetime.strptime(datetimestring, '%Y-%m-%dT%H:

Datetime strptime issue with a timezone offset with colons

不羁岁月 提交于 2020-07-07 06:03:19
问题 Currently we are working on an application which is trying to calculate the travel time of a route from a to b, using the 2.db.transport.rest API. Unfortunatly we are receiving timestamps with a timezone offset from that API, such as +01:00 . What we need is a timezone offset without the : , so +0100 . The following example gives an error on Linux, using Python 3.6.7: from datetime import datetime datetimestring = "2019-01-19T15:13:00.000+01:00" datetime.strptime(datetimestring, '%Y-%m-%dT%H:

I get error “No module named 'pyproj._datadir'” after I made .py to .exe with pyinstaller

元气小坏坏 提交于 2020-07-06 19:31:34
问题 My code works well when it's .py but when I make .exe file with pyinstaller, it shows ModuleNotFoundError. I write this when I made .exe pyinstaller -F MyCode.py How can I solve this problem? I've read Issues with pyinstaller and pyproj and I was going to try to make and located hook-pyproj.py at "hooks" folder in Pyinstaller. but hook-pyproj.py was already there with the same code. After that, I installed "basemap" and tried to use pyproj from it. However it shows me the same error. This is

I get error “No module named 'pyproj._datadir'” after I made .py to .exe with pyinstaller

不问归期 提交于 2020-07-06 19:30:45
问题 My code works well when it's .py but when I make .exe file with pyinstaller, it shows ModuleNotFoundError. I write this when I made .exe pyinstaller -F MyCode.py How can I solve this problem? I've read Issues with pyinstaller and pyproj and I was going to try to make and located hook-pyproj.py at "hooks" folder in Pyinstaller. but hook-pyproj.py was already there with the same code. After that, I installed "basemap" and tried to use pyproj from it. However it shows me the same error. This is

I get error “No module named 'pyproj._datadir'” after I made .py to .exe with pyinstaller

烂漫一生 提交于 2020-07-06 19:29:22
问题 My code works well when it's .py but when I make .exe file with pyinstaller, it shows ModuleNotFoundError. I write this when I made .exe pyinstaller -F MyCode.py How can I solve this problem? I've read Issues with pyinstaller and pyproj and I was going to try to make and located hook-pyproj.py at "hooks" folder in Pyinstaller. but hook-pyproj.py was already there with the same code. After that, I installed "basemap" and tried to use pyproj from it. However it shows me the same error. This is

f-string syntax for unpacking a list with brace suppression

爷,独闯天下 提交于 2020-07-04 08:33:42
问题 I have been examining some of my string format options using the new f-string format. I routinely need to unpack lists and other iterables of unknown length. Currently I use the following... >>> a = [1, 'a', 3, 'b'] >>> ("unpack a list: " + " {} "*len(a)).format(*a) 'unpack a list: 1 a 3 b ' This, albeit a bit cumbersome, does the job using pre-3.6 .format notation. The new f-string format option is interesting given runtime string concatenation. It is the replication of the number of {} that

f-string syntax for unpacking a list with brace suppression

六月ゝ 毕业季﹏ 提交于 2020-07-04 08:33:07
问题 I have been examining some of my string format options using the new f-string format. I routinely need to unpack lists and other iterables of unknown length. Currently I use the following... >>> a = [1, 'a', 3, 'b'] >>> ("unpack a list: " + " {} "*len(a)).format(*a) 'unpack a list: 1 a 3 b ' This, albeit a bit cumbersome, does the job using pre-3.6 .format notation. The new f-string format option is interesting given runtime string concatenation. It is the replication of the number of {} that

Python3.7 venv does not Create Virtual Environment Directory

社会主义新天地 提交于 2020-06-27 18:31:10
问题 I'm trying to create a virtual environment in windows using: python3 -m venv <dir-name> When I check the contents of the current directory in cmd after running the above command, I don't see the venv directory show up. The command doesn't throw any errors. This person seems to have had the same problem: Python venv not creating virtual environment But the accepted answer was to re-install python, which didn't work for me. Other answers suggest installing virtualenv instead, but as far as I

Issue installing Virtualenvwrapper on Ubuntu 18.04?

帅比萌擦擦* 提交于 2020-06-26 14:57:25
问题 Fresh Ubuntu 18.04 install. Following these instructions here are the commands I've run so far. sudo apt update sudo apt upgrade python3 -V sudo apt install python3-pip sudo apt install build-essential libssl-dev libffi-dev python3-dev sudo apt install python3-venv source /usr/local/bin/virtualenvwrapper.sh Returns bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory. find virtualenvwrapper.sh Returns find: ‘virtualenvwrapper.sh’: No such file or directory EDIT: Sudo -H pip3