smtplib.SMTP starttls fails with tlsv1 alert decode error

I encountered the following perculiar behaviour today. The following code works on Python 3.3: smtp = smtplib.SMTP() smtp.connect(host="smtp.gmail.com", port=587) smtp.ehlo() smtp.starttls() In...

pyvenv-3.4 returned non-zero exit status 1

I'm in Kubuntu 14.04 , I want to create a virtualenv with python3.4. I did with python2.7 before in other folder. But when I try: pyvenv-3.4 venv I've got: Error: Command...

Python3: ImportError: No module named '_ctypes' when using Value from module multiprocessing

I am using Ubuntu and have installed Python 2.7.5 and 3.4.0. In Python 2.7.5 I am able to successfully assign a variable x = Value('i', 2), but not in 3.4.0. I am getting: Traceback (most recent...

Suddenly when running tests I get "TypeError: 'NoneType' object is not iterable

This is phenomenally strange for me, things were working PERFECTLY fine until this morning. When I attempt to run my unit test using the following (I have Python3 soft linked to python) clear;...

Django: TemplateDoesNotExist at / home.html

I'm trying to create first site using Django and Udemy tutorial (here) and I stuck on lesson 7: Home view. After runserver i get error: Request Method: GET Request URL:...

Why is PyMongo 3 giving ServerSelectionTimeoutError?

I'm using: Python 3.4.2 PyMongo 3.0.2 mongolab running mongod 2.6.9 uWSGI 2.0.10 CherryPy 3.7.0 nginx 1.6.2 uWSGI start params: --socket 127.0.0.1:8081 --daemonize --enable-threads --threads 2...

How to place my own log file to the right place with the logging package in Python3?

I want to place the log file of my own application to the right place. I am not sure but I think on unixoid-systems it is /var/log. But there are problems with the permissions. #!/usr/bin/env...

configparser loading config files from zip

I am creating a program that loads and runs python scripts from a compressed file. Along with those python scripts, I have a config file that I previously used configparser to load info from in an...

Invalid Python SDK Error while using python 3.4 on PyCharm

When I switch my PyCharm to use Python 3.4.3 I am getting the error: Invalid Python SDK Also PyCharm does not automatically find the Python 3.4 interpreter for me, even though it is on desired...

Python3 and hmac . How to handle string not being binary

I had a script in Python2 that was working great. def _generate_signature(data): return hmac.new('key', data, hashlib.sha256).hexdigest() Where data was the output of json.dumps. Now, if I...

python flask redirect to https from http

I have a website build using python3.4 and flask...I have generated my own self-signed certificate and I am currently testing my website through localhost. I am using the python ssl module along...

Unable to install mysqlclient in python3 virtualenv

I want to run django with MySQL and Python 3. I initialized virtual environment with virtualenv --no-site-packages -p python3 ./. Then I installed django and wheel using pip, so pip freeze...

Proper way to shutdown asyncio tasks

I am writing a tool which connects to X number of UNIX sockets, sends a command and saves the output in the local file-system. It runs this every X seconds. In order to perform some cleanup when...

Django Test Case Error 'WSGIRequest' object has no attribute 'session'

I'm trying to write some tests for my django app and it's throwing up an error: File "/Users/croberts/.virtualenvs/litem/lib/python3.4/site-packages/django/contrib/auth/__init__.py", line 101, in...

django.core.exceptions.ImproperlyConfigured: CreateView is missing a QuerySet

I'm getting the error CreateView is missing a QuerySet. Define CreateView.model, CreateView.queryset, or override CreateView.get_queryset(). It seems like Django thinks that I'm using CreateView...

pip install - locale.Error: unsupported locale setting

Full stacktrace: ➜ ~ pip install virtualenv Traceback (most recent call last): File "/usr/bin/pip", line 11, in <module> sys.exit(main()) File...

Django can't drop database: psycopg2.OperationalError: cannot drop the currently open database

Whenever I try to run my Django tests via manage.py, the tests run fine however at the end when Django is destroying the database the following error occurs: Destroying test database for alias...

Python flask error with app.run

I am new to Python Flask. my Flask_app.py able to run if without app.run() but shows error when i Put it. I currently run in pythonanywhere.com from flask import...

Matplotlib cannot find basic fonts

I am using matplotlib version 2.0.0 on Python 3 in a miniconda virtual environment. I am working on a unix scientific computing cluster where I don't have root privileges. I am generally executing...

Tensorflow: Getting scalar tensor value as int for pass to set_shape()

I'm attempting to load 3D images and their labels from a numpy array to TensorFlow records, then read them from a queue while training my network. The code for conversion is based on the...

pyinstaller error: OSError: Python library not found: libpython3.4mu.so.1.0, libpython3.4m.so.1.0, libpython3.4.so.1.0

I'm using Python 3.4.4 on Centos7. I've created a python program on my local machine that makes use of qt modules. The program is running fine on my local machine. I'm now trying to create an...

django.db.utils.OperationalError: (1054, "Unknown column

An interesting issue. Getting Unknown column exception -- Please find the stack trace I try to get new leads list and responded leads. I merge them. When I merge them there is an exception. After...

RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb

I'm trying to learn Machine Learning, but I cannot resolve below error. [My environment] Mac High Sierra 10.13.2 Python3.4.5 Numpy1.13.3 [Command] $ python3 -c "import jupyter, matplotlib,...

TemplateDoesNotExist at / django

Got an error views.py: def index(request): user = request.user return render(request, 'main_app/index.html',{'user': user}) Tried this: 'DIRS': [os.path.join(BASE_DIR,...

Django is not able to run manage.py runserver how to solve?

I'm trying to run manage.py server but it hit some error! I've just trying to print hello in web but it insn't working (venv) [email protected]:~/PycharmProjects/Oin$ python manage.py...

Django migrate error _mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax

TL;DR: python versions conflicts, i think that the python i downloaded and compiled (3.6) can't use this package (libmysqlclient-dev) to make migrations to mysql. only the system's default python...

pyspark error does not exist in the jvm error when initializing SparkContext

I am using spark over emr and writing a pyspark script, I am getting an error when trying to from pyspark import SparkContext sc = SparkContext() this is the error File "pyex.py", line 5, in...

Installing local packages with Python virtualenv --system-site-packages

I know this topic has been beat to death but I have not been able to find a solution to the problem I'm having on SO or elsewhere, so I suspect that there may be a bug somewhere in my system. I am...

Neovim on Windows can't find python provider

I'm trying to install neovim on Windows and import my previous init.vim file. I've previously defined my snippets in ultisnips. I'm using windows and ahve tested this in another version of windows...

Windows 10 pip install Flask reporting No matching distribution found for Flask

pip install Flask Could not fetch URL https://pypi.org/simple/flask/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with...