Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
34,198,892
2015-12-10T10:04:00.000
2
0
1
1
python,ubuntu
55,406,526
6
false
0
0
neither try any above ways nor sudo apt autoremove python3 because it will remove all gnome based applications from your system including gnome-terminal. In case if you have done that mistake and left with kernal only than trysudo apt install gnome on kernal. try to change your default python version instead removing i...
4
13
0
I have recently get hold of a RackSpace Ubuntu server and it has pythons all over the place: iPython in 3.5, Pandas in 3.4 &2.7, modules I need like pyodbc etc. are only in 2,7 Therefore, I am keen to clean up the box and, as a 2.7 users, keep everything in 2.7. So the key question is, is there a way to remove both 3...
Ubuntu, how do you remove all Python 3 but not 2
0.066568
0
0
127,783
34,198,892
2015-12-10T10:04:00.000
8
0
1
1
python,ubuntu
34,220,703
6
true
0
0
So I worked out at the end that you cannot uninstall 3.4 as it is default on Ubuntu. All I did was simply remove Jupyter and then alias python=python2.7 and install all packages on Python 2.7 again. Arguably, I can install virtualenv but me and my colleagues are only using 2.7. I am just going to be lazy in this case :...
4
13
0
I have recently get hold of a RackSpace Ubuntu server and it has pythons all over the place: iPython in 3.5, Pandas in 3.4 &2.7, modules I need like pyodbc etc. are only in 2,7 Therefore, I am keen to clean up the box and, as a 2.7 users, keep everything in 2.7. So the key question is, is there a way to remove both 3...
Ubuntu, how do you remove all Python 3 but not 2
1.2
0
0
127,783
34,198,892
2015-12-10T10:04:00.000
9
0
1
1
python,ubuntu
34,198,961
6
false
0
0
EDIT: As pointed out in recent comments, this solution may BREAK your system. You most likely don't want to remove python3. Please refer to the other answers for possible solutions. Outdated answer (not recommended) sudo apt-get remove 'python3.*'
4
13
0
I have recently get hold of a RackSpace Ubuntu server and it has pythons all over the place: iPython in 3.5, Pandas in 3.4 &2.7, modules I need like pyodbc etc. are only in 2,7 Therefore, I am keen to clean up the box and, as a 2.7 users, keep everything in 2.7. So the key question is, is there a way to remove both 3...
Ubuntu, how do you remove all Python 3 but not 2
1
0
0
127,783
34,199,233
2015-12-10T10:19:00.000
7
0
0
0
python,tensorflow,tensorflow2.0,tensorflow2.x,nvidia-titan
44,128,902
16
false
0
0
Shameless plug: If you install the GPU supported Tensorflow, the session will first allocate all GPUs whether you set it to use only CPU or GPU. I may add my tip that even you set the graph to use CPU only you should set the same configuration(as answered above:) ) to prevent the unwanted GPU occupation. And in an inte...
2
349
1
I work in an environment in which computational resources are shared, i.e., we have a few server machines equipped with a few Nvidia Titan X GPUs each. For small to moderate size models, the 12 GB of the Titan X is usually enough for 2–3 people to run training concurrently on the same GPU. If the models are small enoug...
How to prevent tensorflow from allocating the totality of a GPU memory?
1
0
0
237,456
34,199,233
2015-12-10T10:19:00.000
1
0
0
0
python,tensorflow,tensorflow2.0,tensorflow2.x,nvidia-titan
52,828,871
16
false
0
0
i tried to train unet on voc data set but because of huge image size, memory finishes. i tried all the above tips, even tried with batch size==1, yet to no improvement. sometimes TensorFlow version also causes the memory issues. try by using pip install tensorflow-gpu==1.8.0
2
349
1
I work in an environment in which computational resources are shared, i.e., we have a few server machines equipped with a few Nvidia Titan X GPUs each. For small to moderate size models, the 12 GB of the Titan X is usually enough for 2–3 people to run training concurrently on the same GPU. If the models are small enoug...
How to prevent tensorflow from allocating the totality of a GPU memory?
0.012499
0
0
237,456
34,200,159
2015-12-10T10:58:00.000
0
1
0
0
python,c++,raspberry-pi,gpio
40,125,816
2
false
0
1
If you clean up the GPIO Headers in both scripts, it should be possible, otherwise it wont work. You can clean up in python by using GPIO.cleanup(), then it sould work, cause it is clean again to your c++ Code.
1
0
0
I have a Python script and a C++ program running at the same time, both accessing the GPIO pins (not the same ones, though) in this order: C++ Python C++ The access of the C++ program worked (I used wireless transmitters and received the message). After that the Python access (light up an LED) worked as well. But whe...
Is it possible to access GPIO pins from a Python script and a C++ program at the same time?
0
0
0
250
34,200,551
2015-12-10T11:18:00.000
0
0
0
1
python,windows,python-2.7,batch-file,scheduled-tasks
34,218,832
1
false
0
0
Thank you guys for your help. It was indeed "just" the working directory I had to set to the location of the bat file
1
0
0
Hi folks so I got the following problem, I have the following code in a batch file: ..\python-2.7.10.amd64\python.exe ./bin/bla.py ./conf/config.conf > ./logs/output.txt This works like a charme by double clicking the batch. Next my plan was to automate the call of this batch by adding it to the task scheduler in win...
Python script from batch file won't run in task scheduler
0
0
0
1,575
34,204,574
2015-12-10T14:35:00.000
0
0
1
0
python,pycharm
34,209,473
1
true
1
0
PyCharm support explained that (as of v 4.5.3), there is a checkbox option in Deployment Settings for "Visible only for this project".
1
1
0
I have two projects in PyCharm 4.5.2. When I change some deployment settings (e.g., add or delete a server) in one project, they also change in the other. Is this the way it is supposed to work? Is there a way I should be doing this so that the settings are specific to each project?
Are settings unique to projects in PyCharm
1.2
0
0
71
34,206,946
2015-12-10T16:27:00.000
0
0
1
0
python,virtualenv,conda
34,273,042
1
true
0
0
No this will not break your system's python. As long as you don't tick the option "register miniconda as the default system python" (or whatever that option is called depending on your OS). One of the key benefits of conda is that you can create isolated python environments, fully independent of each other.
1
1
0
I have a system with certain python version and packages installed suing the distribution repositories. For some project (calculation) I need newer version the the packages. I am thinking of installing anaconda and use conda virtual environments. Will this broke programs that must use the system packages? (note: I trie...
Do anaconda packages interfere with system python
1.2
0
0
1,386
34,209,697
2015-12-10T19:02:00.000
0
0
1
1
python,windows-10
34,210,329
1
false
0
0
Choose open with, then scroll down and click something like "choose another application from this computer" (I don't exactly know, I use windows in different language). Then just select your Python executable and click OK.
1
0
0
I just upgraded to windows 10, and downloaded the Anaconda Python distribution and chose the option for it to add everything to my PATH etc. Back in windows 8 when I created a .py file I could execute it from the file explorer just by clicking on it, but for some reason windows 10 won't recognise .py files and when I t...
Python Executables on Windows
0
0
0
71
34,212,036
2015-12-10T21:26:00.000
1
0
1
1
python,python-3.x
34,212,369
4
false
0
0
You have to add the python bin folder to your path. You can do it manually but when you install python i remember you have an option to do that.
1
11
0
Just curious, is there a particular reason why Python 3.x is not installed on Windows to run default with the command line "python3", like it does on Mac OSX and Linux? Is there some kind of way to configure Python so that it runs like this? Thanks. EDIT: Just to add, the reason I am asking is because I have both the ...
Python 3 installation on windows running from command line
0.049958
0
0
25,234
34,213,429
2015-12-10T23:09:00.000
0
0
0
0
python,qt,pyqt4,poppler
34,292,822
2
false
0
1
In C:\poppler-0.24.5\include\src replace it C:\poppler-0.24.5\include\qt4\src
1
1
0
Trying to install python-poppler-qt4 on Windows (8.1) but i've been having issues building/installing it (error fatal error C1083: Cannot open include file: 'QMetaType' : No such file or directory. #include QMetaType) Before this error I had a missing poppler-qt4.dll issue. After locating and installing the dll I get ...
Python Poppler install issues
0
0
0
627
34,213,644
2015-12-10T23:26:00.000
1
0
0
0
python,django,django-forms,django-views
34,215,469
1
false
1
0
You could use either option. Option #1: In the post method (if using Class-based-views, otherwise check for "post" as the request type), just instantiate the form with MessageForm(request.POST), and then check the form's is_valid() method. If the form is valid, save the Message object and redirect back to the same view...
1
0
0
I am developing a web-site using Django/Python. I am quite new to this technology and I want to do the web-site in a right way. So here is my problem: Imagine, that there is a Product entity and product view to display the Product info. I use (product_view in my views.py ). There is also Message entity and the Product ...
Django - guidance needed
0.197375
0
0
34
34,213,706
2015-12-10T23:32:00.000
0
0
0
1
python,mysql,twisted
35,131,551
1
false
0
0
I think the best way to accomplish this is to first make a select for the id (or ids) of the row/rows you want to update, then update the row with a WHERE condition matching the id of the item to update. That way you are certain that you only updated the specific item. An UPDATE statement can update multiple rows that ...
1
3
0
Python, Twistd and SO newbie. I am writing a program that organises seating across multiple rooms. I have only included related columns from the tables below. Basic Mysql tables Table id Seat id table_id name Card seat_id The Seat and Table tables are pre-populated with the 'name' columns initially NULL. Stage ...
Python Twistd MySQL - Get Updated Row id (not inserting)
0
1
0
311
34,214,908
2015-12-11T01:49:00.000
1
1
0
0
python,mysql,linux,django,passwords
34,215,479
4
false
1
0
I'd place the password file in a directory with 600 permissions owned by the Django user. The Django user would be able to do what it needed to and nobody else would even be able to look in the directory (except root and Django) Another thing you could do would be to store it in a database and set it so that the root ...
1
1
0
I've got a Django project running on an Ubuntu server. There are other developers who have the ability to ssh into the box and look at files. I want to make it so that the mysql credentials and api keys in settings.py are maybe separated into a different file that's only viewable by the root user, but also usable by th...
Linux/Python: How can I hide sensitive information in a Python file, so that developers on the environment won't be able to access it?
0.049958
0
0
885
34,217,236
2015-12-11T06:17:00.000
1
0
1
0
python,regex
34,222,140
2
true
0
0
There are two important things to understand here: First, p* matches zero or more, while p+ matches one or more. Second, you will get the first match, no matter if that match is an empty string or not. Third, regex is greedy by default so once it found the first match it will include as many p as possible. So, as a r...
1
1
0
When I use regex p* on string blackpink it returns the empty string as a match even though p is inside the string. When I use the same regex p* on string pinkpink then it matches and returns p, indicating its matching only on the start of the string even though i have not specified anything of the kind. The peculiar be...
Python regex * matches occurrences only in the starting of the string
1.2
0
0
285
34,221,468
2015-12-11T10:36:00.000
0
1
0
1
python,ubuntu,debian,32bit-64bit,ctypes
34,221,649
2
false
0
0
I am not sure if you can do this in the same process - we are talking about arithmetic here: 32bit pointers are different from 64bit pointers, so trying to reference them in the same process ... well, I am not sure what happens when trying to access a memory area which is not accessible or which is not supposed to be a...
1
1
0
I'm trying for ages to access a 32bit C compiled lib within an 64bit Ubuntu. I'm using python and CDLL lib in order to make it happen but with no success so far. I can easily open the same 32bit lib on a 32bit OS, and the 64bit version on a 64bit OS. So, what I'm asking is if anyone knows a way to encapsulate/sandbox/w...
Accessing a 32bit with python on a Debian 64bit with CDLL lib (or other)
0
0
0
285
34,223,068
2015-12-11T11:59:00.000
5
1
0
0
python,vim,syntax-highlighting,vim-syntax-highlighting
34,225,084
2
true
0
0
Overly long lines can dramatically slow down Vim's syntax highlighting; usually, this is a fault of the syntax script, and you should inform its author (found in the $VIMRUNTIME/syntax/python.vim script header). Vim 7.4 includes the :syntime command, which greatly helps with troubleshooting and finding the problematic ...
1
2
0
I have this python script, in one line I have a 1000 character long string. I have syntax highlighting on, vim hangs on this line. If I change the file extension to c++ than it works. I suspect problems with syntax highlighting plugin is is causing the hang. Can this be fixed somehow? I'm using vim version 7.4.52
Vim python syntax highlighting hangs for very long lines
1.2
0
0
995
34,224,258
2015-12-11T13:04:00.000
0
0
1
0
python,go,interpreter,multiple-instances
34,311,874
1
true
0
0
As Chris Townsend and pie-o-pah said, Trying to implement sub-interpreter is much more complicate. Try to create the language interface is make senses to my case. In this situation os/exec is the way to go. And can even create ssh to remote my python module if my main server is overload.
1
1
0
Currently I'm doing a project in Golang which need to call to Python. In Python it's a library of singleton-like instance. But I can't modify those library because It's too complicated. (for me) Most thing I can do is wrap it with my own Python script. So I'm finding a way to create multiple Python interpreter in Go. ...
How to create multiple Python's instances within a Go application
1.2
0
0
126
34,225,530
2015-12-11T14:13:00.000
1
0
1
0
python,docker,virtualenv
34,226,943
2
false
0
0
When using docker it makes sense to adopt the microservices concept. With microservices each microservice is aligned with a specific business function, and only defines the operations necessary to that business function. This means that each application runs in one or more separate docker images with their specific dep...
2
5
0
Almost all python tutorials suggest that virutalenv be setup as step one to maintain consistency . In working with Docker containers, why or why not should this standard be maintained?
Is there a good reason for setting up virtualenv for python in Docker containers?
0.099668
0
0
150
34,225,530
2015-12-11T14:13:00.000
4
0
1
0
python,docker,virtualenv
34,225,592
2
true
0
0
If you intend to run only one version on the container and it is the container's system version, there's no technical reason to use virtualenv in a container. But there could still be non-technical reasons. For example, if your team is used to finding python libraries in ~/some-env, or understands the virtualenv struct...
2
5
0
Almost all python tutorials suggest that virutalenv be setup as step one to maintain consistency . In working with Docker containers, why or why not should this standard be maintained?
Is there a good reason for setting up virtualenv for python in Docker containers?
1.2
0
0
150
34,228,132
2015-12-11T16:25:00.000
0
0
1
0
python,jupyter-notebook
41,070,427
1
false
0
0
If you opened the notebook in iPython, it has option for download files to PDF pages.
1
4
0
I want to download my jupyter notebook as pdf. At first, I was reminded that I have to install something, then I go to download page to install pandocs-1.15.2-windows. However, when I tried to download it again, another error message shows up: "nbconvert failed: 'ascii' codec can't decode byte 0xb4 in position 1: ordin...
jupyter notebook downloaded as pdf
0
0
0
751
34,228,646
2015-12-11T16:55:00.000
1
1
1
0
python,c++
34,230,076
2
false
0
0
You can use standard python api , Cython or Boost.python. It is much easier to work with boost.python. You have to add very little code to your c++ library and compile it as a module library which then you can call from python. with boost you can easily add your classes and their methods. Additionally you can introduce...
1
1
0
I am studying in machine learning now and I want to build up a recommender system. First, I would like to make a top-N recommendation using two existing methods and they are both written in C++ code. As the file are huge and complex, I want to call them with Python, instead of adding code on that. Which tool is suitabl...
How can I call C++ code using Python?
0.099668
0
0
200
34,233,767
2015-12-11T22:44:00.000
2
0
0
0
python,tensorflow,tensorboard
35,853,184
1
false
0
0
The best solution from a TensorBoard perspective is to have a root directory for your experiment, e.g. ~/tensorflow/mnist_experiment, and then to create a new subdirectory for each run, e.g. ~/tensorflow/mnist_experiment/run1/... Then run TensorBoard against the root directory, and every time you invoke your code, setu...
1
3
1
I am using Tensorflow to build up the Neural Network, and I would like to show training results on the Tensorboard. So far everything works fine. But I have a question on "event file" for the Tensorboard. I notice that every time when I run my python script, it generates different event files. And when I run my local s...
Event files in Google Tensorflow
0.379949
0
0
1,651
34,235,225
2015-12-12T01:38:00.000
12
0
0
0
python,tensorflow
44,353,399
4
false
0
0
Yes, tf.Graph are build in an append-only fashion as @mrry puts it. But there's workaround: Conceptually you can modify an existing graph by cloning it and perform the modifications needed along the way. As of r1.1, Tensorflow provides a module named tf.contrib.graph_editor which implements the above idea as a set of c...
1
24
1
TensorFlow graph is usually built gradually from inputs to outputs, and then executed. Looking at the Python code, the inputs lists of operations are immutable which suggests that the inputs should not be modified. Does that mean that there is no way to update/modify an existing graph?
Is it possible to modify an existing TensorFlow computation graph?
1
0
0
13,045
34,237,068
2015-12-12T06:35:00.000
0
0
0
1
python,vim,ultisnips
46,685,085
1
false
0
0
Problem solved. I downgraded python from 2.7.11 to 2.7.9 and it worked well. – Cicero
1
1
0
Environments OS:Windos 7, x64 bit Vim: gvim74 from vim.org Python: Python 2.7.11 UltiSnips: just downloaded from github Gvim worked perfectly for me with SnipMate for a long time and lately I want to use UltiSnips instead. So i newly installed python on my PC, installed UltiSnips with Pathogen and just deleted snipma...
UltiSnips not work: PYTHON caused GVim to EXIT
0
0
0
120
34,241,400
2015-12-12T15:14:00.000
0
0
0
1
python,terminal,pickle
34,241,511
2
false
0
0
Check atexit() Add a function and decorate it with atexit
1
0
0
I have just made a script that I want to turn off from the terminal, but instead of just ending it I want it to pickle a file. Is there a correct way to do this?
How can I turn my python script off from the terminal?
0
0
0
457
34,242,017
2015-12-12T16:11:00.000
-1
0
0
0
python,mysql,database,lamp,mysql-python
34,242,082
1
false
0
0
are never on the same internet network. Let me clear the question, the problem is are never on the same internet network. firstly you need to fix the network issue, add router between the two sides which you want to communicate with. No relations with Python or LAMP. let me assume your DB is mysql, if you can make yo...
1
0
0
I have a python code which needs to retrieve and store data to/from a database on a LAMP server. The LAMP server and the device running the python code are never on the same internet network. The devices running the python code can be either a Linux, Windows or a MAC system. Any idea how could I implement this?
How to fetch or store data into a database on a LAMP server from devices over the internet?
-0.197375
1
0
155
34,242,949
2015-12-12T17:39:00.000
2
0
1
0
python,django,pip,virtualenv
34,242,990
3
false
1
0
Can you try this command: sudo pip install django==1.8
1
0
0
I have been trying to install django 1.8 on virtualenv, i performed the following steps: changed to my project directory changed to scripts folder of virtual environment which I created activated the virtual env typed command: pip install django == 1.8 Nothing worked also, tried pip install django and easy_install dj...
Unable to install a specific version of django on virtualenv
0.132549
0
0
487
34,243,376
2015-12-12T18:24:00.000
-1
0
0
0
python,django,django-models,django-forms,django-uploads
34,243,402
2
false
1
0
Have a fast look a the source code. No, it doesn't provide a support for that.
1
0
0
as the title says, is there a way to only allow for images to be uploaded when using django-multiupload? At the moment my users can upload any file but I want to limit them to only images. Any help/advice would be much appreciated :-)
Is there a way to only allow for images to be uploaded when using django-multiupload?
-0.099668
0
0
389
34,247,918
2015-12-13T04:14:00.000
1
0
1
1
python,unzip,win32com,winzip
34,455,025
1
false
0
0
Forget win32com. Instead, create a destination folder loop over zipx archives; for each one: create a temp folder using Python's tempfile module use the subprocess module to run your unzip utility (that handles zipx format) on the zipx archive, with command line option to extract to the temp folder created use the ...
1
0
0
I need to unzip numerous zipx files into directory while checking on the run if unzipped files comply with a condition. The condition is "if there is file with the same name overright it only if unzipped file is larger". I wanted to control winzip with win32com but I couldn't find Object.Name with COM browser (win32co...
unzipping zipx by controlling winzip with python
0.197375
0
0
777
34,247,930
2015-12-13T04:16:00.000
6
0
1
0
python-3.x,windows-7-x64
41,469,993
10
false
0
0
run it at the cmd window, not inside the python window. it took me forever to realize my mistake.
7
18
0
I have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything. Please help. Rega...
pip not working in python 3.5 on Windows 7
1
0
0
86,592
34,247,930
2015-12-13T04:16:00.000
8
0
1
0
python-3.x,windows-7-x64
41,629,695
10
false
0
0
go the windows cmd prompt go to the python directory then type python -m pip install package-name
7
18
0
I have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything. Please help. Rega...
pip not working in python 3.5 on Windows 7
1
0
0
86,592
34,247,930
2015-12-13T04:16:00.000
1
0
1
0
python-3.x,windows-7-x64
40,418,960
10
false
0
0
I had the same problem with Version 3.5.2. Have you tried py.exe -m install package-name? This worked for me.
7
18
0
I have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything. Please help. Rega...
pip not working in python 3.5 on Windows 7
0.019997
0
0
86,592
34,247,930
2015-12-13T04:16:00.000
-1
0
1
0
python-3.x,windows-7-x64
46,616,075
10
false
0
0
For those with several python versions of python 3 installed in windows: I solved this issue by executing the pip install command directly from my python35 Scripts folder in cmd...for some reason pip3 pointed to python 34 even though python 35 was set first in environmental variables.
7
18
0
I have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything. Please help. Rega...
pip not working in python 3.5 on Windows 7
-0.019997
0
0
86,592
34,247,930
2015-12-13T04:16:00.000
2
0
1
0
python-3.x,windows-7-x64
60,048,577
10
false
0
0
I was having the same problem on Windows 10, This is how I fix it: Click the search icon and type System Environment In System Properties click on Environment Variables In System Variables tab click New Enter PYTHON3_SCRIPTS for the variable name and C:\Users\YOUR USER NAME\AppData\Local\Programs\Python\Python38-32\Sc...
7
18
0
I have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything. Please help. Rega...
pip not working in python 3.5 on Windows 7
0.039979
0
0
86,592
34,247,930
2015-12-13T04:16:00.000
0
0
1
0
python-3.x,windows-7-x64
61,621,951
10
false
0
0
If you are working in Pycharm, an easy way is go to file>setting>project interpreter. Click on the + icon you will find on right side probably and then search and install required library.
7
18
0
I have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything. Please help. Rega...
pip not working in python 3.5 on Windows 7
0
0
0
86,592
34,247,930
2015-12-13T04:16:00.000
-1
0
1
0
python-3.x,windows-7-x64
51,876,900
10
false
0
0
I had the issue, and answered this same question sometimes ago. Do open a cmd if in windows OS or linux OS with admistrative privilege. Then python -m pip install --upgrade pip then python -m pip install <>
7
18
0
I have installed python 3.5 on my Windows 7 machine. When I installed it, I marked the check box to install pip. After the installation, I wanted to check whether pip was working, so I typed pip on the command line and hit enter, but did not respond. The cursor blinks but it does not display anything. Please help. Rega...
pip not working in python 3.5 on Windows 7
-0.019997
0
0
86,592
34,251,045
2015-12-13T12:25:00.000
2
0
1
0
python,coding-style
34,251,079
2
false
0
0
Normally the semicolon is only used in Python if you want to have multiple commands in one line. So you should omit the semicolons where they are not necessary.
1
2
0
So far I have coded mainly in Java. So I am more used to the fact that a statement ends with a semicolon. If I continue the same habit here in Python (which by the way helps me to keep a nice continuity), how will that be perceived as far as programming practices are concerned?
Putting semicolons at the end of the statements. Is this a good/bad programming practice in Python?
0.197375
0
0
1,092
34,251,551
2015-12-13T13:24:00.000
0
1
1
0
python,html,python-2.7
34,251,582
3
false
1
0
I is not possible to import Python code in html as you import JavaScript code. JavaScript is executed by the browser of the client and the browsers don't have an included Python interpreter. You have to do it with JavaScript if you want to do it on the Client side.
1
4
0
I'm working on a School Project. I've done a lot of Python Script before and I was wondering if I could like import python in html like javascript? How should I do it? Example is importing time. I want to show a Time clock in my webpage from python script.
Running Python Script in HTML
0
0
0
281
34,251,778
2015-12-13T13:47:00.000
1
0
1
0
python,virtualenv,anaconda,canopy,conda
34,251,914
1
false
0
0
conda's environments are isolated from each other and the system. Normally you should not try to access packages from a different environment. This defeats the whole purpose of virtual environments. That said, conda's environments are by design light weight. If you have two environments using the same interpreter and t...
1
0
0
I am familiar with creating virtualenv with Enthought Canopy's venv command. One of the features that i like about it is the --system-site-packages option which allows me to link all my system libraries to the new environment. Hence allowing me to create "light" environments. This saves a lot of disk space when creatin...
Enthought style virtualenv in Anaconda
0.197375
0
0
207
34,264,314
2015-12-14T10:09:00.000
0
0
1
0
python,algorithm,list,search
34,266,212
2
false
0
0
If you can afford the storage and the preprocessing time, you can insert all triples, quadruples and quintuples found from the lists in three distinct dictionaries. The dictionary entries will store the sets of lists where these tuples occur, and where in the lists. Then a query will be performed in time just proportio...
1
0
0
I'm looking for an efficient python implementation of the following: I have a large set of integer lists between 4 and >100 integers in length but mostly around a length of 4-10. There could be up to a million in total depending on the dataset. They are order specific. The integers themselves will range from 0 to <...
fast search for integer list in much larger set of longer integer lists
0
0
0
298
34,264,710
2015-12-14T10:28:00.000
3
0
1
0
python
56,504,927
6
false
0
0
float('inf') can be used in the comparison, thus making the code simpler and clear. For instance, in merge sort, a float('inf') can be added to the end of subarrays as a sentinel value. Don't confuse with the usage of infinity in maths, after all, programming is not all about maths.
1
101
0
Just wondering over here, what is the point of having a variable store an infinite value in a program? Is there any actual use and is there any case where it would be preferable to use foo = float('inf'), or is it just a little snippet they stuck in for the sake of putting it in?
What is the point of float('inf') in Python?
0.099668
0
0
163,152
34,266,083
2015-12-14T11:37:00.000
1
1
0
0
php,python,session,flask
34,272,457
1
true
1
0
I'm not sure this is the answer you are looking for, but I would not try to have the Flask API access session data from PHP. Sessions and API do not go well together, a well designed API does not need sessions, it is instead 100% stateless. What I'm going to propose assumes both PHP and Flask have access to the user da...
1
2
0
As the title says, I’ am trying to run Flask alongside a PHP app. Both of them are running under Apache 2.4 on Windows platform. For Flask I’m using wsgi_module. The Flask app is actually an API. The PHP app controls users login therefore users access to API. Keep in mind that I cannot drop the use of the PHP app becau...
Run Flask alongside PHP [sharing session]
1.2
1
0
1,770
34,266,159
2015-12-14T11:40:00.000
5
0
1
1
python,linux,debian,pip
61,732,256
10
false
0
0
Here's how, pip3 show numpy | grep "Location:" this will return path/to/all/packages du -h path/to/all/packages last line will contain size of all packages in MB Note: You may put any package name in place of numpy
1
46
0
I'm not sure this is possible. Google does not seem to have any answers. Running Linux Debian can I list all pip packages and size (amount of disk space used) thats installed? i.e. List all pip packages with size on disk?
How to see pip package sizes installed?
0.099668
0
0
34,529
34,267,461
2015-12-14T12:47:00.000
-1
0
0
0
python,django,google-chrome
37,083,575
1
false
1
0
This could be specific to the server you are using. First try clearing your cookies, but if that does not work, that means you have a faulty server and I don't know how to fix that other than getting another one.
1
0
0
I have a django api which returns content fine in my localhost. But when I run it production. it giving me 324 error [ empty content response error]. I had printed api response which is fine. But even before api runs for completions, chrome browser throwing 324 error. When I researched a bit. it look like socket conn...
324 error::empty response, django
-0.197375
0
1
649
34,271,634
2015-12-14T16:11:00.000
0
0
1
0
python,caching,ipython
34,275,216
1
false
0
0
(should be a comment) Set the PYTHONDONTWRITEBYTECODE environment variable, which should do the same thing.
1
3
0
When using Python from the command line, one can suppress the output of the _pycache_ directory using the command line option -B. Unfortunately, I wasn; able to find how to suppress this output in iPython. What I have to do when I change a cached module with iPython is the following: Exit from the interpreter Remove ...
Avoid _pycache_ with iPython
0
0
0
206
34,271,752
2015-12-14T16:18:00.000
1
0
0
0
python,django,pydev
34,288,921
1
true
1
0
ok, I found a solution which always works : uninstall and reinstall everything (python, Django, pydev) whitout using the pip
1
0
0
I'm working with Eclipse and suddenly I could not use Django anymore. I tried to make a new project, but an error occurred : "Django not found". I checked the interpreters like it is said in the forums. I have uninstalled and installed Django multiple times, change the pythonpath thousands times, I reinstalled pydev, n...
Error : "Django not found"
1.2
0
0
405
34,275,096
2015-12-14T19:30:00.000
0
0
0
0
python,math,matplotlib
34,277,060
2
false
0
0
The function is evaluated at every grid node, and compared to the iso-level. When there is a change of sign along a cell edge, a point is computed by linear interpolation between the two nodes. Points are joined in pairs by line segments. This is an acceptable approximation when the grid is dense enough.
1
0
1
I want to know how the contours levels are chosen in pyplot.contour. What I mean by this is, given a function f(x, y), the level curves are usually chosen by evaluating the points where f(x, y) = c, c=0,1,2,... etc. However if f(x, y) is an array A of nxn points, how do the level points get chosen? I don't mean how do ...
How are the points in a level curve chosen in pyplot?
0
0
0
976
34,277,148
2015-12-14T21:43:00.000
0
0
0
0
python,python-2.7,matplotlib
35,905,473
1
false
0
0
I have the exact same problem. I'm not sure what the issue is but every once in a while, when trying to import matplotlib inside ipython I encounter this error and restarting the computer solves the issue. Maybe that would help in locating the issue?
1
0
1
I am using OSX El Capitan and trying to import matplotlib.pyplot when I do that I get recursive error and at the end it says "ValueError: insecure string pickle" Here is the whole log: --------------------------------------------------------------------------- ValueError Traceback (most ...
Matplotlib error in importing
0
0
0
704
34,281,404
2015-12-15T04:57:00.000
2
0
1
0
python,oop
34,281,474
4
true
0
0
If it's meant to be the "same" method visible in both B and C, it sounds like you need to add another class into the hierarchy below A, but above B and C. Let's call it E. You'll have D and E as subclasses of A, and B and C as subclasses of E.
1
1
0
For example we have a base class called A, and three sub classes called B C D, all inheritance of A. If I want some method only appear in B and C, but not in D. Where should I put this method? If I put it in A, D will have the method it doesn't need. If I put it in B and C, I repeat myself.
Class inheritance: where to put a method?
1.2
0
0
50
34,284,335
2015-12-15T08:34:00.000
0
0
1
0
python,multithreading,kill-process
34,284,612
2
false
0
1
First you can use subprocess.Popen() to spawn child processes, then later you can use Popen.terminate() to terminate them. Note that you could also do everything in a single Python thread, without subprocesses, if you want to. It's perfectly possible to "multiplex" reading from multiple ports in a single event loop.
1
4
0
Kind all, I'm really new to python and I'm facing a task which I can't completely grasp. I've created an interface with Tkinter which should accomplish a couple of apparently easy feats. By clicking a "Start" button two threads/processes will be started (each calling multiple subfunctions) which mainly read data from a...
How to integrate killable processes/thread in Python GUI?
0
0
0
1,596
34,284,385
2015-12-15T08:37:00.000
1
0
0
0
python,twitter,nltk,document-classification
34,300,675
2
false
0
0
I wouldn't be so quick to write off Naive Bayes. It does fine in many domains where there are lots of weak clues (as in "overlapping words"), but no absolutes. It all depends on the features you pass it. I'm guessing you are blindly passing it the usual "bag of words" features, perhaps after filtering for stopwords. We...
1
3
1
I've this CSV file which has comments (tweets, comments). I want to classify them into 4 categories, viz. Pre Sales Post Sales Purchased Service query Now the problems that I'm facing are these : There is a huge number of overlapping words between each of the categories, hence using NaiveBayes is failing. The size...
Classifying sentences with overlapping words
0.099668
0
0
622
34,284,421
2015-12-15T08:39:00.000
2
1
0
1
python,c++,c,language-binding
34,284,538
1
true
0
1
You can call between C, C++, Python, and a bunch of other languages without spawning a separate process or copying much of anything. In Python basically everything is reference-counted, so if you want to use a Python object in C++ you can simply use the same reference count to manage its lifetime (e.g. to avoid copying...
1
2
0
There are multiple questions about "how to" call C C++ code from Python. But I would like to understand what exactly happens when this is done and what are the performance concerns. What is the theory underneath? Some questions I hope to get answered by understanding the principle are: When considering data (especially...
How does calling C or C++ from python work?
1.2
0
0
397
34,287,867
2015-12-15T11:19:00.000
0
0
0
0
python,django,bdd,lettuce
34,333,554
1
false
1
0
I feel like a lonely person asking and answering her own question :D The problem was in importing, which we were not even using, so deleting this line resolved our problem. Hope it would be helpful for someone in the future from sure import basestring
1
0
0
After pulling with rebase changes from VCS I am getting a Key Error when trying to run my Aloe_Django(porting from Lettuce) tests. Before it was working fine, now we can not figure out what we did wrong. The Error is KeyError:< sure.AssertionBuilder object at 0x7fbf588172e8> The error occurs in registry.py file in lin...
Key Error sure.AssertionBuilder object at
0
0
0
77
34,291,760
2015-12-15T14:28:00.000
2
0
1
0
python,c,modulo
46,969,300
2
false
0
0
easily implement a C-like modulo in python. Since C does truncation toward zero when integers are divided, the sign of the remainder is always the sign of the first operand. There are several ways to implement that; pick one you like: def mod(a, b): return abs(a)%abs(b)*(1,-1)[a<0] def mod(a, b): return abs(a)%abs(b...
1
2
0
Modulo operator % on negative numbers is implemented in different way in python and in C. In C: -4 % 3 = -1, while in python:-4 % 3 = 2. I know how to implement python-like modulo in C. I wonder how to do the reverse, that is: easily implement a C-like modulo in python.
How to easily implement C-like modulo (remainder) operation in python 2.7
0.197375
0
0
1,018
34,295,198
2015-12-15T17:04:00.000
1
1
0
1
python,bash,raspberry-pi2,usb-drive,udev
34,300,132
1
true
0
0
Well you probably described you problem. The mount process is too slow. You can mount your usb device from your script.sh Also you probably need to disable automatic USB device mount for your system or the specific device only. If you add a symlink to your udev rule e.g. SYMLINK+="backup", then you can mount this dev...
1
1
0
I am trying to run a script from a udev rule after any USB drive has been plugged in. When I run the script manually, after the USB is mounted normally, it will run fine. The script calls a python program to run and the python program uses a file on the USB drive. No issues there. If I make the script to simply lo...
Run script with udev after USB plugged in on RPi
1.2
0
0
1,205
34,296,703
2015-12-15T18:25:00.000
0
0
1
0
python-2.7
34,296,873
1
false
0
0
Maybe: str.decode("utf-8").replace(u"\u0113", "e")
1
4
0
How to replace in a string character (latin-1) 'ē' whose code is u0113 with 'e' (code UTF-8:u0065) I get the foolowing python error:
How to replace in a string character (latin-1) 'ē' whose code is u0113 with 'e' (code UTF-8:u0065)
0
0
0
143
34,301,518
2015-12-15T23:38:00.000
1
0
0
0
python,sql,generator
63,923,673
3
false
0
0
You can also use faker. just pip install faker Just go through documentation and check it out
1
0
0
I need to create random entries with a given sql-schema in sql with the help of python programming language. Is there a simple way to do that or do I have to write own generators?
How to create random entries in database with python
0.066568
1
0
1,307
34,302,705
2015-12-16T01:51:00.000
1
1
1
0
python
34,302,742
3
false
0
0
This isn't a very high-quality question, but the answer is quite simple. Always yes. The more languages you learn, the more you'll find similarities between them. It will eventually be a matter of applying different algorithms and data structures to get work done instead of choosing programming languages, for general p...
3
0
0
So I've always wanted to learn code/program since I was 14 or so. I took YouTube and even website tutorials for Java, tried to follow along and everything but just didn't get it. I thought that Java was the best and easiest language to learn for a beginner. Well, not for me. Fast forward to the beginning of this school...
After learning one language, are other languages easier?
0.066568
0
0
74
34,302,705
2015-12-16T01:51:00.000
1
1
1
0
python
34,302,725
3
false
0
0
Definitely, it certainly helped in my experience, where my first language was Liberty BASIC, and then Python. I found learning Python easier than learning LB. It's really more to with how you think about your programs, your logical thinking/problem solving skills.
3
0
0
So I've always wanted to learn code/program since I was 14 or so. I took YouTube and even website tutorials for Java, tried to follow along and everything but just didn't get it. I thought that Java was the best and easiest language to learn for a beginner. Well, not for me. Fast forward to the beginning of this school...
After learning one language, are other languages easier?
0.066568
0
0
74
34,302,705
2015-12-16T01:51:00.000
1
1
1
0
python
34,302,757
3
false
0
0
Absolutely. knowing one language always helps learning the new one, especially if they are similar. if you have learned python I'd suggest to move to java. avoid C or C++ they are very theoretics and much harder to learn with no stiff teacher and must-do homeworks.. be aware that python is much less strict than other l...
3
0
0
So I've always wanted to learn code/program since I was 14 or so. I took YouTube and even website tutorials for Java, tried to follow along and everything but just didn't get it. I thought that Java was the best and easiest language to learn for a beginner. Well, not for me. Fast forward to the beginning of this school...
After learning one language, are other languages easier?
0.066568
0
0
74
34,304,044
2015-12-16T04:39:00.000
0
0
1
0
python,path,pycharm
50,773,172
9
false
0
0
Sometimes it is different. I solved my problem by clicking "Run" at the Pycharm's toolbar and then "Edit Configurations..." and I change my Interpreter to another actual one. Just changing it in the settings does not help, but this opperation already does ;)
6
48
0
Recently, I'm unable to use relative paths in my code while using PyCharm. For instance, a simple open('test.txt', 'r') will not work - whereupon I am sure the file exists in the same level as the running py file. PyCharm will return this error. FileNotFoundError: [Errno 2] No such file or directory: After reading a...
PyCharm current working directory
0
0
0
99,363
34,304,044
2015-12-16T04:39:00.000
63
0
1
0
python,path,pycharm
34,567,518
9
false
0
0
Change: Run > Edit Configurations > Working directory, which sets the working directory for a specific project. (This is on a Mac)
6
48
0
Recently, I'm unable to use relative paths in my code while using PyCharm. For instance, a simple open('test.txt', 'r') will not work - whereupon I am sure the file exists in the same level as the running py file. PyCharm will return this error. FileNotFoundError: [Errno 2] No such file or directory: After reading a...
PyCharm current working directory
1
0
0
99,363
34,304,044
2015-12-16T04:39:00.000
0
0
1
0
python,path,pycharm
53,367,250
9
false
0
0
A little clarification for mac users. In mac, what @andere said above is correct for setting working directory. However, if your code is in a different folder, say working_dir/src/ (like classic java/scala file structure) in that case you still need to set your Sources Root. In mac's PyCharm this can be done by right c...
6
48
0
Recently, I'm unable to use relative paths in my code while using PyCharm. For instance, a simple open('test.txt', 'r') will not work - whereupon I am sure the file exists in the same level as the running py file. PyCharm will return this error. FileNotFoundError: [Errno 2] No such file or directory: After reading a...
PyCharm current working directory
0
0
0
99,363
34,304,044
2015-12-16T04:39:00.000
2
0
1
0
python,path,pycharm
51,742,696
9
false
0
0
In PyCharm, click on "run/edit configurations..." Then find your script file in the "Python" dropdown menu. Check the "Working Directory" entry and change it if necessary.
6
48
0
Recently, I'm unable to use relative paths in my code while using PyCharm. For instance, a simple open('test.txt', 'r') will not work - whereupon I am sure the file exists in the same level as the running py file. PyCharm will return this error. FileNotFoundError: [Errno 2] No such file or directory: After reading a...
PyCharm current working directory
0.044415
0
0
99,363
34,304,044
2015-12-16T04:39:00.000
0
0
1
0
python,path,pycharm
68,215,017
9
false
0
0
EXACT ANSWER TO SOLVE THIS ISSUE ,, GO TO EDIT CONFIGURATION (just LEFT side of GREEN CODE RUNNER ICON) click on python (not any specific python script) ONLY SELECT PYTHON then below right side click on [edit configuration templetes] select current working dir by going into those blocks It will change the CWD of all p...
6
48
0
Recently, I'm unable to use relative paths in my code while using PyCharm. For instance, a simple open('test.txt', 'r') will not work - whereupon I am sure the file exists in the same level as the running py file. PyCharm will return this error. FileNotFoundError: [Errno 2] No such file or directory: After reading a...
PyCharm current working directory
0
0
0
99,363
34,304,044
2015-12-16T04:39:00.000
0
0
1
0
python,path,pycharm
51,396,970
9
false
0
0
I too had the same issue few minutes ago...but,with the latest version of PyCharm it is resolved by simply using the relative path of that file.. For instance, a simple f = open('test', 'r') will work.
6
48
0
Recently, I'm unable to use relative paths in my code while using PyCharm. For instance, a simple open('test.txt', 'r') will not work - whereupon I am sure the file exists in the same level as the running py file. PyCharm will return this error. FileNotFoundError: [Errno 2] No such file or directory: After reading a...
PyCharm current working directory
0
0
0
99,363
34,305,656
2015-12-16T06:53:00.000
1
0
1
0
python,ironpython,tibco,spotfire
34,326,443
3
false
0
0
Spotfre has its own IDE for developing scripts but it is very poor one when analysing its functionalities. I dont think you can use any IDE to debug the scripts but you can at least use the one suggested by BendEg to make creation of the code more 'pleasant'.
1
4
0
Can we use any IRONPython editor to develop scripts for Tibco Spotfire controls. Can we use IDLE editor to develop IRONPython scripts for Tibco Spotfire? If yes then how to integrate the tibco module with IDLE editor, Can anyone help on this??
Which IronPython editor I can use to develop scripts for Tibco Spotfire controls
0.066568
0
0
1,385
34,307,237
2015-12-16T08:35:00.000
1
0
1
0
python,python-2.7,weak-references,python-module
61,902,272
1
false
0
0
I was having same issue than you. The problem was that I was naming the file I was trying to run/edit as weakref.py Then, only change the name. I changed name to "weakref_example.py"
1
0
0
There came up strange error from python today. Whatever i want to launch or do, i can't getting error : 'module' has no attribute 'weakvaluedictionary'. Even tried to launch pip install/uninstall and got same error. Nothing has been changed from last day, and yesterday everything was working perfectly. I checked init....
weakref module has no attribute 'weakvaluedictionary'
0.197375
0
0
799
34,308,221
2015-12-16T09:26:00.000
1
0
0
1
python,django,celery,celery-task
34,311,859
1
true
1
0
Executing Celery tasks from a command line utility is the same as executing them from views. If you have a task called foo, then in both cases: Calling foo(...) executes the code of the task as if foo were just a plain Python function. Calling foo.delay(...) executes the code of the task asynchronously, through a Cele...
1
1
0
I'm trying to run a task, using celery 3.1, from a custom management command. If I call my task from a view it works fine but when starting the same task from my management command, the task will only run synchronous in current context (not async via celery). I don't have djcelery installed. What do I need to add to my...
run celery task using a django management command
1.2
0
0
1,782
34,310,736
2015-12-16T11:23:00.000
1
0
0
0
python,google-app-engine,caching,server-side,multilingual
34,314,025
1
false
1
0
I assume the individual product rendering in a particular language accounts for the majority (or at least a big chunk) of the rendering effort for the entire page. You could cache server-side the rendered product results for a particular language, prior to assembling them in a complete results page and sending them to ...
1
0
0
Question: What are the most efficient approaches to multi-lingual data caching on a web server, given that clients want the same base set of data but in their locale format. So 1000 data items max to be cached and then rendered on demand in specific locale format. My current approach is as follows: I have a multilingua...
Issues with Multi-lingual website data caching - Python - Google App Engine
0.197375
0
0
47
34,315,470
2015-12-16T15:08:00.000
0
0
1
1
python,c,ipc
34,316,940
4
false
0
0
If your struct is simple enough, you could even not use IPC at all. Provided, you can serialize it as string parameters that could be used as program arguments and provided the int value to return can be in the range 0-127, you could simply: in C code: prepare the command arguments to pass to the Python script fork-e...
1
7
0
So I am relatively new to IPC and I have a c program that collects data and a python program that analyses the data. I want to be able to: Call the python program as a subprocess of my main c program Pass a c struct containing the data to be processed to the python process Return an int value from the python process ...
IPC between C application and Python
0
0
0
10,304
34,315,691
2015-12-16T15:19:00.000
1
0
1
0
python
34,315,885
2
false
0
0
Since this is a very broad question I will just give you a general answer. You are probably going to want to make a new class that will contain the data for a room. In this class you could have variable that could store randomly generated numbers (using the random module) and then have methods use those numbers to dete...
1
1
0
I'm trying to figure out how to create a completely random maze/dungeon for a small text game I'm working on. I'm really not sure where to start since I've never done anything like this before. How do I do this? I need the rooms to know what mobs it holds, what items are on the ground, where the exits are and what othe...
Randomly generated dungeon with Python
0.099668
0
0
663
34,316,369
2015-12-16T15:50:00.000
0
0
0
0
python,django,redirect,logging,django-middleware
34,317,060
1
false
1
0
Not really, at least in any official way. HTTP requests are independent of each other. You cant tell that one request followed another. That is a reason if you need to maintain state between pages, you end up using sessions and passing session IDs around. For your purposes using session ID to track pages is not reliabl...
1
2
0
I have Django event logging application with middleware, which logs user page views. Currently, if response code is 200, log "User X visited page Y" is saved, but in case of redirect the log should be "User X has been redirected to page Y". Is it possible to determine if response (200) occurred after 302 response redir...
Determine if response results from redirect
0
0
0
62
34,319,011
2015-12-16T18:01:00.000
0
0
0
0
python,csv,pandas
34,323,744
1
false
0
0
I found the mistake. The problem was a thousand separator. When writing the CSV file, most numbers were below thousand and were correctly written to the CSV file. However, this one value was greater than thousand and it was written as "1,123" which pandas did not recognize as a number but as a string.
1
2
1
I'm trying to read a large and complex CSV file with pandas.read_csv. The exact command is pd.read_csv(filename, quotechar='"', low_memory=True, dtype=data_types, usecols= columns, true_values=['T'], false_values=['F']) I am pretty sure that the data types are correct. I can read the first 16 million lines (setting nro...
Pandas: Read CSV: ValueError: could not convert string to float
0
0
0
8,440
34,319,068
2015-12-16T18:04:00.000
0
0
0
1
python,numpy,matplotlib,setup.py
34,319,997
1
true
0
0
This sounds hacky and quite possibly evil, but if you don't have shell access but do have Python access, I suppose you could write a Python script that writes the library files to the proper location. You can determine the location by examining the __file__ value in each module. If this is a file system location the P...
1
0
0
The problem is like this: the python on the server is version 2.4.3 (somewhat obsolete), numpy is version 1.2.1 (obsolete) and matplotlib is version 0.99.1.1 (devastating obsolete + lacks pyplot for some unknown reason). I cannot use shell/bash on server. How can I renew the numpy and matplotlib to current versions?...
Uploading python library to server
1.2
0
0
49
34,322,216
2015-12-16T21:15:00.000
1
0
1
0
python,django
34,322,974
4
false
1
0
It depends on the scope of the Alphabet class. If it is a utility class then I would suggest to put in a utils.py file, for example. But it is perfectly fine to have classes in the views.py file, mainly those dealing with UI processing. Up to you.
2
6
0
I'm learning Django on my own and I can't seem to get a clue of where I implement a regular Python class. What I mean is, I don't know where do the Python classes I write go. Like they go in a separate file and then are imported to the views.py or are the classes implemented inside the views.py file? Example I want to ...
Where to implement python classes in Django?
0.049958
0
0
1,687
34,322,216
2015-12-16T21:15:00.000
1
0
1
0
python,django
34,324,293
4
false
1
0
Distinct to similar frameworks, you can put your Python code anywhere in your project, provided you can reference them later by their import path (model classes are partially an exception, though): Applications are referenced by their import path (or an AppConfig import path). Although there's some magic involving tes...
2
6
0
I'm learning Django on my own and I can't seem to get a clue of where I implement a regular Python class. What I mean is, I don't know where do the Python classes I write go. Like they go in a separate file and then are imported to the views.py or are the classes implemented inside the views.py file? Example I want to ...
Where to implement python classes in Django?
0.049958
0
0
1,687
34,322,297
2015-12-16T21:19:00.000
0
0
1
0
python,logging
34,322,394
1
false
0
0
Ok I found the answer. The master parent for all loggers is root logger - no mater it's name doesn't appear in the canonical name.
1
0
0
I understand and like the idea of hierarchical structure of loggers with canonical module name as the name of the logger. But I don't know how to tie everything up at the top level. Supposing I have application using package1.subpackage1.module1 and package2.subpackage2.module2. And now I'd like to define one handle...
how to gather all module's loggers under one parent?
0
0
0
15
34,323,027
2015-12-16T22:08:00.000
1
0
0
0
python,python-2.7,numpy,pca
34,323,069
2
false
0
0
So if scikit's third eigenvector is (a,-b,-c,-d) then mine is (-a,b,c,d). That's completely normal. If v is an eigenvector of a matrix, then -v is an eigenvector with the same eigenvalue.
1
0
1
I have written a simple PCA code that calculates the covariance matrix and then uses linalg.eig on that covariance matrix to find the principal components. When I use scikit's PCA for three principal components I get almost the equivalent result. My PCA function outputs the third column of transformed data with flipped...
Alternative to numpy's linalg.eig?
0.099668
0
0
593
34,324,386
2015-12-16T23:56:00.000
-1
0
0
0
python,kivy
34,325,646
1
false
0
1
You can just create another image with faded edge and load it.
1
0
0
I have an interface made with Kivy, which has an image in part of it. I want to fade one edge of this image. What's the easiest way of achieving this?
How to add a gradient to an image
-0.197375
0
0
243
34,327,655
2015-12-17T06:03:00.000
2
0
0
0
python,xml,openerp
34,328,053
2
false
1
0
Providing access rule is one part of the solution. If you look at "Access Control List" in "Settings > Technical > Security > Access Controls Lists", you can see that the group Hr Employee has only read access to the model hr.employee. So first you have to provide write access also to model hr.employee for group Employ...
1
0
0
I have created groups to give access rights everything seems fine but I want to custom access - rights for module issue. When user of particular group logins, I want that user only able to create/edit their own issue and can't see other users issue.Please help me out!! Thanks
How to make user can only access their own records in odoo?
0.197375
1
0
6,109
34,333,808
2015-12-17T11:45:00.000
0
0
1
0
python,build,scons
34,335,139
2
false
0
1
Create two Environments, one with each compiler, use where necessary. Then use whichever Environment you need for linking object from either Environment.
1
0
0
I'm trying to set up a complete build environment with SCons and I came across this problem: My project can be compiled with two different compilers (c or cpp compilers) and the resulting object files linked with the same linker. Because of this, I need to know how to split the compilation part from the linking part. A...
How to compile with two different compilers using SCons?
0
0
0
657
34,337,788
2015-12-17T15:06:00.000
1
0
0
1
python,windows,docker,tensorflow
34,340,617
1
false
0
0
If you're using one of the devel tags (:latest-devel or :latest-devel-gpu), the file should be in /tensorflow/tensorflow/models/image/imagenet/classify_image.py. If you're using the base container (b.gcr.io/tensorflow/tensorflow:latest), it's not included -- that image just has the binary installed, not a full source d...
1
2
1
I have installed tensorflow on Windows using Docker, I want to go to the folder "tensorflow/models/image/imagenet" that contains "classify_image.py" python file.. Can someone please how to reach this mentioned path?
Location of tensorflow/models.. in Windows
0.197375
0
0
1,104
34,339,172
2015-12-17T16:08:00.000
0
0
0
0
python,django,django-authentication,django-sites
34,339,800
1
true
1
0
Had the same issue, created default site entry (Id=1) and never had any issue ever since
1
5
0
The following warning appears twice when I run ./manage.py runserver after upgrading Django from 1.7 to 1.8. .../django/contrib/sites/models.py:78: RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else wa...
Upgrading Django to 1.8 produces irrelevant Sites-framework warnings
1.2
0
0
78
34,340,496
2015-12-17T17:15:00.000
0
0
0
0
python,django,django-models,multi-tenant,saas
34,340,595
1
false
1
0
I'm not familiar with Django. But If you going to build a SAAS, one of the main things you need to think about from the beginning is scalability, which of course suggests the 2nd option. 1st one will be a nightmare when your SAAS is expanding.
1
0
0
I have been mainly focused on other frameworks like laravel and express.js. so i am new to django but have build several projects. I need to build a SAAS product. So which is the best approach. Seperate database of each customers Same db with tenant_id mapping Or any other best solutions by SO gurus?
Multitenant SAAS using Django
0
0
0
363
34,341,396
2015-12-17T18:08:00.000
0
1
0
0
python-3.x,python-requests
34,343,323
1
false
0
0
This seems to work now. I believe the issue was linked to an old version of openssl. Once I upgraded even the 301 for a different domain goes through with no errors and that was with verify set to True.
1
0
0
I am using the Python requests module (requests (2.7.0)) and tracking URL requests. Most of these URL's are supposed to trigger a 301 redirect however for some the domain changes as well. These URL's where the 301 is causing a domain name change i.e. x.y.com ends up as a.b.com I get a certificate verify failed. Howeve...
Python requests module results in SSL error for 301 redirects to a different domain
0
0
1
188
34,341,489
2015-12-17T18:13:00.000
3
0
0
0
python,django,python-3.x
34,341,868
1
true
0
0
PyMySQL is a pure-python database connector for MySQL, and can be used as a drop-in replacement using the install_as_MySQLdb() function. As a pure-python implementation, it will have some more overhead than a connector that uses C code, but it is compatible with other versions of Python, such as Jython and PyPy. At th...
1
0
0
MySQLdb as I understand doesn't support Python 3. I've heard about PyMySQL as a replacement for this module. But how does it work in production environment? Is there a big difference in speed between these two? I asking because I will be managing a very active webapp that needs to create entries in the database very of...
MySQL module for Python 3
1.2
1
0
79
34,343,996
2015-12-17T20:51:00.000
1
0
1
0
python,python-2.7,debugging,pdb
34,935,331
1
false
0
0
On my Debian system, various versions of /usr/bin/pdb (including pdb3.5 and pdb2.7) are symlinks pointing at ../lib/python?.?/pdb.py (for the two versions of pdb I mentioned ?.? is 3.5 or 2.7). So for me the module and the script are literally the same file (with two different pathnames). The script conditionally calls...
1
0
0
I find there are two ways to invoke pdb. In OS's shell, run pdb myscript.py, which invokes pdb immediately and allows to run pdb commands on the running of myscript.py. in myscript.py, import pdb module, and add some function from pdb module in myscript.py. Then run myscript.py without pdb as python myscript.py, and w...
How is pdb invoked when running a debugged program till a function from pdb module?
0.197375
0
0
160
34,344,544
2015-12-17T21:27:00.000
0
0
1
0
python-unittest,python-3.5
34,344,545
1
true
0
0
setUpClass was added in 2.7 and 3.2, and should be ignored in 3.1 and 2.6-. So the best option is to create your own subclass of unittest.TestCase and add the warnings.filterwarnings code to the setUpClass function*. *Don't forget to use the classmethod decorator on setUpClass.
1
1
0
In 3.5 DeprecationWarning is explicitly set to show during testing. My package is for 2.7 - 3.5 and uses functions present in 2.7 - 3.4 that were deprecated in 3.5. Using the replacement method would be a pain since it didn't exist before 3.5, plus it isn't going anywhere for years (2020 at the earliest). How do I get...
How to ignore DeprecationWarning during testing in Pythons 2.7 - 3.5?
1.2
0
0
260
34,344,624
2015-12-17T21:32:00.000
1
0
0
0
user-interface,python-3.x,tkinter
34,344,977
1
true
0
1
That usually means that you're trying to call a method on a widget that has been destroyed. The string .52674064 is the internal name of a specific widget. This can easily happen if you call a function via a binding or via after, if the widget is destroyed before the binding or after call has been triggered.
1
0
0
I am trying to run a Tkinter GUI on Python 3.x and When I use the .get command to get the number off a scale, this error pops up Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter\__init__.py", line 1482, in __call__ return self.func(*args) File "C:\Users\Danny\Downlo...
tkinter.TclError: invalid command name ".52674064
1.2
0
0
642
34,357,617
2015-12-18T14:15:00.000
2
0
1
0
python,arrays,numpy,append
70,073,546
2
false
0
0
using np.stack should work but the catch is both arrays should be of 2D form. np.stack([A,B])
1
36
1
I have an array A that has shape (480, 640, 3), and an array B with shape (480, 640). How can I append these two as one array with shape (480, 640, 4)? I tried np.append(A,B) but it doesn't keep the dimension, while the axis option causes the ValueError: all the input arrays must have same number of dimensions.
Append 2D array to 3D array, extending third dimension
0.197375
0
0
65,088
34,357,680
2015-12-18T14:19:00.000
0
0
1
0
python,pdf,encryption,pdfminer
71,596,480
3
false
0
0
This is pdfminer's error, use pdfplumber.open(file_name, password="".encode()) to skip this error or TypeError: can only concatenate str (not "bytes") to str.
1
11
0
I'm trying to extract text from pdf-files and later try to identify the references. I'm using pdfminer 20140328. With unencrypted files its running well, but I got now a file where i get: File "C:\Tools\Python27\lib\site-packages\pdfminer\pdfdocument.py", line 348, in _initialize_password raise PDFEncryptionError('Unk...
PDF Miner PDFEncryptionError
0
0
0
5,581
34,357,818
2015-12-18T14:27:00.000
0
0
0
0
python,qt,pyqt
34,370,666
1
true
0
1
The view asks the model for data by calling data function for all table cells that are visible. The model then queries the database if needed. How this happens in detail depends on the underlying database. The QSqlQueryModel documentation says that: "if the database doesn't return the number of selected rows in a query...
1
0
0
I have a QTableView on top of a QSqlTableModel. My database is sqlite. I know QSqlTableModel lazily loads the data from the database (it actually loads 256 rows at a time), so when the users scrolls the view to the bottom, the model loads the 256 next rows. I would like to know: What is the signal emitted when the use...
What model's slot is called when Qtableview scrolled
1.2
0
0
304
34,360,265
2015-12-18T16:46:00.000
0
0
1
0
python,matplotlib,3d
34,361,488
1
false
0
0
You can use roll function of numpy to rotate your plane and make it parallel with a base plane. now you can choose your plane and plot. Only problem is that at close to edges the value from one side will be added to opposite side.
1
0
1
I have a 3D regular grid of data. I would like to write a routine allowing the user to specify a plane slicing through the data with arbitrary orientation and returning a contour plot of the data in the plane. Is there a ready-made way in matplotlib to do this? Could find anything in the docs.
plotting 2D slice of arbitrary orientation through 3D data in matplotlib
0
0
0
494
34,361,728
2015-12-18T18:20:00.000
0
0
1
0
python,windows,ui-automation,pyautogui
34,362,035
3
false
0
0
I would go with option one but I would sleep for 2 seconds if that is the minimum average time required the open a window. After 2 seconds, I would check if the window has appeared and if not, then I would sleep again for 2 seconds. That would possibly save more time than sleeping for 5 seconds. But since trying to ch...
1
4
0
I am using PyAutoGUI library of Python to automate GUI. The application which I am automating opens a new window after I am done with data entry on my current window. Everything is taken care by python automation (data entry in my current window and the click required to open the window). When the click is performed i...
Windows Desktop GUI Automation using Python - Sleep vs tight loop
0
0
0
9,680
34,365,044
2015-12-18T22:43:00.000
-2
0
1
0
python,windows,opencv
59,330,392
13
false
0
0
While Installing pycharm,dont select virtual environment unless u want it,If you select it ,then it will create a venv file and you need to import all the module by command prompts.Tick the existing interpreter,it will make everything easy.
7
22
0
I am using OpenCV 3 and python 2.7 and coding using PyCharm. The code works fine but PyCharm does not recognize cv2 as a module. It underlines it with a red line, so it doesn't display its functions in the intellisence menu. I tried to set an environment variable OPENCV_DIR but it didn't work OpenCV is extracted in F:...
PyCharm does not recognize cv2 as a module
-0.03076
0
0
90,179
34,365,044
2015-12-18T22:43:00.000
13
0
1
0
python,windows,opencv
49,818,214
13
false
0
0
Try File->Invalidate Caches / Restart... I can't say definitively why this works, but it may have something to do with the cached module definitions that PyCharm uses to provide code hints. In some cases they aren't updated or get corrupted. I just know that it's worked for me.
7
22
0
I am using OpenCV 3 and python 2.7 and coding using PyCharm. The code works fine but PyCharm does not recognize cv2 as a module. It underlines it with a red line, so it doesn't display its functions in the intellisence menu. I tried to set an environment variable OPENCV_DIR but it didn't work OpenCV is extracted in F:...
PyCharm does not recognize cv2 as a module
1
0
0
90,179
34,365,044
2015-12-18T22:43:00.000
0
0
1
0
python,windows,opencv
55,831,215
13
false
0
0
Just install opencv python package from settings.
7
22
0
I am using OpenCV 3 and python 2.7 and coding using PyCharm. The code works fine but PyCharm does not recognize cv2 as a module. It underlines it with a red line, so it doesn't display its functions in the intellisence menu. I tried to set an environment variable OPENCV_DIR but it didn't work OpenCV is extracted in F:...
PyCharm does not recognize cv2 as a module
0
0
0
90,179