Category "python-2.7"

Django: Error: You don't have permission to access that port

I'm very new to this whole setup so please be nice. On dev the command usually works with no errors but since I have been experimenting with different commands

NameError: name 'select_pour_point' is not defined

I am receiving this error when trying to setup variables for each pour point. It is a cur_point = select_pour_point(POUR_POINTS, NAME_FIELD, name) NameError: n

Opencv/numpy issue: "module compiled against API version X but this version of numpy is Y"

I'm new to the world of opencv and few days ago I tried to install it. I installed everything and moved the cv2 file from opencv to python 2.7. I tired oving bo

pytest skips test because it depends on another test

In my python unit tests, test_B depends on test_A. However, when I run the tests with pytest, it always SKIPS test_B with this message: SKIP [1] /home/shuklas/

How do I install coremltools version 4.0 using pip without install errors on my mac?

I have used pyenv to create a shell environment of python 2.7.13 but when I do pip install 'coremltools==4.0' I get five error messages as below; ERROR: Excepti

Python Subprocess to Pass yes / No

I have command which asks for input "YES". How do I pass this answer automatically? I have used below code and it's not working. from subprocess import Popen,

How can I open an image in Python?

I have looked at a lot of tutorials tried them all, but nothing seemed to work through Pygame, PIL, Tkinter. it could be because of me of course, cause Im a gre

Return max value in a column with peewee

I have a table called jobs with a column called job_num. How do i return the maximum value of the integers in that column? I have tried result = Job.select(m

Parsing in memory CSV files from zip archives

I'm working on a new library which will allow the user to parse any file (xlsx, csv, json, tar, zip, txt) into generators. Now I'm stuck at zip archive and when

Read line of numbers into lists in Python

I am trying to read two lines from a file into two lists such that each line is in one list. data.txt: 1,5,7,18,9,8,12 2,41,12,11,1,10 The code I've tr

How to get the color of a pixel in python as fast as possible?

I'm on ubuntu and I want to check every 0.1sec the color of a specific pixel on my screen. How can I do that? I know about PIL but this would need a full scree

Setting up python on windows 10 pro

Have set up Python 3.5 and Python 2.7.11 yet both have not been recognized by the command prompt. Also have download pip.py, and the command prompt has not reco

error with SAlib library for Sensitivity analysis in python

I am trying to perform sensitivity analysis using Sobol`s method. I always get an error which i can not solve. the code and the result are below. the input vari

Django cannot find my media folder while debug = False

I have a django project that works very well and shows all media files uploaded from the admin when debug = True but immediately i turn change to debug = False

Unable to install pika using pip install

Getting the following after launching : pip install pika (I have shorted the exception to first line in trace and last line) Collecting Pika using cahced p

Strict regex in Pandas replace

I need to write a strict regular expression to replace certain values in my pandas dataframe. This is an issue that was raised after solving the question that I

Maintaining the order of the elements in a frozen set

I have a list of tuples, each tuple of which contains one string and two integers. The list looks like this: x = [('a',1,2), ('b',3,4), ('x',5,6), ('a',2,1)]

How to install library with pip-console?

I downloaded some python library package (for example uncompile2) from GitHub. How I can install it into Qpython from the directory in my android device with pi

Python 2.7.5 getting import OrderedDict ImportError: No module named OrderedDict

import OrderedDict ImportError: No module named OrderedDict i'm using python 2.7.5 and assume orderedDict module to be pre-installed. How can i check if the mo

How to call super method from grandchild class?

I am working with some code that has 3 levels of class inheritance. From the lowest level derived class, what is the syntax for calling a method 2 levels up th