python-3.7

How to solve issue related to installation of dlib on Windows 10?

不羁岁月 提交于 2020-01-25 04:17:49
问题 I am trying to install dlib for face-recognition for python 3.7 on windows 10, I explored few ways but I am getting errors.I tried below steps- Installed cmake using 'pip install cmake'. This worked. Downloaed the Dlib source(.tar.gz) from the Python Package Index : https://pypi.org/project/dlib/#files extract it and enter into the folder. Ran the installation: python setup.py install I am getting below error. * *C:\Program Files\dlib-19.18.0>python setup.py install running install running

How to solve issue related to installation of dlib on Windows 10?

假装没事ソ 提交于 2020-01-25 04:17:37
问题 I am trying to install dlib for face-recognition for python 3.7 on windows 10, I explored few ways but I am getting errors.I tried below steps- Installed cmake using 'pip install cmake'. This worked. Downloaed the Dlib source(.tar.gz) from the Python Package Index : https://pypi.org/project/dlib/#files extract it and enter into the folder. Ran the installation: python setup.py install I am getting below error. * *C:\Program Files\dlib-19.18.0>python setup.py install running install running

“<unprintable file name>” error when running pip or venv

谁说我不能喝 提交于 2020-01-24 06:01:43
问题 I have several people on my team that are running into an intermittent problem running some very basic Python commands. The following is all in Windows 10, using the Python Launcher (the py command that allows you to setup a default Python – in our case Python 3.7). Running from a Git repo root directory pip can fail. $ py -m pip install --upgrade pip C:\Apps\Python37\python.exe: can't open file '<unprintable file name>': [Errno 2] No such file or directory or setting up a virtual environment

How do I document a constructor for a class using Python dataclasses?

南笙酒味 提交于 2020-01-24 02:09:13
问题 I have some existing Python 3.6 code that I'd like to move to Python 3.7 dataclasses. I have __init__ methods with nice docstring documentation, specifying the attributes the constructors take and their types. However, if I change these classes to use the new Python dataclasses in 3.7, the constructor is implicit. How do I provide constructor documentation in this case? I like the idea of dataclasses, but not if I have to forego clear documentation to use them. edited to clarify I'm using

Requests/aiohttp: closing response objects

a 夏天 提交于 2020-01-23 09:04:56
问题 I'm a bit confused about the need to .close() a response object in both requests and aiohttp . (Note that this is a separate instance method than session.close() --I'm talking about the response object itself.) Does Response ( requests ) or ClientResponse ( aiohttp ) ever need explicitly call .close() ? If not, what is the purpose of using the response itself as a context manager? ( async with session.request('GET', 'https://www.pastebin.com' ) below.) Why define the two dunder methods for

TypeError: an integer is required (got type tuple)

﹥>﹥吖頭↗ 提交于 2020-01-21 11:40:49
问题 I am trying to set up my detector for a face recognition project or a program, but I keep getting this error: TypeError: an integer is required (got type tuple) Also I tried with changing: cv2.putText(img, str(id), (x, y + h), font, 255) to cv2.putText(img, name, (x, y + h), font, 2, (0, 255, 0), 2) Here's my code: import cv2 import numpy as np faceDetect=cv2.CascadeClassifier('haarcascade_frontalface_default.xml') cam=cv2.VideoCapture(0) rec = cv2.face.LBPHFaceRecognizer_create() rec.read(

ModuleNotFoundError: No module named 'windows'

删除回忆录丶 提交于 2020-01-21 10:07:10
问题 I'm working on a project and I need to use the PyMouse module. pip install pymouse installed pymouse correctly, so I assumed all was fine. However, when importing PyMouse: from pymouse import PyMouse I got the following error running my program: Traceback (most recent call last): File "4opeenrij.py", line 1, in <module> from pymouse import PyMouseEvent File "C:\Users\lcdew\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pymouse\__init__.py", line 92, in <module> from windows

How paginate through api response asynchronously with asyncio and aiohttp

孤街浪徒 提交于 2020-01-14 03:15:28
问题 I'm trying to make api calls with python asynchronously. I have multiple endpoints in a list and each endpoint will return paginated results. I'm able to set up going though the multiple endpoints asynchronously, however am not able to return the paginated results of each endpoint. From debugging, I found that the fetch_more() function runs the while loop, but doesn't actually get past the async with session.get(). So basically. The function fetch_more() is intended to get remaining results

Microsoft Visual C++ 14.0 is required to install twisted where Visual studio 2017 is already installed

我只是一个虾纸丫 提交于 2020-01-11 11:06:48
问题 When i compiled the code in VS-Code gives error -> Microsoft Visual C++ 14.0 is required Installing twisted in (windows 10) 1: pip install python-twisted gives an error Could not find a version that satisfies the requirement python-twisted (from versions: ) No matching distribution found for python-twisted 2: pip/pip3 install twisted Failed building wheel for twisted Running setup.py clean for twisted Failed to build twisted Note: There are two python versions installed in my PC But python

How to install python3.7 and create a virtualenv with pip on Ubuntu 18.04?

左心房为你撑大大i 提交于 2020-01-10 07:35:06
问题 I'm trying to set up a standard virtualenv with python 3.7 on Ubuntu 18.04, with pip (or some way to install packages in the virtualenv). The standard way to install python3.7 seems to be: % sudo apt install python3.7 python3.7-venv % python3.7 -m venv py37-venv but the second command fails, saying: The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command. apt-get