Title
stringlengths
15
150
A_Id
int64
2.98k
72.4M
Users Score
int64
-17
470
Q_Score
int64
0
5.69k
ViewCount
int64
18
4.06M
Database and SQL
int64
0
1
Tags
stringlengths
6
105
Answer
stringlengths
11
6.38k
GUI and Desktop Applications
int64
0
1
System Administration and DevOps
int64
1
1
Networking and APIs
int64
0
1
Other
int64
0
1
CreationDate
stringlengths
23
23
AnswerCount
int64
1
64
Score
float64
-1
1.2
is_accepted
bool
2 classes
Q_Id
int64
1.85k
44.1M
Python Basics and Environment
int64
0
1
Data Science and Machine Learning
int64
0
1
Web Development
int64
0
1
Available Count
int64
1
17
Question
stringlengths
41
29k
Dataflow Python SDK Avro Source/Sync
37,866,731
0
1
761
0
python,avro,google-cloud-dataflow
You are correct: the Python SDK does not yet support this, but it will soon.
0
1
0
0
2016-06-13T21:03:00.000
2
1.2
true
37,799,065
1
0
0
1
I am looking to ingest and write Avro files in GCS with the Python SDK. Is this currently possible with Avro leveraging the Python SDK? If so how would I do this? I see TODO comments in the source regarding this so I am not too optimistic.
How to plot data while it's being processed
37,839,374
0
1
67
0
python,plot,gnuplot
You can plot the data as it is being processed, but there's a couple of issues that come along with it in terms of efficiency. Gnuplot needs to do work each time to process your data Gnuplot needs to wait for your operating system to paint your screen whenever it updates Your program needs to wait for Gnuplot to do any of this in order to go to the next step All of these will greatly impact the amount of time you spend waiting for your data. You could potentially have it run every x iterations (eg. every 5 iterations), but even this wouldn't give you much of a speed-up.
0
1
0
0
2016-06-15T15:08:00.000
1
0
false
37,839,265
0
1
0
1
I'm in the process of converting a large (several GBs) bin file to csv format using Python so the resulting data can be plotted. I'm doing this conversion because the bin file is not in a format that a plotting tool/module could understand, so there needs to be some decoding/translation. Right now it seems like Gnuplot is the way to go for such large data size. I'm wondering if instead of waiting for the whole file to finish converting and then running Gnuplot, is there a way to plot the data as it's being processed? Perhaps I could bypass the csv file altogether. Everything I've read so far points to plotting a file with data, but I have not seen any ways of plotting/appending individual data points.
How to install a library using homebrew
37,862,696
1
1
1,993
0
python,homebrew
As others mentioned already: It's not the best idea - at least not in general - to install python packages via your systems package manager. It's better to use pip (ideally in conjunction with virtualenvs). Apart from that, it should be possible to use the package you installed using homebrew from pycharm / python in general. In pycharm you can switch between different interpreters (Settings / Project / Interpreter). You need to to choose the one you installed the package for with homebrew (e.g. the one in /usr/local/Cellar/python//..). If you used brew link the currently active one should be symlinked to /usr/local/bin/python.
0
1
0
0
2016-06-16T13:52:00.000
2
1.2
true
37,861,296
1
0
0
1
I downloaded the QJson python library using brew install qjson. What are the next steps I need to take in order to be able to work with it in PyCharm?
What's the best way to rename files with the same modified date and time?
37,871,733
0
0
49
0
python,windows,file,rename
In pseudocode: Find all files in locations Source and Target. For each file in Source, calculate (checksum, size), and use this as a key in a dict, where the value is the filename. For each file in Target, calculate (checksum, size), and look it up in the dict created previously. If it exists, rename it.
0
1
0
0
2016-06-16T22:26:00.000
1
0
false
37,870,371
1
0
0
1
Path a/b/c/d where folder d has a bunch of files and folders, something like this. Folder E which has abc.txt, def.jpg, and ghi.pst Folder D also has loose files like jkl.pst, mno.jpg, pqr.txt Path w/x/y/z where folder z has a bunch of folders named like a3cj85zblahblahblah asdfljklqwpeoriu833 Each of these folders contains a file, or files from one of the folders in path a/b/c/d. They are the same files except they've been renamed. So the file named abc.txt from a/b/c/d/FolderE is now in any folder in the path w/x/y/z renamed as bf6241b7c8b1.txt. I know it's the same file because I not only compared them but they also have the same modified date, type, and size. I was thinking about using os.rename and os.walk but I don't know where to start. I'm fairly new to Python and need to get this done ASAP in Windows.
Faster Google App Engine Managed VM deploys (Python compat env)?
37,896,863
0
1
36
0
google-app-engine,docker,google-app-engine-python
Well, in general, 10 minute deployment isn't that bad. I use AWS Elastic Beanstalk and it's about the same for a full deployment of a production environment. However, this is totally unacceptable for your everyday development. Since you use docker, I really don't understand, why not to spin up the same container on your local machine and test it locally before releasing to staging? If that is not an option, for some reason, my second bet would be updating code directly inside the container. I've used that trick a lot. As Python a dynamic language, all you need just a fresh copy of your repo, so, you can ssh into your container and check out the code. That said, the feedback loop will be reduced to the time of committing and checking out the code. Additionally, if you set up some hooks on commit, you don't even need to check out the code manually. All in all, this is just my two cents and it would be nice to hear more opinions on that really important issue.
0
1
0
0
2016-06-18T08:20:00.000
1
0
false
37,894,857
0
0
1
1
We're using Google App Engine (GAE) with Managed VMs for a Python compat environment, and deployments take too much time. I haven't done strict calculations, but I'm sure each deployment takes over 10 mins. What can we do to accelerate this? Is this more a GAE or a Docker issue? Haven't tried deploying Docker in other platforms so I'm not sure standard/acceptable deployment times. Having to wait so much to test an app in the staging servers damages our productivity quite a bit. Any help is appreciated. :)
the difference between os.mkdir() and os.makedirs()
63,333,069
-2
6
21,297
0
python-2.7,pycharm
Difference between os.mkdir(dirname) and os.mkdirs(dirname) mkdir() will create only neaded directory. If some of parent directories was not existing, mkdir() will return false. mkdirs() will create the last directory with all missing parent directories.so mkdirs() is more handy.
0
1
0
0
2016-06-21T15:14:00.000
2
-0.197375
false
37,948,294
1
0
0
2
I use python 2.7 to create a spider in Pycharm to get data from website. In the first spider I create a spider in the project folder and use os.mkdir('home/img/') to create a folder to save data. There is no error. In the second spider I create the spider with RedisQueue which is in the project folder and put the Spider.py into /usr/lib/python2.7. when I use os.mkdir('home/img/') it reports the error 'no such file or dir' and I change it to os.makedirs() which works. May I know why the 1st one doesn't meet error? Thanks in advance
the difference between os.mkdir() and os.makedirs()
37,948,589
14
6
21,297
0
python-2.7,pycharm
os.makedirs() : Recursive directory creation function. Like os.mkdir(), but makes all intermediate-level directories needed to contain the leaf directory. What this means is that you should not try to create nested directories with os.mkdir() but use os.makedirs() instead. In your case, I am guessing that you want to create a directory under your home directory, in which case you would need something like os.mkdir("/home/img"), which will fail if you do not have enough permissions. You could try and do something like: os.chdir('/home') and after that os.mkdir('img') so you create home/img in steps! Good luck!
0
1
0
0
2016-06-21T15:14:00.000
2
1.2
true
37,948,294
1
0
0
2
I use python 2.7 to create a spider in Pycharm to get data from website. In the first spider I create a spider in the project folder and use os.mkdir('home/img/') to create a folder to save data. There is no error. In the second spider I create the spider with RedisQueue which is in the project folder and put the Spider.py into /usr/lib/python2.7. when I use os.mkdir('home/img/') it reports the error 'no such file or dir' and I change it to os.makedirs() which works. May I know why the 1st one doesn't meet error? Thanks in advance
Fatal error C1083: Cannot open include file: 'openssl/opensslv.h'
38,144,434
7
20
26,978
0
python,openssl,cryptography,scrapy
Copy "openssl" folder from C:\OpenSSL-Win32\include\ to C:\Pyhton27\include\ and copy all libs from C:\OpenSSL-win32\lib to C:\Python27\Libs\
0
1
0
0
2016-06-21T17:52:00.000
2
1
false
37,951,303
0
0
1
1
I'm trying to install Scrapy, but got this error during installing: build\temp.win-amd64-2.7\Release_openssl.c(429) : fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory I've checked that the file "opensslv.h" is in here "C:\OpenSSL-Win64\include\openssl". And I've also included this "C:\OpenSSL-Win64\include" in the Path, system variables. Stuck on this for hours, can someone please help out? Thanks. The same issue was found for the "cryptography-1.5.2" package
How do I have a bash script continually run during business hours?
37,951,458
0
0
191
0
python,bash,crontab,ubuntu-server
You could create a cronjob that starts the script every 5 minutes (or whatever often you want it to run) and additionally modify the script such that it creates a .lock file which it removes on exiting, but if it encounters it at the beginning it won't do anything (this way you don't have a long-running script active multiple times).
0
1
0
1
2016-06-21T17:55:00.000
1
0
false
37,951,368
0
0
0
1
I have a Python program I run at all times of the day that alerts me when something I am looking for online is posted. I want to give this to my employees but I only want to have it email them during business hours. I have a Ubuntu server and use a .sh. I have a command in crontab that runs on startup. How do I make my command run from 9-5?
Xcode gives error while using Python.framework in iOS ,undefined symbol for architecture i386
38,047,376
1
1
295
0
python,ios,objective-c,xcode
Replacing PyUnicode_AsUTF8 or PyUnicode_FromString for _PyString_FromString PyLong_AsLong for _PyInt_AsLong PyLong_FromLong for _PyInt_FromLong solved my problem.
0
1
0
0
2016-06-22T06:58:00.000
1
1.2
true
37,960,704
1
0
0
1
Undefined symbols for architecture i386: "_PyInt_AsLong", referenced from: _main in main.o "_PyInt_FromLong", referenced from: _main in main.o "_PyString_FromString", referenced from: _main in main.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Using CodeDeploy ValidateService Hook with Python Application
37,980,335
2
1
1,608
0
python,amazon-web-services,amazon-ec2,aws-code-deploy,aws-codepipeline
I would loop in the ValidateService hook, checking for the condition you expect, OR just sleep for 60 seconds, assuming that is the normal initialization time. The ValidateService hook should do just that: make sure the service is fully running before continuing/finalizing the deployment. That depends on your app of course. But consider a loop that pulls a specially designed page EG http://localhost/service-ready. In that URL, test and confirm anything and everything appropriate for your service. Return a -Pending- string if the service is not yet validated. Return a -OK- when everything is 100% Perhaps loop that 10-20 times with a 10 second sleep, and exit when it returns -OK- then throw an error if the service never validates.
0
1
0
0
2016-06-22T12:19:00.000
1
0.379949
false
37,967,838
0
0
1
1
I have an heavy app hosted on AWS. I use CodeDeploy & Code Pipeline (updating from github) to update the servers when a new release is ready (currently running 6 ec2 instances on production environment). I've setup the codedeploy to operate one-by-one and also defined a 300 seconds connection draining on the load balancer. Still, my application is heavy (it loads large dictionary pickle files from the disk to the memory), the process of firing up takes about ~60 seconds. In those 60 seconds CodeDeploy marks the process of deployment to an instance as completed, causing it to join back as a healthy instance to the load balancer - this might cause errors to users trying to reach the application. I thought about using the ValidateService hook, but i'm not sure how to in my case.. Any ideas on how to wait for a full load and readyness of the application before proceeding to the next instance? This is my current AppSpec.yml version: 0.0 os: linux files: - source: /deployment destination: /deployment - source: /webserver/src destination: /vagrant/webserver/src permissions: - object: /deployment pattern: "**" owner: root mode: 644 type: - directory - object: /webserver/src owner: root mode: 644 except: [/webserver/src/dictionaries] type: - directory hooks: ApplicationStop: - location: /deployment/aws_application_stop.sh BeforeInstall: - location: /deployment/aws_before_install.sh AfterInstall: - location: /deployment/aws_after_install.sh ApplicationStart: - location: /deployment/aws_application_start.sh
Execute python script on Jenkins with variables
38,075,436
1
0
3,572
0
python,jenkins
Solution: from os import environ Type = environ['Type']
0
1
0
0
2016-06-22T20:19:00.000
1
0.197375
false
37,977,531
0
0
0
1
I have created a job in Jenkins, for which user provides the value of a specific parameter, let's say PYTHON_PARM, as an input. On this job I execute a python script (using Python Plugin). The problem is that I want to use as a variable the user input $PYTHON_PARM parameter. This is not considered as an environment variable, so when trying to use os.environ['PYTHON_PARM'], this doesn't work. Any idea? Thanks,
Pyinstaller-compiled exe can't find file with absolute path
37,997,430
0
1
2,621
0
python,python-2.7,windows-10,exe,pyinstaller
Solved by adding --onedir which will put everything needed to run the program in one directory in the dist folder.
0
1
0
0
2016-06-23T01:45:00.000
1
1.2
true
37,980,970
1
0
0
1
I compiled my Python GUI with Pyinstaller on Windows 10 but it seems like it cannot find my other script even though I provided the hard-coded absolute path to it (with r'"C:\Program Files...script path..."'). I even tried os.isfile (script path) but it returns False. The python script was compiled with pyinstaller --onefile --windowed --icon=iconimage.ico myscript.py from the command prompt. I use this same command on Ubuntu and the binary works just fine. I read something about Pyinstaller creating a temporary directory which I found, but I don't think it matters where it's running from as long as I give it the full path, so I'm thinking maybe I need more options when compiling? The GUI opens just fine. It's when it needs to call the script that it doesn't do anything. There are no errors when I run it from the command prompt. Please help!
PyCharm cannot catch breakpoints if the python code is running in Maya's Script Editor
37,991,894
0
0
434
0
python-2.7,pycharm,remote-debugging,maya
The break points are for the ide to catch only. Maya's script editor is just a text box with fancy things
0
1
0
0
2016-06-23T05:21:00.000
2
0
false
37,982,930
1
0
0
1
I am debugging a Python code for Maya through the remote debugger in PyCharm. The remote debugger can catch breakpoints as expected if the code is run at the command line, but it fails to do that if the Python code is running inside Maya's Script Editor. The Python code is running on a Ubuntu machine while the PyCharm remote debugger is running on Windows. I launch Maya on the Ubuntu machine from the directory that contains the script. The path mapping of PyCharm is simply set to "." for the Windows path that contains the same python script. Can you help me with this problem? Thanks a lot.
How to control a Windows application from Python
38,046,259
13
5
30,343
0
python,windows,ui-automation
Normally, an application exposes a user interface (UI) for users, and an application programming interface (API) for programming. A human being uses keyboard and mouse to work with the user interface (UI) An application uses programming to work with the application programming interface (API) The UI is designed for humans, and the API is designed for computers. It is sometimes possible to use programming to control the user interface of another program -- so your program acts as if it were using the keyboard and mouse. This technique is often called "UI automation", and programs that do it are sometimes called "robots". It's a big topic, and it can be quite complex. It's almost always better to use an API instead if you can: it's faster, simpler, more reliable. If you do need to use UI automation, there are a few different tools that can help. You are asking about Python, so here are a few UI automation tools that work with Python: AutoIT is a standalone product, but you can use Python to script it. PyWinAuto is designed for use from Python. Sikuli uses computer vision to find parts of the screen. I believe it comes with a recording tool as well. Just to repeat: UI automation is weird and hard. If you can possibly use an API instead, your life will be much easier.
0
1
0
0
2016-06-23T11:37:00.000
3
1
false
37,990,545
0
0
0
1
I have the application installed on my windows PC, I want to launch that application using python and select dropdown options and do some other activities in that application. I was able to launch the application using the os.system command, but I am not able to proceed further. I want my program to do things like: * select from a dropdown menu * click on a button How can my application control the user interface of another application?
How to use pyramid cookie to authenticate user in tornado web framework?
38,032,565
1
2
83
0
python,session,cookies,tornado,pyramid
The two locations are separate origins in HTTP language. By default, they should not share cookies. Before trying to figure out how to pass cookies around I'd try to set up a front end web server like Nginx that would proxy requests between two different backend servers. Both applications could get their own path, served from www.abcd.com.
0
1
0
1
2016-06-23T12:52:00.000
1
0.197375
false
37,992,209
0
0
1
1
In a server, I have a pyramid app running and I plan to have another tornado app running in parallel in the same machine. Let's say the pyramid app is available in www.abcd.com, then the tornado app will be available in www.abcd.com:9000. I want only the authenticated users in the pyramid webapp to be able to access the tornado webapp. My guess is somehow using cookie set by the pyramid app in tornado. Is it possible? What is the best way to do that?
Pyside fail to show tooltip and specific events in Linux
38,057,871
0
0
70
0
python-2.7,docker,ubuntu-14.04,pyside
Ok, after several days of trying figure that this is what was needed: For the tooltip problem: Adding WA_AlwaysShowToolTips Change the stylesheet show that the transparent feature will work only for the QPushButton background and not the entire widget. For the event problem: Add the attribute: WA_Hover Everything worked as should be after that
1
1
0
0
2016-06-23T13:37:00.000
1
0
false
37,993,285
0
0
0
1
I wrote a PySide application that should run on python2.7, on window,Linux and Docker container. The application contains Qtooltip and specific eventFilter that catches HoverEnter\HoverLeave. The application works well on windows 10 and ubuntu 14.04 desktop but when trying to run it inside Ubuntu 14.04 container both features didn't work well: The tooltip - It would seem that the text is covered by other tooltip text or totally black. The eventFilter - The application can't get the hover event (didn't appear). The main difference that I saw was that when running on Ubuntu desktop, some GTk libraries are loaded to the python process (according to the maps files). I tried reproduce the problem by installing everything on Ubuntu server (without Gtk), and got the same effect as inside the container. Even after installing Gtk on the server, still no change. I think that I might have missed some dependencies, but can't find any documentation on the issue. Thanks in advance,
IDLE's subprocess didn't make a connection. Either IDLE can't start or personal firewall software is blocking connection
59,004,916
1
2
15,720
0
python,python-idle
In Windows 10 1. Type in "Controlled folder Access" 2. Select "Allow an app through Controlled folder access" Select yes to "UAC" 3. Click on "+ Add an allowed app" 4. Select "recently blocked apps" 5. Find the executable for the C:\Python27 6. Click the + to add it. 7. Select Close Then try running the Python Shell again. This worked for me 100% Also, add exception through Windows Firewall Python27 select Private and Public.
0
1
1
0
2016-06-23T17:02:00.000
5
0.039979
false
37,997,715
0
0
0
4
I have tried uninstalling it and have searched other answers. None of them have worked; IDLE opens, but I can't run anything I write.
IDLE's subprocess didn't make a connection. Either IDLE can't start or personal firewall software is blocking connection
49,338,940
0
2
15,720
0
python,python-idle
First uninstall the application.Then reinstall it BUT at the time of reinstallation try -n at the end of location adress. It worked for me, you can copy the below text and paste it at the location while installing it. “C:\Program Files\Python32\pythonw.exe” lib\idlelib\idle.py -n
0
1
1
0
2016-06-23T17:02:00.000
5
0
false
37,997,715
0
0
0
4
I have tried uninstalling it and have searched other answers. None of them have worked; IDLE opens, but I can't run anything I write.
IDLE's subprocess didn't make a connection. Either IDLE can't start or personal firewall software is blocking connection
46,725,394
0
2
15,720
0
python,python-idle
IDLE's subprocess didn't make a connection. Either IDLE can't start or a personal firewall software is blocking the connection. Having had this problem myself I did an uninstall and created a new directory in the C drive and reinstalled in that folder, which worked for me.
0
1
1
0
2016-06-23T17:02:00.000
5
0
false
37,997,715
0
0
0
4
I have tried uninstalling it and have searched other answers. None of them have worked; IDLE opens, but I can't run anything I write.
IDLE's subprocess didn't make a connection. Either IDLE can't start or personal firewall software is blocking connection
44,459,007
0
2
15,720
0
python,python-idle
If you at the network environment then check on the secure Group (SG), to see if the user is listed under that group. else as other had been suggested you have to have the (right click on the program the login as Admin right to enable the IDLE to run.
0
1
1
0
2016-06-23T17:02:00.000
5
0
false
37,997,715
0
0
0
4
I have tried uninstalling it and have searched other answers. None of them have worked; IDLE opens, but I can't run anything I write.
How to set path to python (venv) executable in atom editor
38,010,189
0
0
1,646
0
python,virtualenv,atom-editor
It seems that python-autocomplete plugin is all we need in atom python coding. Just set your virtualenv from the console, then type atom . and editor (accompanied with aforementioned plugin) will pick that up. No other configuration is necessary.
0
1
0
0
2016-06-23T18:40:00.000
1
1.2
true
37,999,400
1
0
0
1
I'm trying to switch to Atom Editor for my python projects. I have several of those and each is set up using virtualenv. How do I set up this editor, so that when I open up one project it will be using python.exe from its path and not some other? I don't want to add anything to the init script because, as far as I understand, this script contains global settings. Is there a way to configure the desired behavior 'per project'?
How to get source packages from dir in /usr/lib/python2.7/dist-packages/
38,004,576
1
0
117
0
python,python-2.7,ubuntu,pip
Use dpkg -S <path...> for installed packages, or apt-file search <paths...> for packages that might not be installed.
0
1
0
1
2016-06-23T19:39:00.000
1
1.2
true
38,000,416
1
0
0
1
What is the way to get the name of the package which creates specific dir under /usr/lib/python2.7/dist-packages/ on Ubuntu For example I am trying to get the package name which installs /usr/lib/python2.7/dist-packages/hdinsight_common/ or /usr/lib/python2.7/dist-packages/hdinsight_common/decrypt.sh can anyone help me with this ? Thanks
Do tornado AsyncHTTPClient fetch callbacks get called in order of request or response?
38,003,009
0
0
211
0
python,python-3.x,http,tornado
Callbacks are executed as soon as possible after the event for which they're waiting is complete. So, they are called in response order.
0
1
0
0
2016-06-23T20:15:00.000
1
1.2
true
38,000,992
0
0
0
1
I'm using Tornado's AsyncHTTPClient to fetch a URL multiple times. I pass in a different callback with each request. If I send requests A, B (with associated callbacks Callback_A and Callback_B) to a URL, but the responses come back in the opposite order B, A. Should I expect the callbacks to be called in the order of Callback_A, Callback_B or will they get called in the opposite order? I'd like to have the callbacks called in the order of responses (so Callback_B, Callback_A). If that's not the default behavior is there a way to do that instead?
How to install pygame, cv2, anaconda, pip etc to any one version of python in ubuntu 14.04
38,035,454
0
0
180
0
python,pygame,ubuntu-14.04
First of all I want to thanks Bennet for responding to my question so that I was able to figure out what the problem was. Actually the problem was with aliasing. When I installed cv2 or pygame using apt-get, they were installed for default version but when I installed any package by downloading the installer first (like I installed anaconda), it was installed for python 2.7.11 because 'python' was aliased for this version(that is 2.7.11). So, basically make sure that the default version for which you want to install everything is the one which is aliased as 'python', and everything goes fine. I aliased 'python' for the default version and then installed anaconda via installer and now it has been installed default version.
0
1
0
0
2016-06-24T16:26:00.000
2
0
false
38,018,045
1
0
0
1
I have Ubuntu 14.04 LTS. I guess different versions of python are pre-installed in Ubuntu 14.04. Right now when I type 'python' in terminal it opens python 2.7.11, but I guess the default version of Ubuntu 14.04 is 2.7.6. When I type /usr/bin/python it opens the default version. I know this can be done with making aliases. The real problem is, I have installed pygame, cv2 (that is for image processing) using apt-get. These are installed for default version of python i.e python 2.7.6. Also I have installed anaconda with python 2.7.11 using pip, but again 'pip' and anaconda are installed for 2.7.11. I know python 3 is also pre-installed there but I don't use it. Also I have no python version installed in user/local/bin.Now I want to know why this problem is occurring? How can I fix this now? Also how to import all the libraries for one python version(either default or another) and how to use it? How to configure my settings so that I would not have any problem in future?
what exactly is .bash_profile.pysave?
38,021,808
16
11
3,075
0
python,bash
When python is installed, some installers will modify your .bash_profile. They save your previous version in .bash_profile.pysave.
0
1
0
0
2016-06-24T20:27:00.000
1
1.2
true
38,021,598
0
0
0
1
I just noticed that I have a .bash_profile and a .bash_profile.pysave and I was wondering what the .pysave was, if I can delete it and how/why it came into existence.
python packages with dependencies in windows system
38,023,476
0
0
802
0
python,windows,pyffmpeg
You're basically asking how to quickly set up a development environment to compile a given project. You're generally at the mercy of the project developers and how well they documented the build process. On linux, you often have a package manager to make the installing and resolving of dependencies easy. Since Windows doesn't have a package manager, many popular projects with lots of dependencies will include a download link to a Libraries zip file that contains all the dependencies necessary to compile the source. Instead of running pip each time, it may be faster to just download the source to those python projects and run the setup.py manually, resolving dependencies until it succeeds. In general, for python libraries that wrap C/C++ libraries, you're not going to be able to build the python library if you can't build the corresponding C/C++ library. So, you may want to download the ffmpeg source and try compiling it first. Also, for some compiled python libraries, you may be able to find python wheels, which will contain pre-compiled binaries for your system, making the compile step unnecessary. If the python library wraps another C/C++ library, you'll still need to download and install the appropriate version of the library that it wraps (e.g. ffmpeg)
0
1
0
0
2016-06-24T23:02:00.000
1
1.2
true
38,023,256
1
0
0
1
I am trying to work with python on a new project in my windows system. The project uses ffmpeg and pyrabin among others. I find it extremely difficult to move forward with pip installing these packages as they constantly keep on asking for missing dependencies. Following are some errors: ffvideo\ffvideo.c(254) : fatal error C1083: Cannot open include file: 'libavutil/rational.h': No such file or directory local\temp\pip-build-kvsijc\pyrabin\src\rabin_polynomial.h(38) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory It is taking me forever to resolve each of them. Please advice on how to quickly resolve such missing dependencies. I tried google and it is full of options for linux systems. Any help would be highly appreciated.
How do I install PIP in python 3.5?
38,039,181
0
0
1,881
0
python-3.x
Go to the directory {Your python root dir}\Scripts Then press Shift + Right CLick > Open CMD here Then type in pip install {package name}
0
1
0
0
2016-06-26T07:51:00.000
1
0
false
38,036,339
1
0
0
1
I have a fresh install of python 3.5 on my windows PC and here is my directory of my installation: C:\Users*PCNAME*\AppData\Local\Programs\Python\Python35-32 I have installed it entering python get-pip.py in CMD, it says it is installed successfully but when I enter pip in CMD it says it is not recognized? Please kindly enlighten me
Key bindings for interrupt execution in Python Sublime REPL
53,070,278
0
3
1,773
0
python,sublimetext3,sublimerepl
As mentioned above (a long time ago) the key bindings aren't present for Windows. However, one can Mouse Right Click to open a context menu. From here there are menu options for Kill and Restart. You can also open a sub-menu which allows you send those and other signals including SIGINT.
0
1
0
0
2016-06-26T21:25:00.000
2
0
false
38,043,336
1
0
0
1
I'm using REPL extension for Sublime text 3 for my python projects. Currently when I want to interrupt a running script I have to close to close the REPL window to stop execution and all computations are so far are lost. I was wondering if anybody knows how to interrupt an execution and have a short cut or key bindings for that
Uninstalling Python3.5 from Linux RHEL
38,384,650
0
0
3,916
0
python,linux,python-3.x,rhel,make-install
Because python is integral into the RHEL OS, please explain what you mean by: "and made it default over existing Python2.6 ." Otherwise attempts to "uninstall" your working python install might leave you with a broken RHEL install.
0
1
0
0
2016-06-27T09:14:00.000
3
0
false
38,050,053
1
0
0
2
I installed Python3.5 in Linux machine using configure, make, make install and made it default over existing Python2.6 . Now I want to uninstall Python 3.5 as it is not supporting zlib. How do I uninstall default Python 3.5. Linux is RHEL6.7.
Uninstalling Python3.5 from Linux RHEL
38,050,633
0
0
3,916
0
python,linux,python-3.x,rhel,make-install
you probably can remove the directory that contain the new installation. but the main thing is to remove it from the $PATH.
0
1
0
0
2016-06-27T09:14:00.000
3
0
false
38,050,053
1
0
0
2
I installed Python3.5 in Linux machine using configure, make, make install and made it default over existing Python2.6 . Now I want to uninstall Python 3.5 as it is not supporting zlib. How do I uninstall default Python 3.5. Linux is RHEL6.7.
PyCharm is not able find app.yaml when pushing to GAE
38,060,684
0
0
98
0
python,google-app-engine
The parameter to the appcfg update command is the yaml file or directory containing yaml file
0
1
0
0
2016-06-27T16:53:00.000
1
0
false
38,059,310
0
0
1
1
I wrote a simple pymongo code insert a few values in MongoDB instance on GAE and My app got deployed properly from Pycharm but, I am getting the same error while running following command appcfg.py -A login-services-1354 -V v1 update . on my cloud shell The following is the error I got Usage: appcfg.py [options] update | [file, ...] appcfg.py: error: Directory '/home/seshanthnadal' does not contain configuration file app.yaml Any help would be appreciated!
How can I create a region cache in gem5
43,447,954
0
1
228
0
python,c++,caching,memory-management,gem5
IIUC, you are trying to track misses to a phyAddr across cache levels. I think you can do that by modifying appropriate Request/Response in /src/mem/protocol/*-msg.sm
0
1
0
1
2016-06-29T08:56:00.000
1
0
false
38,094,764
0
0
0
1
Im trying to modify the ~/src/mem/cache/ scripts and code to make a region base cache system for the ARM architecture. so far I have managed to change the SConscript so that a copy of cache.cc,cache.hh and Cache.py is built in the scons but I dont know where I should redirect the memory accessees to the region caches. In other words: I want to be able to direct some mem ref.s based on their mem. address to access D-cacheA and the rest to D-cacheB while cache A & B are the same.
Can't import Pyperclip
65,168,753
1
3
18,433
0
python,python-3.x,python-3.5,pyperclip
For those working in a venv, make sure that you have pyperclip installed in the directory that your venv is running in. Eg. C:\MY_PROJECT\venv\Lib\site-packages should include the pyperclip module. If you don't find it here, have a look at where you installed Python and you'll find it there. Eg. C:\Users\Username\AppData\Local\Programs\Python\Python39\Lib\site-packages
0
1
0
0
2016-06-29T22:54:00.000
3
0.066568
false
38,111,340
1
0
0
2
I am having trouble importing Pyperclip in IDLE. I am running windows 7 (64-bit). I have Python 3.5.2 Installed on: C:\Python\Python35. I opened command prompt and initiated the install by typing pip install pyperclip after changing directory to C:\Python\Python35\Scripts. It successfully installed Pyperclip-1.5.27. I then went to IDLE and typed in import pyperclip but the following error is showing up: Traceback (most recent call last): File "", line 1, in import pyperclip ImportError: No module named 'pyperclip' I tried to fix this by adding "C:\Python\Python35" to the end of the "Path" variable, in the systems environmental variables.
Can't import Pyperclip
38,127,468
6
3
18,433
0
python,python-3.x,python-3.5,pyperclip
It unpacked pyperclip in the wrong directory. I copied the entire pyperclip folder and put it in C:/python/python35, now it works as it should. Seems like a noob mistake on my part, but it took me a long time to figure this out. I hope this helps someone in the future.
0
1
0
0
2016-06-29T22:54:00.000
3
1.2
true
38,111,340
1
0
0
2
I am having trouble importing Pyperclip in IDLE. I am running windows 7 (64-bit). I have Python 3.5.2 Installed on: C:\Python\Python35. I opened command prompt and initiated the install by typing pip install pyperclip after changing directory to C:\Python\Python35\Scripts. It successfully installed Pyperclip-1.5.27. I then went to IDLE and typed in import pyperclip but the following error is showing up: Traceback (most recent call last): File "", line 1, in import pyperclip ImportError: No module named 'pyperclip' I tried to fix this by adding "C:\Python\Python35" to the end of the "Path" variable, in the systems environmental variables.
Receiving an UDP Packet from Arduino in a CrossbarServer in Python
38,119,608
0
0
130
0
python-2.7,sockets,arduino-uno,crossbar,wamp-protocol
Unfortunately you cannot do so directly at the moment. For the time being, you need to connect the Uno to some component which accepts messages from the Uno and can talk WAMP as well. We are working on a C library for lower-end devices, but as far as I can tell (I'm not directly involved) something with the specs of the Uno will remain out of the scope of WAMP even then since the initial plan is that the library itself will consume about 8k of RAM.
0
1
1
0
2016-06-30T03:47:00.000
1
1.2
true
38,113,656
0
0
0
1
I'm new using WAMP protocol and CrossbarIO servers that are based on the WAMP protocol. The problem is. I have and Arduino Uno + EthernetShield and I want to send the information to the CrossbarServer. The Arduino Uno has not support for Autobahn or WAMP or Crossbar. I just can send normal packages via UDP and websocket with an UNO+Ethernet. Is there someway that I can read this UDP packet in the CrossbarServer from the arduino?
cannot get pip to be recognized as a command
38,127,300
1
0
729
0
python,pip
You need to add C:\Python27\Scripts to your path as well. That is where the pip executable lives by default. Also, remember to close and reopen your command shell after you change your path variable to make sure that the update is loaded.
0
1
0
0
2016-06-30T13:54:00.000
1
1.2
true
38,125,246
1
0
0
1
I am trying to install matplotlib into python27 but am running into issues with pip. As stated when I try any 'pip' command I get 'pip' is not recognized as an internal or external command. I checked my path variables and they point to the location of my OSGeo4W Python27 install. get-pip.py works and it even says I am up to date on my pip install. I am wondering if the issue is that I have more than one Python installed on my PC. Arc Desktop decided I needed C:\Python27 and C:\Python34 on top of the OSGeo4W install in the C:\OSGeo4W64\apps\Python27 Anyone know what the issue might be? Can I consolidate my python installs without breaking anything?
How to run python without including ~/.local/lib/pythonX.Y/site-packages in its module search path
38,129,078
1
0
645
0
python,anaconda
Well, there is a -s flag in python executable to disable searching the user site directory (`~/.local/lib/python2.7/site-packages etc). That solves the problem above!
0
1
0
1
2016-06-30T16:47:00.000
1
0.197375
false
38,129,077
1
0
0
1
I have some packages installed under my ~/.local/lib/python2.7/site-packages/ subdir, which was for use with system python (/usr/bin/python). Now I have just installed Anaconda python (which is also python 2.7, but minor version 11). The whole idea of Anaconda distro is to have a self-containing python environment, such that EVERY module resides within anaconda install tree. But what annoys me is that for some reason I cannot disable inclusion of ~/.local/lib/python2.7/site-packages/ from sys.path although I did not have PYTHONPATH environment variable. Is it possible to run python executable (in this case, Anaconda's python executable) without having to implicitly add ~/.local/lib/python2.7/site-packages/ and the eggs underneath it in the python search path? Why this problem? Unfortunately the ~/.local/lib/python2.7/site-packages/easy-install.pth also contains a reference to /usr/lib/python2.7/dist-packages, which causes this system-wide dist-packages to still be searched for.
Error while installing Airflow using pip in windows- Unable to find vcvarsall.bat
38,182,957
0
0
689
0
python,visual-studio,visual-c++,pip,setup.py
Instead of setting VS100COMNTOOLS=%VS110COMNTOOLS% in cmd, i did SET VS100COMNTOOLS=C:\Program Files\Microsoft Visual Studio 11.0\Common7\Tools\ and it was picking correctly but again thrown another pile of errors as VS11 compiler is different and cannot compile Python 3.4 code properly. I uninstalled VS11, Installed VS10 and it worked.
0
1
0
0
2016-06-30T18:12:00.000
1
0
false
38,130,483
1
0
0
1
I was trying to install Airflow in windows through command prompt using pip. The python is 3.4.2, pip included. I am getting the below error. distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat). I have installed Visual studio 2012 but Python 3.4 looks for VS10 by default. I tried to trick Python to use the newer visual studio by Executing the command set VS100COMNTOOLS=%VS110COMNTOOLS%. Adding new system variable VS100COMNTOOLS as variable name and gave the value as VS110COMNTOOLS. Both tricks did not work. I am still getting the same old error. The file vcvarsall.bat is present in C:\Program Files\Microsoft Visual Studio 11.0\VC what is missing here? how can I get rid of this error?
Where can i cache pandas dataframe in tornado requesthandler
38,439,059
0
0
906
0
python,caching,tornado,requesthandler
Depends on how and where you want to be able to access this cache in the future, and how you want to handle invalidation. If the CSV files don't change then this could be as simple as @functools.lru_cache or a global dict. If you need one cache shared across multiple processes then you could use something like memcached or redis, but then you'll still have some parsing overhead depending on what format you use. In any case, there's not really anything Tornado-specific about this.
0
1
0
0
2016-07-01T13:23:00.000
2
1.2
true
38,146,607
0
1
0
1
I want to cache a pandas dataframe into tornado requesthandler. So i don't want to repeat the pd.read_csv() for every hit to that particular url.
How to access the cURL executable with Python subprocess module
38,149,152
2
0
196
0
python,windows,curl
Take a step back and do some sanity checks. Here are some steps to try. Copy the path in your script, and paste it into the file explorer (remove the escape characters) and verify that the path is indeed correct. Verify that you have proper permissions to the path * Copy the executable (curl.exe) to a same location your python script is at, this eliminates the need to specify a path (sanity check) import subprocess path = 'curl.exe' subprocess.call([path]) If this works, you can then move it your expected path and verify
0
1
0
0
2016-07-01T13:47:00.000
1
0.379949
false
38,147,124
0
0
0
1
I am trying to access the curl executable on my computer using a subprocess call, but when I do so, I get the following error: WindowsError: [Error 2] The system cannot find the file specified my code looks as follows path = 'C:\\Users\\Username\\AppData\\Local\\Continuum\\Anaconda2\\Library\\bin\\curl.exe subprocess.call([path]) I know the path is correct, is there a reason that my script is balking at this? As you can see, I am running the Anaconda2 Python Interpreter, not the standard one from Python.org
mido on Python 3.5.1: No module named 'mido'
38,149,378
1
4
2,563
0
python,midi,python-3.5
Installing a module for one python version does not install it for the others. If you're using pip, run something like pip3 install mido. pip defaults to installing for Python 2, so you'll need to explicitly call pip3.
0
1
0
0
2016-07-01T15:44:00.000
1
0.197375
false
38,149,341
1
0
0
1
I'm trying to use mido with Python 3.5.1. I have successfully installed it (it says "successfully installed mido-1.1.14" in command prompt) but when I tried to import it in python, it gives me the message ImportError: No module named 'mido' I understand that mido targets Python 2.7 and 3.2, but does it really not work with 3.5 at all? Or am I missing something here? I'm using Windows 8.1, 64-bit; but my Python 3.5 is 32-bit version. Any help will be appreciated. Thanks!
Create .msg file with task without having outlook installed
38,212,655
1
1
2,600
0
python,django,outlook,msg
Why not create an EML file? It is MIME, so there are hundreds of libraries out there. Outlook will be able to open an EML file just fine. In your particular case, create a MIME file with the vTodo MIME part as the primary MIME part.
0
1
0
0
2016-07-04T08:52:00.000
2
0.099668
false
38,180,458
0
0
1
1
Is there any chance to create a outlook .msg file without having outlook installed. We use a django backend and need to create a msg file containing a task for importing in outlook. Since we use unix-based servers we dont have any chance to get outlook installed (except wine etc..) Is there a component to generate such .msg files in any programming language without having outlook installed?
php exec not working along with wapiti
38,191,469
0
0
72
0
php,python-2.7,exec,wapiti
Look at the php.ini to see if there's anything set for disable_functions. If you're using PHP CLI for the script, you can execute the following command in the shell: php -i | grep disable_functions Also make sure wap.py has execute permissions.
0
1
0
1
2016-07-04T19:49:00.000
1
0
false
38,191,403
0
0
0
1
I have a python script (wap.py) from which I am calling wapiti asynchronously using Popen. Command for it in wap.py: p = Popen("python wapiti domainName", shell = True) When I am running wap.py, it is executing completely fine. But when I am running it using php exec, it doesn't work. Command from php file : exec("python wap.py")
ImportError: No module named win32service
38,198,005
25
5
32,335
0
python,openerp,odoo-8
You need to install pywin32. Either use pip install pywin32 or download from GitHub https://github.com/mhammond/pywin32/releases
0
1
0
0
2016-07-05T07:43:00.000
2
1.2
true
38,197,879
0
0
1
1
I am using odoo8 with python 2.7.9 (64 bit) on eclipse IDE. Python software got corrupted so I had to reinstall it.Now I am facing this new problem ImportError: No module named win32service
Change git hook credentials in Windows
38,217,644
0
1
70
0
python,windows,git,clearcase
Since a git hook executes itself in a git bash, check if that affect how the parameters are passed to the windows executable clearfsimport (especially the path) One simple test: wrap your clearfsimport call in a .bat script, and set the source and destination path in that script, then make your git hook call said script.
0
1
0
0
2016-07-05T22:13:00.000
1
0
false
38,213,691
0
0
0
1
I am running in Windows and have a git post-receive hook that calls a python 3 script. This Python script does a number of things. One of these is to output the username running the git hook. This username is MACHINENAME$ (where the machine name is MACHINENAME), which I think is the Network Service account, but I could be wrong here. After that it calls subprocess.run which execs a call to the ClearCase command clearfsimport. Note that I use the clearfsimport 'nsetevent' switch which does allow other users to check-in to this view, but this doesn't seem to work for the Network Service account. If I run the python command directly as the ClearCase view owner, the clearfsimport succeeds. If I run it as another user, the clearfsimport succeeds. If I run it as a git hook, however, it fails with the following error message: subprocess.CalledProcessError: Command '['clearfsimport', '-recurse', '-nsetevent', '-rmname', '-comment', "This is my comment", '/path/to/clearfsimport/source', '/path/to/ClearCase/view']' returned non-zero exit status 1 What can I do to get this git hook to work correctly? It does not matter if I have to adjust python, git, ClearCase, or Windows, or some combination.
How to add a production config when deploying a docker container?
38,221,268
0
0
38
0
python,docker
You should copy your production-ready config file into the docker container as part of your image-building process (COPY directive in your dockerfile), and then proceed with the same deployment steps you would normally use.
0
1
0
0
2016-07-06T09:25:00.000
1
0
false
38,220,530
0
0
1
1
I used to deploy Python web applications on AWS EC2 instances with Ansible. In my development environment, I use config from a module local_config.py, but in the deployment process, I use an Ansible task to replace this file with a production-ready config. How do I do something similar when building a Docker image?
ipython from windows command line
38,227,674
3
2
6,717
0
ipython
So I figured out a solution - I changed the environment variable PATH to the subfolder with the .exe files. Although the path including this subfolder was listed under %env, it did not work without being referred directly in the System setting.
0
1
0
0
2016-07-06T15:11:00.000
2
0.291313
false
38,227,501
1
0
0
1
I changed the environment variable PATH, to a new value and then back to what I believe was the original one. But now I can't open a .ipynb file through the Windows command line the was I was used to. After changing the directory in command line and running ipython notebook notebook_name.ipynb I get the following message: 'ipython' is not recognized as an internal or external command. My environment variable is set to a folder with python.exe, and this folder includes a subfolder with ipython.exe and jupyter-notebook.exe. When I open iPython command line and type %env, I can see the full path to the correct subfolder under PATH. Can someone point to a solution? Thanks.
Integration openstack &opendaylight
38,247,806
0
0
69
0
python,openstack,openflow,opendaylight
Hmm, well, you could consult the OPNFV (Open Platform for Network Function Virtualization) project. OPNFV builds an integrated release of OpenStack with OpenDaylight as the SDN controller.
0
1
0
0
2016-07-07T09:05:00.000
2
0
false
38,241,463
0
0
0
1
strong texti need your help , i would like to do intergartion between openstack liberty(devstack) and opendaylight Beryllium. some one who know whow? i check lot of in internet but always the same documentation .
Python Network Projects
38,258,777
1
1
411
0
python,network-programming
Backing up and copying configs to server. Automate certain config changes to adhere to standards. Scripts to copy run start on all devices at will. Finding various config entries on all devices that may need to be altered. There are so many possibilities. Search github and pastebin and the overflow sites for anything using: Import netmiko Import paramiko Import ciscoconfparse Scripts using any of those libraries will be network related typically and offer up ideas.
0
1
0
1
2016-07-07T23:57:00.000
2
0.099668
false
38,257,055
0
0
0
1
I originally posted on his on Network Engineering but it was suggested that o post it on here. I've been learning Python and since I work in networking I'd like to start writing a few scripts that I can use in my day to day work tasks with switches. So my question is this, what network projects have you used python in? What sort of tasks have you written scripts for? I'm not asking for source code, I'm interested in what projects people have done to inspire my own coding adventures! Thanks all!
Is it okay to work on Ubuntu while another person working on the same project is working on Windows 7?
38,276,238
0
0
26
0
python-2.7,flask,windows-7,ubuntu-14.04
Are you accessing/manipulating Operating system specific information ? For example, some file attributes, other than the basic attributes, are different on both systems.
0
1
0
0
2016-07-08T22:23:00.000
1
0
false
38,276,184
1
0
0
1
Is it fine to work on Ubuntu while another person working with me on the same project is working on Windows 7? We are using Python 2.7, and Flask, and have set up matching virtual environments.
Linking /usr/local/Cellar/python3/3.5.1... Error: Permission denied - /usr/local/Frameworks
71,665,360
0
1
1,544
0
python,macos
I [believe I] resolved this by chown'ing and chgrp'ing everything in /usr/local/Cellar and then unlinking and relinking: ------ % brew link python3 Linking /usr/local/Cellar/python/3.6.5... Error: Could not symlink bin/2to3 Target /usr/local/bin/2to3 is a symlink belonging to python@3.9. You can unlink it: brew unlink python@3.9 To force the link and overwrite all conflicting files: brew link --overwrite python To list all files that would be deleted: brew link --overwrite --dry-run python kevcool@MacBook-Pro-2 Cellar % brew unlink python@3.9 Unlinking /usr/local/Cellar/python@3.9/3.9.12... 24 symlinks removed. kevcool@MacBook-Pro-2 Cellar % brew link python3 Linking /usr/local/Cellar/python/3.6.5... 25 symlinks created. % python3 --version Python 3.6.5 ------
0
1
0
0
2016-07-11T03:31:00.000
3
0
false
38,298,752
0
0
0
1
I am trying to re-install python3 on my mac using brew by brew install python3. But when proceeding to the the link step, it threw an error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/2to3-3.5 Target /usr/local/bin/2to3-3.5 already exists. You may want to remove it: rm '/usr/local/bin/2to3-3.5' To force the link and overwrite all conflicting files: brew link --overwrite python3 To list all files that would be deleted: brew link --overwrite --dry-run python3 But after using rm '/usr/local/bin/2to3-3.5 and brew link --overwrite python3, an other error occured:Error: Permission denied - /usr/local/Frameworks. And I don't know why this happened, because I cannot see the Frameworks directory under /usr/local/.
Python SSH Server(twisted.conch) change the password prompt
38,324,034
0
0
122
0
python,ssh,twisted.conch,password-prompt
The password prompt is part of keyboard-authentication which is part of the ssh protocol and thus cannot be changed. Technically, the prompt is actually client side. However, you can bypass security (very bad idea) and then output "your codes is"[sic] via the channel
0
1
0
1
2016-07-12T06:49:00.000
1
0
false
38,321,820
0
0
0
1
I wrote a SSH server with Twisted Conch. When I execute "ssh username@xx.xx.xx.xx" command on the client side. My twisted SSH server will return a prompt requesting password that like "username@xx.xx.xx.xx's password: ". But now I want to change this password prompt that like "your codes is:". Dose anyone know how to do it?
PyCluster unable to install package
58,928,704
0
2
4,769
0
python,python-2.7,packages,installation-package
install with pip: pip3 install pyclustering it even works with Anaconda prompt
0
1
0
0
2016-07-12T08:16:00.000
3
0
false
38,323,412
1
0
0
1
This is the error I am getting when trying to install PyCluster. I am using python 2.7 with anaconda in spyder IDE and on windows. Downloading/unpacking PyCluster Getting page http://pypi.python.org/simple/PyCluster URLs to search for versions for PyCluster: * httpss://pypi.python.org/simple/PyCluster/ Getting page httpss://pypi.python.org/simple/PyCluster/ Analyzing links from page httpss://pypi.python.org/simple/pycluster/ Could not find any downloads that satisfy the requirement PyCluster No distributions at all found for PyCluster Exception information: Traceback (most recent call last): File "C:\Users\anankuma\AppData\Local\Continuum\Anaconda\lib\site-packages\pip-1.2.1-py2.7.egg\pip\basecommand.py", line 107, in main status = self.run(options, args) File "C:\Users\anankuma\AppData\Local\Continuum\Anaconda\lib\site-packages\pip-1.2.1-py2.7.egg\pip\commands\install.py", line 256, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "C:\Users\anankuma\AppData\Local\Continuum\Anaconda\lib\site-packages\pip-1.2.1-py2.7.egg\pip\req.py", line 1011, in prepare_files url = finder.find_requirement(req_to_install, upgrade=self.upgrade) File "C:\Users\anankuma\AppData\Local\Continuum\Anaconda\lib\site-packages\pip-1.2.1-py2.7.egg\pip\index.py", line 157, in find_requirement raise DistributionNotFound('No distributions at all found for %s' % req) DistributionNotFound: No distributions at all found for PyCluster Please suggest a workaround. Thanks
Determine if script is being piped to in Python 3
38,340,837
-1
0
172
0
python,python-3.x,stdin,piping
You can test if your program's input is connected to a tty, which may help, depending on your use case: $ python -c 'import sys; print(sys.stdin.isatty())' True $ echo hi | python -c 'import sys; print(sys.stdin.isatty())' False $ python -c 'import sys; print(sys.stdin.isatty())' < foo False
0
1
0
0
2016-07-13T00:12:00.000
1
-0.197375
false
38,340,729
1
0
0
1
If my script needs to behave differently when it is being piped to versus when it is being called normally, how can I determine whether or not it is being piped to? This is necessary for avoiding hanging. I am not talking about merely checking whether or not stdin is empty or not.
Moving a bound ZMQ socket to another process
38,349,487
1
0
324
0
python,sockets,zeromq
The simplest is to create a logic for a pool-of-ports manager ( rather avoid attempts to share / pass ZeroMQ sockets to / among other processes ) One may create a persistent, a-priori known, tcp://A.B.C.D:8765-transport-class based .bind() access-point, exposed to all client processes as a port-assignment service, to which client processes .connect(), handshake in whatever manner is needed to proof an identity/credentials/purpose/etc and .recv() in a coordinated manner one actually free messaging/signalling-service port number, that is system-wide guaranteed to not be used at the very moment / until returned to the port-manager ( a rotating pool of ports is centrally managed, under your code-control, whereas all the sockets, created locally in the distributed process(es)/thread(s) .connect() / .bind()-ing to the pool-manager announced port#, and thus will still remain, and ought remain, consistently within ZeroMQ advice, not to be shared per-se ).
0
1
0
0
2016-07-13T09:52:00.000
1
1.2
true
38,348,268
0
0
0
1
I have a Python program which spawns several other Python programs as subprocesses. One of these subprocesses is supposed to open and bind a ZMQ publisher socket, such that other subprocesses can subscribe to it. I cannot give guarantees about which tcp ports will be available, so when I bind to a random port in the subprocess, my main program will not know what to tell the other subprocesses. Is there a way to bind the socket in the main process and then somehow pass the socket to my subprocess? Or either some other way to preregister the socket or a standard way to pass the port information from the subprocess back to my main process (stdout and stderr are already used by other data)? Just checking for a free port in the main process and passing that to the subprocess is not really optimal, because this could still fail if the socket is being assigned in the meantime. Also, since my program should work on Unix and Windows, I cannot really use ipc sockets, which would otherwise solve my problem.
Move .keras directory in Ubuntu
38,408,813
2
2
680
0
ipython,keras
I don't think keras is the only problem. If you are using theano as a backend, it will create $HOME/.theano/ as well. One dirty trick is to export HOME=/data/username/, but other program than keras or ipython will also treat /data/username/ as $HONE. To avoid that, you can do this locally by calling HOME=/data/username/ ipython or HOME=/data/username/ python kerasProgram.py.
0
1
0
0
2016-07-13T16:44:00.000
1
0.379949
false
38,357,398
1
0
0
1
When I'm in ipython and try to import keras, I get the error No space left on device: /home/username/.keras. How can I change this so that Keras does not use my HOME directory, and instead use /data/username/? I did the same for the directory ~/.ipython. I moved it to the desired location and then did export IPYTHONDIR=/data/username/.ipython, can I do something similar with Keras? More generally, how can I do this for any app that wants to use HOME? Note: Please don't give answers like "you can clean your home" etc. I am asking this for a reason. Thanks!
Install imutils using conda in Ubuntu 16.04 LTS
48,430,119
1
0
3,202
0
python-3.x,image-processing,anaconda,conda,ubuntu-16.04
You can try this conda install -c mlgill imutils
0
1
0
0
2016-07-14T05:13:00.000
4
0.049958
false
38,365,948
1
0
0
1
Hi, I am working in computer vision projects, I installed python 3.5 using anaconda in my laptop (Ubunut16.04 LTS). Can you please tell me, How I install imutils using conda in my ubuntu 16.04 LTS.??????
Python: How to Install gdbm for dbm.gnu
70,973,357
0
5
2,327
1
python-3.x,gdbm
I got similar issue though I am not sure which platform you are using. Steps are: look for file _gdbm.cpython-"python version"-.so example file: _gdbm.cpython-39-darwin.so Once you find the path check which python version in directory path. Try creating same python venv. Execute your code. Before this make sure you have install appropriate gdbm version installed on host machine, for mac it's different for ubuntu it's different name.
0
1
0
0
2016-07-14T23:13:00.000
1
0
false
38,385,630
1
0
0
1
In the Python 3 docs, it states that the dbm module will use gdbm if it's installed. In my script I use from dbm.gnu import open as dbm_open to try and import the module. It always returns with the exception ImportError: No module named '_gdbm'. I've gone to the gnu website and have downloaded the latest version. I installed it using ./configure --enable-libgdbm-compat, make; make check; make install, and it installed with no errors. I can access the man page for the library but I still can't import it into Python 3.5.2 (Anaconda). How do I install the Python module for gdbm?
While Mac OSX has the say command to speak, or so to say, is there any command that is similar for Python?
38,387,870
0
0
449
0
python,macos,subprocess,osx-elcapitan
Thank you everyone for the quick replies. I have been playing with the subprocess module, and I have gotten this to work:import subprocess m=subprocess.Popen(["say","hello"]) print(m) The .Popen command is also a quick way to get this to work. However, this is only working on my Mac and I need it to work on my Raspberry Pi for an interactive feature in my code. (I am using Pi Cam and Infrared Sensors for a robot that wheels around and when it senses people in front of it, says "Hey! Please move out of my way please!"
0
1
0
0
2016-07-15T04:03:00.000
3
0
false
38,387,676
0
0
0
1
While Mac OSX 10.11.5 (El Capitan) has the "say" command to speak in a system generated voice, or so to say, is there any command that is similar for Python that can be used in Python? If Subprocess is utilized, please explain on how to use that.
python subprocess pipe unbuffered behaviour
38,433,285
1
0
546
0
python,pipe,subprocess,buffer
Answering to your questions: No, it will not be stored in memory. The child process will stuck on write operation after exceeding pipe-max-size limit (cat /proc/sys/fs/pipe-max-size); The child process will write about 1M before it will stuck, until the parent process read block of data. After this child process will write next 1024 bytes sequentualy as fast as they will be readed; Yes in case of blocking IO the process will be blocked by the OS when write syscall will be called. In case of non-blocking IO I hope write syscall will return EAGAIN or other system-specific error. So actually the application will stuck while calling write system call waiting for the pipe buffer will available. It doesn't mean that it will hang. For example if an application implements some kind of internal queue and it have more than one thread, it can continue to work and add any data to it's queue while the writting-out thread will wait for the buffer.
0
1
0
0
2016-07-18T08:51:00.000
1
0.197375
false
38,432,336
0
0
0
1
I've the below piece of code to read data from a child process as its generated and write to a file. from subprocess import Popen, PIPE proc = Popen('..some_shell_command..', shell=True, stdout=PIPE) fd = open("/tmp/procout", "wb") while True: data = proc.stdout.read(1024) if len(data) == 0: break fd.write(data) fd.close() 'Popen' default bufsize is 0 => unbuffered. What will happen if for some reason the write-to-file operation experiences a huge latency? Assuming that the child process is supposed to produce 500GB of data, do all those data get stored in memory until the parent reads them all? (OR) Will the child process wait for 1024 bytes of data to be read by the parent before writing the next 1024 bytes to stdout? (OR) Will the child process wait after the OS pipe buffer gets filled and once the parent reads, the child resumes writing again? (OR) ??
Set a Subdirectory's File's Working Path Relative to A Parent Directory in Python
38,439,753
1
0
192
0
python,filepath
If you are running from Project folder, set a variable(PRJ_PATH) to os.getcwd() and use it for opening the file like open(os.path.join(PRJ_PATH, 'data', 'data.txt')) If you are running from subdirectories, set a variable(PRJ_PATH) to os.path.join(os.getcwd(), '..') and then use it for opening the file like open(os.path.join(PRJ_PATH, 'data', 'data.txt'))
0
1
0
0
2016-07-18T14:36:00.000
2
1.2
true
38,439,493
1
0
0
2
I have a project folder, PythonProject. Within that Project folder I have a 2 subdirectories: SubDirectory & DataSubDirectory. Within SubDirectory, I have a python file, TestFile.py which opens an external file, datafile.txt, contained in DataSubDirectory. Currently, I open this file as such; open(..\\DataSubDirectory\\data.txt) Is there a method by which I can set any file paths within my TestFile.py to be relative to the parent project folder, so that if the file were moved to another Sub Directory, or placed in the parent directory even, I would not get a filepath error? The effect being that any file opened as such; open(data\\data.txt) would actually be opened as open(PythonProject\\data\\data.txt), and not relative to whichever directory it is found?
Set a Subdirectory's File's Working Path Relative to A Parent Directory in Python
38,439,755
0
0
192
0
python,filepath
You can use PythonProject = os.path.dirname(os.path.realpath(sys.argv[0])) to set the PythonProject Path
0
1
0
0
2016-07-18T14:36:00.000
2
0
false
38,439,493
1
0
0
2
I have a project folder, PythonProject. Within that Project folder I have a 2 subdirectories: SubDirectory & DataSubDirectory. Within SubDirectory, I have a python file, TestFile.py which opens an external file, datafile.txt, contained in DataSubDirectory. Currently, I open this file as such; open(..\\DataSubDirectory\\data.txt) Is there a method by which I can set any file paths within my TestFile.py to be relative to the parent project folder, so that if the file were moved to another Sub Directory, or placed in the parent directory even, I would not get a filepath error? The effect being that any file opened as such; open(data\\data.txt) would actually be opened as open(PythonProject\\data\\data.txt), and not relative to whichever directory it is found?
Archiving a group of gzipped files
38,442,022
1
0
147
0
python,compression,gzip,tar,gzipstream
A gzipped tar archive is not an archive of compressed files. It is a compressed archive of files. In contrast, a zip archive is an archive of compressed files. An archive of compressed files is a better archive format, if you want to be able to extract (or update) individual files. But it is an inferior compression technique; unless the component files are mostly quite large or already compressed, compressing the files individually results in quite a bit more overhead. Since the primary use case of gzipped tar archives is transmission of complete repositories, and the entire archive is normally decompressed at once, the fact that it is not possible to decompress and extract an individual file [Note 1] is not a huge cost. On the other hand, the improved compression ratio brings a noticeable benefit. To answer the question, the only way to combine multiple gzipped tar archives is to decompress all of them, combine them into a single tar archive, and then recompress the result; option 1 in the original post. Notes Of course, you can decompress the entire archive and extract a single file from the decompressed stream; it is not necessary to save the result of the decompression. The tar utility will do that transparently. But under the hood, the archive itself is being decompressed. It is not even possible to list the contents of a gzipped tar archive without decompressing the entire archive.
0
1
0
0
2016-07-18T15:43:00.000
2
0.099668
false
38,440,916
1
0
0
1
I have a group of about 10 gzipped files that I would like to archive into a single file in order for a user to download. I am wondering what the best approach to this would be. Gunzip everything, then tar-gz the complete set of files into a myfiles.tar.gz? Tar the set of gz files into a myfiles.tar. Option 1 seems to have unnecessary steps as the original files are already compressed. Option 2 seems confusing because there is no indication that the files inside the archive are indeed compressed. How do people usually deal with archiving a group of already compressed files? I am using Python (if it matters), but I am doing the operations via shell executions.
Remove old Python Installation in MAC OS
38,447,997
1
0
1,355
0
python,macos
Don't! The name /Library and /System suggest that they are OS-level directories. Nobody installed them. Instead, Mac and other linux-based systems use them by default for system-level services (and they should not be even manually upgraded or system stability may suffer). For all what matters, you should just prepend your installation directory to a system variable called PATH in your $HOME/.bashrc file. Then, whenever YOU use python, the system will always search for the first occurrence of python on PATH, which is your python. Open terminal, enter the following command (once in a life time): echo "PATH={a-path-to-the-folder-containing-your-executable-python}:\$PATH" >> $HOME/.bashrc To explain it, the quoted command prepends your installation directory as the first place to search for executable files. The >> $HOME/.bashrc write this command to the last line of .bashrc, which is a file that setup your terminal environment automatically upon login.
0
1
0
0
2016-07-18T16:50:00.000
2
0.099668
false
38,442,104
1
0
0
2
I installed python using MacPort and I am satisfied with the result, but found that there are other versions of Python installed in other directories, and can not remember how they were instaldas, it's been five years that use this notebook and perhaps installed by other means a few years. I tried to remove all references to extra Python, beyond that were installed with MacPorts, but do not think like, I tried to remove the directories with the command rm -rfmas even using sudo rm -rf have success. The old instalation are in directories: /System/Library/Frameworks/Python.framework/Versions/ /Library/Python/ How to discover the origin of such facilities and remove permanently?
Remove old Python Installation in MAC OS
38,442,289
1
0
1,355
0
python,macos
Don't remove the system Pythons. They may be used by other programs. (I don't know if anything on OS X actually uses them, but it's best to keep them.) Instead, just make sure that your MacPorts bin directory (at /opt/local/bin) is first on your $PATH.
0
1
0
0
2016-07-18T16:50:00.000
2
1.2
true
38,442,104
1
0
0
2
I installed python using MacPort and I am satisfied with the result, but found that there are other versions of Python installed in other directories, and can not remember how they were instaldas, it's been five years that use this notebook and perhaps installed by other means a few years. I tried to remove all references to extra Python, beyond that were installed with MacPorts, but do not think like, I tried to remove the directories with the command rm -rfmas even using sudo rm -rf have success. The old instalation are in directories: /System/Library/Frameworks/Python.framework/Versions/ /Library/Python/ How to discover the origin of such facilities and remove permanently?
From the terminal verify if python 3 is installed
38,485,489
4
24
34,436
0
bash,python-3.x,terminal
execute the following command. which python3 and check the exit status of the command $?. it will be 0 if user has python 3 installed, 1 otherwise.
0
1
0
0
2016-07-20T15:58:00.000
3
0.26052
false
38,485,373
0
0
0
1
I am writing a shell script, and before the script runs I want to verify that the user has Python 3 installed. Does anyone know or have any ideas of how I could check that, and the output be a boolean value?
how can i restore the backup.py plugin data of errbot running in a docker container
38,557,886
1
2
75
0
python,docker,errbot
I think the best if you run Errbot in a container is to run it with a real database for the persistence (redis for example). Then you can simply run backup.py from anywhere (including your dev machine). Even better, you can just do a backup of your redis directly.
0
1
0
0
2016-07-20T19:12:00.000
1
1.2
true
38,488,977
0
0
1
1
I'm running errbot in a docker container, we did the !backup and we have the backup.py, but when i start the docker container it just run /app/venv/bin/run.sh but i cannot pass -r /srv/backup.py to have all my data restored. any ideas? all the data is safe since the /srv is a mounted volume
Pyspark command in terminal launches Jupyter notebook
38,510,399
11
2
3,753
0
python,pyspark,jupyter,jupyter-notebook
The PYSPARK_DRIVER_PYTHON variable is set to start ipython/jupyter automatically (probably as intended.) Run unset PYSPARK_DRIVER_PYTHON and then try pyspark again. If you wish this to be the default, you'll probably need to modify your profile scripts.
0
1
0
0
2016-07-20T21:13:00.000
1
1.2
true
38,490,946
1
0
1
1
I have run into an issue with spark-submit , throws an error is not a Jupyter Command i.e, pyspark launches a web ui instead of pyspark shell Background info: Installed Scala , Spark using brew on MAC Installed Conda Python 3.5 Spark commands work on Jupyter Notebook 'pyspark' on terminal launches notebook instead of shell Any help is much appreciated.
What will be the Hadoop Streaming Run Command to access the files in the Sub Directory
38,517,426
0
0
136
0
python,python-2.7,hadoop,hadoop-streaming
Use regular expressions: inputfile/* - will work for 1 level of sub directories inputfile/*/* - will work for 2 level of sub directories Run As: hadoop jar /usr/hdp/2.3.2.0-2950/hadoop-mapreduce/hadoop-streaming.jar -mapper "python wordcount_mapper.py" -file wordcount_mapper.py -input inputfile/* -output outputfile3
0
1
0
0
2016-07-20T22:11:00.000
1
1.2
true
38,491,716
0
0
0
1
I have written a mapper program in python for hadoop Map-Reduce framework. And I am executing it through the command: hadoop jar /usr/hdp/2.3.2.0-2950/hadoop-mapreduce/hadoop-streaming.jar -mapper "python wordcount_mapper.py" -file wordcount_mapper.py -input inputfile -output outputfile3 It is working properly if the directory inputfile contains only file. But it is not working and showing error if there is sub directories into the directory inputfile . Like i have two sub directory in (KAKA and KAKU) in inputfile. And the error is showing : 16/07/20 17:01:40 ERROR streaming.StreamJob: Error Launching job : Not a file: hdfs://secondary/user/team/inputfile/kaka So, My question is that what will be the command to reach the files into the Sub Directory.
module error in multi-node spark job on google cloud cluster
38,572,975
0
0
206
0
python-3.x,numpy,pyspark,google-cloud-platform,gcp
Not sure if this qualifies as a solution. I submitted the same job using dataproc on google platform and it worked without any problem. I believe the best way to run jobs on google cluster is via the utilities offered on google platform. The dataproc utility seems to iron out any issues related to the environment.
0
1
0
0
2016-07-21T22:03:00.000
1
0
false
38,515,096
0
1
0
1
This code runs perfect when I set master to localhost. The problem occurs when I submit on a cluster with two worker nodes. All the machines have same version of python and packages. I have also set the path to point to the desired python version i.e. 3.5.1. when I submit my spark job on the master ssh session. I get the following error - py4j.protocol.Py4JJavaError: An error occurred while calling z:org.apache.spark.api.python.PythonRDD.runJob. : org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 2.0 failed 4 times, most recent failure: Lost task 0.3 in stage 2.0 (TID 5, .c..internal): org.apache.spark.api.python.PythonException: Traceback (most recent call last): File "/hadoop/yarn/nm-local-dir/usercache//appcache/application_1469113139977_0011/container_1469113139977_0011_01_000004/pyspark.zip/pyspark/worker.py", line 98, in main command = pickleSer._read_with_length(infile) File "/hadoop/yarn/nm-local-dir/usercache//appcache/application_1469113139977_0011/container_1469113139977_0011_01_000004/pyspark.zip/pyspark/serializers.py", line 164, in _read_with_length return self.loads(obj) File "/hadoop/yarn/nm-local-dir/usercache//appcache/application_1469113139977_0011/container_1469113139977_0011_01_000004/pyspark.zip/pyspark/serializers.py", line 419, in loads return pickle.loads(obj, encoding=encoding) File "/hadoop/yarn/nm-local-dir/usercache//appcache/application_1469113139977_0011/container_1469113139977_0011_01_000004/pyspark.zip/pyspark/mllib/init.py", line 25, in import numpy ImportError: No module named 'numpy' I saw other posts where people did not have access to their worker nodes. I do. I get the same message for the other worker node. not sure if I am missing some environment setting. Any help will be much appreciated.
Jenkins with Windows slave with Python - Setting environment variables while building and using them when running a python script
38,527,694
0
0
766
0
python,jenkins,jenkins-plugins
What I usually do is going on the build output, on the left you will find "Build environment Variables" or something similar and check if you can see them there, but the solution cited on the other SO post works usually for me as well
0
1
0
0
2016-07-22T13:18:00.000
1
0
false
38,527,505
0
0
0
1
I'm currently using a Jenkins build to run a bash command that activates a Python script. The build is parametrised, and i need to be able to set environment variables containing those parameters on the Windows slave to be used by the Python script. So, my question is: How do i set temporary env. variables for the current build and secondly, how do i use Python to retreive them while running a script? An explanation of the process would be great since i couldn't make any solution work.
AWS IOT with DynamoDB logging service issue
38,537,832
0
1
66
0
python,amazon-web-services,amazon-dynamodb,iot
No, it does not. I have done similar setup and it is working fine. Are you sure that your IoT device does not go into some kind of sleep mode after a while ?
0
1
0
1
2016-07-22T13:21:00.000
1
0
false
38,527,573
0
0
1
1
We have implemented a simple DynamoDB database that is updated by a remote IoT device that does not have a user (i.e. root) constantly logged in to the device. We have experience issues in logging data as the database is not updated if a user (i.e. root) is not logged into the device (we log in via a ssh session). We are confident that the process is running in the background as we are using a Linux service that runs on bootup to execute a script. We have verified that the script runs on bootup and successfully pushes data to Dynamo upon user log in (via ssh). We have also tried to disassociate a screen session to allow for the device to publish data to Dynamo but this did not seem to fix the issue. Has anyone else experienced this issue? Does amazon AWS require a user (i.e. root) to be logged in to the device at all times in order to allow for data to be published to AWS?
CGI: Execute python script as root
38,529,657
0
0
690
0
python,apache,cgi
Have you tried chmod 777 foo.py or chmod +x foo.py? Those are generally the commands used to give file permission to run.
0
1
0
1
2016-07-22T14:57:00.000
1
0
false
38,529,591
0
0
0
1
I'm attempting to execute foo.py from mysite.com/foo.py, however the script requires access to directories that would normally require sudo -i root access first. chmod u+s foo.py still doesn't give the script enough permission. What can I do so the script has root access? Thank you!
access jupyter notebook running on vm
57,043,893
0
9
20,157
0
python,vagrant,jupyter-notebook
Looks like that in newer versions of Jupyter the changes that should be done in the configuration is a little different from the above answers (otherwise you can get error "'' does not appear to be an IPv4 or IPv6 address"). The entire solution: Run: jupyter notebook --generate-config Change in the config the bellow: c.NotebookApp.ip = '0.0.0.0' c.NotebookApp.open_browser = False Now you can run Jupyter simply: jupyter notebook
0
1
0
0
2016-07-23T18:32:00.000
5
0
false
38,545,198
1
0
0
2
I want to run jupyter notebook running on my ubuntu vm which i fired using vagrant. $ jupyter notebook --no-browser --port 8004 [I 18:26:10.152 NotebookApp] Serving notebooks from local directory: /home/vagrant/path/to/jupyter/notebook/directory [I 18:26:10.153 NotebookApp] 0 active kernels [I 18:26:10.154 NotebookApp] The Jupyter Notebook is running at: http://localhost:8004/ [I 18:26:10.154 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). Jupyter notebook starts in localhost. But to access the notebook from my host machine I need to start the notebook in 0.0.0.0. How to bind the ip 0.0.0.0 so that it routes to 127.0.0.1 in the vm? My host machine is windows and vm is ubuntu 14.04.4
access jupyter notebook running on vm
70,621,757
1
9
20,157
0
python,vagrant,jupyter-notebook
For my case (using VMware with Ubuntu), the solution was very simple. By default, the network adapter was already in NAT mode. If not, adjust this in the settings of your VM instance. Type ifconfig in a VM terminal to get your local IP, e.g. 192.168.124.131. Start the notebook: jupyter notebook --ip=192.168.124.131 --no-browser The terminal then gives you a link you can use on the host to access jupyter, e.g. http://192.168.124.131:8888/?token=xxxxxxxxxxxxxxxxxxx.
0
1
0
0
2016-07-23T18:32:00.000
5
0.039979
false
38,545,198
1
0
0
2
I want to run jupyter notebook running on my ubuntu vm which i fired using vagrant. $ jupyter notebook --no-browser --port 8004 [I 18:26:10.152 NotebookApp] Serving notebooks from local directory: /home/vagrant/path/to/jupyter/notebook/directory [I 18:26:10.153 NotebookApp] 0 active kernels [I 18:26:10.154 NotebookApp] The Jupyter Notebook is running at: http://localhost:8004/ [I 18:26:10.154 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). Jupyter notebook starts in localhost. But to access the notebook from my host machine I need to start the notebook in 0.0.0.0. How to bind the ip 0.0.0.0 so that it routes to 127.0.0.1 in the vm? My host machine is windows and vm is ubuntu 14.04.4
How to find which version of TensorFlow is installed in my system?
62,434,345
1
367
1,109,737
0
python,ubuntu,tensorflow,command-line,version
Another variation, i guess :P python3 -c 'print(__import__("tensorflow").__version__)'
0
1
0
0
2016-07-24T06:06:00.000
18
0.011111
false
38,549,253
0
0
0
3
I need to find which version of TensorFlow I have installed. I'm using Ubuntu 16.04 Long Term Support.
How to find which version of TensorFlow is installed in my system?
62,218,233
2
367
1,109,737
0
python,ubuntu,tensorflow,command-line,version
If you have TensorFlow 2.x: sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(log_device_placement=True))
0
1
0
0
2016-07-24T06:06:00.000
18
0.022219
false
38,549,253
0
0
0
3
I need to find which version of TensorFlow I have installed. I'm using Ubuntu 16.04 Long Term Support.
How to find which version of TensorFlow is installed in my system?
55,177,324
4
367
1,109,737
0
python,ubuntu,tensorflow,command-line,version
Easily get KERAS and TENSORFLOW version number --> Run this command in terminal: [username@usrnm:~] python3 >>import keras; print(keras.__version__) Using TensorFlow backend. 2.2.4 >>import tensorflow as tf; print(tf.__version__) 1.12.0
0
1
0
0
2016-07-24T06:06:00.000
18
0.044415
false
38,549,253
0
0
0
3
I need to find which version of TensorFlow I have installed. I'm using Ubuntu 16.04 Long Term Support.
Celery: How to get the task completed time from AsyncResult
38,587,766
1
1
696
0
python,celery
You can get it from the _cache object of the AsyncResult after you have called res.result for example res._cache['date_done']
0
1
0
0
2016-07-26T09:59:00.000
1
1.2
true
38,586,767
0
0
1
1
I need to trace the status for the tasks. i could get the 'state', 'info' attribute from the AsyncResult obj. however, it looks there's no way to get the 'done_date'. I use MySQL as result backend so i could find the date_done column in the taskmeta table, but how could i get the task done date directly from AysncResult obj? thanks
Unable to submit python files to HTCondor- placed in 'held'
38,618,691
0
0
197
1
python,ubuntu
Update, managed to solve my problem. I needed to make sure that all directory paths were correct as I found that HTCondor was looking within its own files for the resources my submission program used. I therefore needed to define a variable in the .py file that contains the directory to the resource
0
1
0
0
2016-07-26T15:03:00.000
1
0
false
38,593,488
0
0
0
1
I am attempting to run a python 2.7 program on HTCondor, however after submitting the job and using 'condor_q' to assess the job status, I see that the job is put in 'held'. After querying using 'condor_q -analyse jobNo.' the error message is "Hold reason: Error from Ubuntu: Failed to execute '/var/lib/condor/execute/dir_12033/condor_exec.exe': (errno=8: 'Exec format error'). I am unsure how to resolve this error, any help would be much appreciated. As I am relatively new to HTCondor and Ubuntu could any guidance be step wise and easy to follow I am running Ubuntu 16.04 and the latest release of HTCondor
Unexpected socket.getaddrinfo behavior in Python using SOCK_STREAM
38,660,201
0
0
175
0
python,sockets,python-3.x,getaddrinfo
socket.SOCK_STREAM should be passed in the type field. Using it in the proto field probably has a very random effect, which is what you're seeing. Proto only takes the IPPROTO constants. For a raw socket, you should use type = socket.SOCK_RAW. I'm not sure getaddrinfo supports that though, it's mostly for TCP and UDP. It's probably better to have some actual code in your questions. It's much easier to see what's going on then.
0
1
1
0
2016-07-26T15:14:00.000
1
0
false
38,593,744
0
0
0
1
I'm busy trying to use socket.getaddrinfo() to resolve a domain name. When I pass in: host = 'www.google.com', port = 80, family = socket.AF_INET, type = 0, proto = 0, flags = 0 I get a pair of socket infos like you'd expect, one with SocketKind.SOCK_DGRAM (for UDP) and and the other with SocketKind.SOCK_STREAM (TCP). When I set proto to socket.IPPROTO_TCP I narrow it to only TCP as expected. However, when I use proto = socket.SOCK_STREAM (which shouldn't work) I get back a SocketKind.SOCK_RAW. Also, Python won't let me use proto = socket.IPPROTO_RAW - I get 'Bad hints'. Any thoughts on what's going on here?
Anaconda3 install PATH issue
38,609,999
0
0
3,692
0
python,ubuntu,path,anaconda
Fixed the issue with a simple restart. Still not sure where the original PATH without the 3 in it came from as I hadn't restarted before.
0
1
0
0
2016-07-27T09:52:00.000
1
0
false
38,609,561
1
0
0
1
ISSUE FIXED: Restart fixed the issue. I've just finished installing Anaconda3 on Ubuntu 16.04. It automatically added the following line to .bashrc. export PATH="/home/username/anaconda3/bin:$PATH" However when I run python I still get the default python 2 version. printenv PATH gives me /home/username/anaconda/bin:/home/username/bin: ... What is causing the 3 to be dropped from the path?
How to run a Python script without Windows console appearing
62,245,111
0
4
15,470
0
python,windows
The simple answer is to copy the "LazyLibrarian.py" to "LazyLibraryian.pyw" and create a shortcut to Desktop. Then put the shortcut in your startup folder.
0
1
0
0
2016-07-27T12:07:00.000
4
0
false
38,612,509
1
0
0
1
Is there any way to run a Python script without a command shell momentarily appearing? Naming my files with the ".pyw" extension doesn't work.
cx_freeze freezed python program doesn't run - no time to see the error message on executing
38,618,295
0
0
205
0
python,cx-freeze
Executing the exe from the console works out fine. Thanks.
0
1
0
1
2016-07-27T14:42:00.000
1
0
false
38,616,200
0
0
0
1
so I made that python program using several module including os, zipfile, time, datetime, shutil, shelve and ftplib. I froze it with cx_freeze, it won't run on the target machine (but it run on mine). I'm super new to cx_freeze, but I've poked around a bit and I suspect it's a module ot found error. Trouble is, when I execute the exe on the target machine the window doesn't stay open long enough for me to catch the error message so I can't even narrow down the issue to try and solve it. Any idea on how I could deal with it?
Using command line args from different files in python
38,621,007
2
0
275
0
python,command-line-arguments
As for the how/why, sys is only imported once (when python starts up). When sys is imported, it's argv member gets populated with the commandline arguements. Subsequent import statements return the same sys module object so no matter where you import sys from, you'll always get the same object and therefore sys.argv will always be the same list no matter where you reference it in your application. Whether you should be doing commandline parsing in more than one place is a different question. Generally, my answer would be "NO" unless you are only hacking together a script to work for the next 2 or 3 days. Anything that you expect to last should do all it's parsing up front (probably with a robust argument parser like argparse) and pass the data necessary for the various functions/classes to them from it's entry point.
0
1
0
0
2016-07-27T18:46:00.000
1
1.2
true
38,620,899
1
0
0
1
I recently discovered (Much to my surprised) you can call command line args in files other than the one that is explicitly called when you enter it. So, you can run python file1.py abc in command line, and use sys.argv[1] to get the string 'abc' from within file2.py or file3.py. I still feel like this shouldn't work, but I'm glad it does, since it saved me a lot of trouble. But now I'd really appreciate an answer as to why/how this works. I had assumed that sys.argv[1] would be local to each file.
Maven build with Java: How to execute script located in resources?
38,622,730
1
1
1,406
0
java,python,shell,maven
The maven path for all the artifacts is not the same that gets generated when you run it or export the project. You can check this by exporting the project as Jar/War/Ear file and viewing it via winRAR or any other tool. The resources should be in jar parallel to com directory if its a jar project, but you can double check it.
0
1
0
0
2016-07-27T20:22:00.000
1
0.197375
false
38,622,523
0
0
1
1
I am building my Java project with Maven and I have a script file that ends up in the target/classes/resources folder. While I can access the file itself via this.getClass.getResource("/lookUpScript.py").getPath(), I cannot execute a shell command with "." + this.getClass.getResource("/lookUpScript.py").getPath(); this ultimately ends up being ./lookUpScript.py. To execute the shell command I am using a method that is part of my company's code that I can get to work fine with any command not involving a file. Is there a standard way of accessing files located in the resources area of a Maven build that may fix this?
What does "== RESTART ==" in the IDLE Shell mean?
38,867,924
0
1
17,105
0
python,python-idle
The same thing is happening with my shell. In the older versions, this does not happen. I've also noticed that when I press Python 3.5.2 Module Docs, I have my Internet browser open up and I see my directory being displayed onscreen. It looks like: C:\Users\mycomputername\AppData\Local\Programs\Python\Python35-32\DLLs. Is that suppose to happen? Is that secured? I don't know. I've also found that this prints out whenever I "imported" something. So if I use an import command, and put it right before the line of my random name, it will print out that "RESTART" thing. It's always at the beginning. Or what it reads as the beginning.
0
1
0
0
2016-07-28T05:07:00.000
4
0
false
38,627,504
1
0
0
4
I have a simple script I wrote, and when trying to run it (F5) , I get this msg: ================== RESTART: C:\Users\***\Desktop\tst.py ================== I restarted the shell, reopened the script, but still, the same msg appears. I use python 3.5.1 and I tried to simplify the script as much as possible, but I still get this result. Now my script is only one line with a simple print(1) command and I still get this msg. Was there something wrong with the shell installation?
What does "== RESTART ==" in the IDLE Shell mean?
38,627,619
1
1
17,105
0
python,python-idle
I have a simple script I wrote, and when trying to run it (F5) That's the hotkey for IDLE to run a file. It is not ordering to do anything. It's a log statement to explicitly declare that your namespace is being cleared and the file is going to be ran fresh again. no, I didn't tell it to restart But you did... You pressed F5
0
1
0
0
2016-07-28T05:07:00.000
4
1.2
true
38,627,504
1
0
0
4
I have a simple script I wrote, and when trying to run it (F5) , I get this msg: ================== RESTART: C:\Users\***\Desktop\tst.py ================== I restarted the shell, reopened the script, but still, the same msg appears. I use python 3.5.1 and I tried to simplify the script as much as possible, but I still get this result. Now my script is only one line with a simple print(1) command and I still get this msg. Was there something wrong with the shell installation?
What does "== RESTART ==" in the IDLE Shell mean?
57,694,797
0
1
17,105
0
python,python-idle
CIsForCookies, my guess is that you don't actually have a complete script; maybe you have just a function definition and you haven't included a line to run that function. (I had this problem and then remembered to call the function I defined; the problem went away.)
0
1
0
0
2016-07-28T05:07:00.000
4
0
false
38,627,504
1
0
0
4
I have a simple script I wrote, and when trying to run it (F5) , I get this msg: ================== RESTART: C:\Users\***\Desktop\tst.py ================== I restarted the shell, reopened the script, but still, the same msg appears. I use python 3.5.1 and I tried to simplify the script as much as possible, but I still get this result. Now my script is only one line with a simple print(1) command and I still get this msg. Was there something wrong with the shell installation?
What does "== RESTART ==" in the IDLE Shell mean?
64,823,524
0
1
17,105
0
python,python-idle
You may have made the same mistake as me and ran a program and then you wonder why RESTART is all that shows up. My program was working perfectly I just did not print anything or ask for any input so it ran and was done with the program and nothing showed up.
0
1
0
0
2016-07-28T05:07:00.000
4
0
false
38,627,504
1
0
0
4
I have a simple script I wrote, and when trying to run it (F5) , I get this msg: ================== RESTART: C:\Users\***\Desktop\tst.py ================== I restarted the shell, reopened the script, but still, the same msg appears. I use python 3.5.1 and I tried to simplify the script as much as possible, but I still get this result. Now my script is only one line with a simple print(1) command and I still get this msg. Was there something wrong with the shell installation?
What's the advantage of making your appengine app thread safe?
38,665,116
0
1
171
0
python,multithreading,google-app-engine
Multithreading is not related to billing in any way - you still pay for one instance even if 10 threads are running in parallel on that instance.
0
1
0
0
2016-07-29T17:54:00.000
1
0
false
38,664,788
0
0
1
1
I have an appserver that is getting painfully complicated in that it has to buffer data from incoming requests then push those buffers out, via pubsub, after enough has been received. The buffering isn't the problem, but efficient locking is... hairy, and I'm concerned that it's slowing down my service. I'm considering dropping thread safety in order to remove all the locking, but I'm worried that my app instance count will have to double (or more) to handle the same user load. My understanding is that a threadsafe app is one where each thread is a billed app instance. In other words, I get billed for two instances by allowing multiple threads to run in a process, with the only advantage being that the threads can share memory and therefore, have a smaller overall footprint. So to rephrase, does a multithreaded app instance handle multiple simultaneous connections, or is each billed app instance a separate thread - only capable of handling one request at a time? If I remove thread safety, am I going to need to run a larger pool of app instances?
Can I use Hendrix to run Falcon app?
38,676,247
2
2
52
0
python,tornado,wsgi,falcon,hendrix
So found the solution. Created a python file according to hendrix's docs. And imported my app's wsgi callable there.
0
1
0
0
2016-07-30T11:42:00.000
1
0.379949
false
38,673,550
0
0
1
1
Hendrix is a WSGI compatible server written in Tornado. I was wondering if it can be used to run an app written in Falcon ?
Where is python folder? Python install problems
38,686,576
0
0
2,715
0
python,installation
You may try to use which python to find out the location of python in your computer. If it doesn't work and you cannot find where is the your installed directory, you may need to reinstall and make sure you remember the installation directory and add it as a environment variable in windows system.
0
1
0
0
2016-07-31T17:14:00.000
3
0
false
38,686,493
1
0
0
2
I have installed Python 3.5.2 on my windows 8 computer, I tried in cmd python --version and it gave me that stupid error: "python is not recognized as an internal or external command..." I also have no files named python on my computer anywhere. I used the search feature on file explorer and I've search manually. I even looked through the hidden files. I have tried to install Python 3 times and the same thing keeps happening. Any help appreciated.
Where is python folder? Python install problems
38,686,608
4
0
2,715
0
python,installation
In Windows 8 for Python 3.* I believe it is: C:\Users\yourusername\AppData\Local\Programs\Python\ To use that from the Windows command line you will need to add it to your path. Control Panel -> Advanced System Settings -> Environment Variables -> System Variables -> Path Add in the Python path at the end after a semi-colon, do not delete the others.
0
1
0
0
2016-07-31T17:14:00.000
3
1.2
true
38,686,493
1
0
0
2
I have installed Python 3.5.2 on my windows 8 computer, I tried in cmd python --version and it gave me that stupid error: "python is not recognized as an internal or external command..." I also have no files named python on my computer anywhere. I used the search feature on file explorer and I've search manually. I even looked through the hidden files. I have tried to install Python 3 times and the same thing keeps happening. Any help appreciated.
Django: Know when a file is already saved after usign storage.save()
38,701,216
0
0
49
0
python,django,amazon-web-services,amazon-s3
No magic solution here. You have to manage states on your model, specially when working with celery tasks. You might need another field called state with the states: NONE (no action is beeing done), PROCESSING (task was sent to celery to process) and DONE (image was rotated) NONE is the default state. you should set the POCESSING state before calling the celery task (and not inside the celery task, already had bugs because of that) and finally the celery task should set the status to DONE when finished. When the task is fast the user will not see any difference but when it takes some time you might want to add a message "image is being processed, please try again" or something like that At least that's how I do it... Hope this helps
0
1
0
0
2016-08-01T13:15:00.000
1
0
false
38,699,927
0
0
1
1
So I've a Django model which has a FileField. This FileField, contains generally an image. After I receipt the picture from a request, I need to run some picture analysis processes. The problem is that sometimes, I need to rotate the picture before running the analysis (which runs in celery, loading the model again getting the instance by the id). So I get the picture, rotate it and save it with: storage.save(image_name, new_image_file), where storage is the django default storage (using AWS S3) The problem is that in some minor cases (lets say 1 in 1000), the picture is not already rotated when running the analysis process in celery, after the rotation process was executed, but after that, if I open the image, is already rotated, so it seems that the save method is taking some time to update the file in the storage, (asynchronously)... Have anyone had a similar issue? Is there a way to check if the file was already updated, like with a callback or a kind of handler? Many thanks!
Send commands to running script by running it with flags
38,707,485
1
0
1,144
0
python,subprocess,command-line-arguments
There are two things this needs to do: you need to handle command-line flags, and you need to send signals to another process. For the flags, you could use the argparse library, or simply sys.argv. For sending signals, you will need the Process ID (pid) of the already running process. Under Linux you can call ps, and check to see if there is another instance of the script running. If there is, send it a signal. Another alternative to signal handling is DBus. This is less cross-platform capable, though.
0
1
0
0
2016-08-01T20:14:00.000
2
0.099668
false
38,707,350
0
0
0
1
I'm trying to make a python script run in the background, and listen to commands. For example if I run my script: python my_script.py it will start running (and wait for commands). Then I wish to run: python my_script.py --do_something, open a different python process, and it will run a function do_something() in the previous process. I've seen this works on programs like PDPlayer where the flag --play causes the player to start playing a video. Can this also be done in python? I know how to handle the command line arguments using argparse. I need help regarding the communication between the two python processes. Also, I plan to cx_freeze the app, so the PID of the app can be found using psutil by searching the executable name. Thanks. btw, I'm using Windows...
Service inside docker container stops after some time
38,712,037
1
0
1,799
0
python,rest,nginx,docker
Consider doing a docker ps -a to get the stopped container's identifier. -a here just means listing all of the containers you got on your machine. Then do docker inspect and look for the LogPath attribute. Open up the container's log file and see if you could identify the root cause on why the process died inside the container. (You might need root permission to do this) Note: A process can die because of anything, e.g. code fault If nothing suspicious is presented in the log file then you might want to check on the State attribute. Also check the ExitCode attribute to see if you can work backwards to see which line of your application could have exited using that code. Also check the OOMKilled flag, if this is true then it means your container could be killed due to out of memory error. Well if you still can't figure out why then you might need to add more logging into your application to give you more insight on why it died.
0
1
0
0
2016-08-02T04:14:00.000
1
0.197375
false
38,711,658
0
0
1
1
I have deployed a rest service inside a docker container using uwsgi and nginx. When I run this python flask rest service inside docker container, for first one hour service works fine but after sometime somehow nginx and rest service stops for some reason. Has anyone faced similar issue? Is there any know fix for this issue?
Google App Engine - run task on publish
38,742,762
0
1
66
0
python,google-app-engine
The main question will be how to ensure it only runs once for a particular version. Here is an outline on how you might approach it. You create a HasRun module, which you use store each the version of the deployed app and this indicates if the one time code has been run. Then make sure you increment your version, when ever you deploy your new code. In you warmup handler or appengine_config.py grab the version deployed, then in a transaction try and fetch the new HasRun entity by Key (version number). If you get the Entity then don't run the one time code. If you can not find it then create it and run the one time code, either in a task (make sure the process is idempotent, as tasks can be retried) or in the warmup/front facing request. Now you will probably want to wrap all of that in memcache CAS operation to provide a lock or some sort. To prevent some other instance trying to do the same thing. Alternately if you want to use the task queue, consider naming the task the version number, you can only submit a task with a particular name once. It still needs to be idempotent (again could be scheduled to retry) but there will only ever be one task scheduled for that version - at least for a few weeks. Or a combination/variation of all of the above.
0
1
0
0
2016-08-02T14:46:00.000
2
0
false
38,723,681
0
0
1
2
I have been looking for a solution for my app that does not seem to be directly discussed anywhere. My goal is to publish an app and have it reach out, automatically, to a server I am working with. This just needs to be a simple Post. I have everything working fine, and am currently solving this problem with a cron job, but it is not quite sufficient - I would like the job to execute automatically once the app has been published, not after a minute (or whichever the specified time it may be set to). In concept I am trying to have my app register itself with my server and to do this I'd like for it to run once on publish and never be ran again. Is there a solution to this problem? I have looked at Task Queues and am unsure if it is what I am looking for. Any help will be greatly appreciated. Thank you.
Google App Engine - run task on publish
38,794,445
2
1
66
0
python,google-app-engine
Personally, this makes more sense to me as a responsibility of your deploy process, rather than of the app itself. If you have your own deploy script, add the post request there (after a successful deploy). If you use google's command line tools, you could wrap that in a script. If you use a 3rd party tool for something like continuous integration, they probably have deploy hooks you could use for this purpose.
0
1
0
0
2016-08-02T14:46:00.000
2
0.197375
false
38,723,681
0
0
1
2
I have been looking for a solution for my app that does not seem to be directly discussed anywhere. My goal is to publish an app and have it reach out, automatically, to a server I am working with. This just needs to be a simple Post. I have everything working fine, and am currently solving this problem with a cron job, but it is not quite sufficient - I would like the job to execute automatically once the app has been published, not after a minute (or whichever the specified time it may be set to). In concept I am trying to have my app register itself with my server and to do this I'd like for it to run once on publish and never be ran again. Is there a solution to this problem? I have looked at Task Queues and am unsure if it is what I am looking for. Any help will be greatly appreciated. Thank you.