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
Anaconda 4.3, 64-bit (python 3.6), leaves incorrect truncated paths in windows Start menu
42,047,557
2
3
1,261
0
python-3.x,anaconda,jupyter-notebook
Looks like this was fixed in the newest build of anaconda (4.3.0 .1). Unfortunately looks like it requires uninstall and reinstall as the locations seems to have changed drastically (from some subsubsub folder off of AppData to something higher up, under user directory). (But that might be the effect of testing 4.3.0...
0
1
0
0
2017-02-01T01:46:00.000
1
1.2
true
41,970,630
1
0
0
1
After installing anaconda 4.3 64-bit (python 3.6) on windows, and choosing "install for current user only" and "add to path": I noticed that the anaconda program shortcuts don't work on my start menu--they are cut off at the end. Does anyone know how the correct entries should read? (or instead, how to repair the lin...
why os.system('cmd.exe') in pycharm does not open a new console
41,976,142
0
0
658
0
windows,pycharm,python-idle
Check os.environ['PATH'] and os.system("echo $PATH"), they should be the same.
0
1
0
0
2017-02-01T09:20:00.000
1
0
false
41,975,993
1
0
0
1
In my python script, there is os.system('cmd.exe'). The same script opens a new cmd console when executed with Python IDLE, but not when executed in PyCharm. Any help on this?
newbie installing aerospike client to both my python versions
41,991,031
1
1
154
0
aerospike,python-3.6
I figured it out. I just needed to use pip3 instead of pip to install it to correct version of python (though I was only able to get it onto 3.5, not 3.6 for some reason).
0
1
0
1
2017-02-01T20:47:00.000
3
0.066568
false
41,989,455
0
0
0
1
I just followed the instructions on the site and installed aerospike (on linux mint). I'm able to import the aerospike python client module from python 2.7 but not from 3.6 (newly installed). I'm thinking that I need to add the directory to my "python path" perhaps??, but having difficulty understanding how this work...
Running python3 using a Run/Debug config with Vagrant: "Error running x.py Can't run remote python interpreter"
41,991,612
0
0
691
0
python,vagrant,pycharm
Turns out I was only changing the project python interpreter configuration to point to my running Vagrant machine, however, the Run/Debug Configuration wasn't set to use this project interpreter, but rather a different Vagrant machine which was currently down. Fixed by editing the Run/Debug Configuration and changing t...
0
1
0
0
2017-02-01T23:13:00.000
1
1.2
true
41,991,575
0
0
0
1
I get the following PyCharm error when running my python3 interpreter on Vagrant: Error running x.py Can't run remote python interpreter: The provider for this Vagrant-managed machine is reporting that it is not yet ready for SSH. Depending on your provider this can carry different meanings. Make sure your machine i...
/usr/bin/python vs /usr/local/bin/python
41,992,148
0
7
6,843
0
python,linux
1) You should not modify the system's binaries yourself directly 2) If your $PATH variable doesn't contain /usr/local/bin, the naming of that secondary directory isn't really important. You can install / upgrade independently wherever you have installed your extra binaries. 3) For Python specifically, you could also j...
0
1
0
0
2017-02-02T00:00:00.000
2
0
false
41,992,104
1
0
0
1
On Linux, specifically Debian Jessie, should I use /usr/bin/python or should I install another copy in /usr/local/bin? I understand that the former is the system version and that it can change when the operating system is updated. This would mean that I can update the version in the latter independently of the OS. As I...
Screen rotation in windows with python
50,964,423
0
1
4,207
0
python,windows,python-3.x,winapi,pywin32
If you have the rotate shortcut active in windows (CTRL+ALT+ARROW KEY) you can use pyautogui.hotkey function.
0
1
0
0
2017-02-02T16:23:00.000
4
0
false
42,007,272
0
0
0
1
I am trying to write a python script to rotate screen in Windows. I have clues of doing it with Win32api. What are the other possibilities or commands to achieve so(Win32api included).
Ubuntu Server Run Script at Login for Specific User
42,010,021
0
0
65
0
python,ubuntu
It was the path of the .py file being called inside jumpbox.py. I was referencing it only as the filename, without the full path, since it was in the same directory. os.system("python <full path>.py") made it work perfectly. Thanks @Hannu
0
1
0
1
2017-02-02T18:20:00.000
1
0
false
42,009,558
0
0
0
1
I have a python program I want to run when a specific user logs into my Ubuntu Server. Previously, I tried to do this via the command useradd -m -s /var/jumpbox/jumpbox.py jumpbox. This ran the program, but it didn't work the same way it did when I call it via ./jumpbox.py from the /var/jumpbox directory. The problem i...
How to make a package executable from the command line?
42,035,060
1
5
4,192
0
python,linux,chmod
Short answer is No. When you make chmod +x mypackage you are doing nothing because mypackage is a directory and directories already has execute flag (or you will be unable to list their files). If you type: ls -l you will see. Your options to run directly the whole package without installing it is the way you already ...
0
1
0
0
2017-02-03T21:35:00.000
2
1.2
true
42,033,360
1
0
0
1
I want to make a python package executable from the command line. I know you can do chmod +x myfile.py where myfile.py starts with #!/usr/bin/env to make a single file executable using ./myfile.py. I also know you can do python -m mypackage to run a package including a __main__.py. However, if I add the shebang line ...
Ctrl-C for quitting Python in Powershell now not working
58,658,397
0
14
30,551
0
python,powershell,exit
In my case, I found out that right ctrl + c does the trick in anaconda3 powershell - so no remapping necessary - I'm on Windows 10.
0
1
0
0
2017-02-04T10:24:00.000
8
0
false
42,039,231
1
0
0
2
Python fails to quit when using Ctrl-C in Powershell/Command Prompt, and instead gives out a "KeyboardInterrupt" string. Recently I've reinstalled Windows 10. Before the reinstall Ctrl-C quit python (3.5/2.7) fine, with no output. Does anyone know why this has started happening? Whether it's just a simple setting? Th...
Ctrl-C for quitting Python in Powershell now not working
54,466,340
0
14
30,551
0
python,powershell,exit
Hitting Esc button on the upper corner of the keyboard seems to work for me on Windows-7, inside Spyder with numpy running, for Python 3.+ It broke the infinite ...: on an erroneous syntax in the interactive script
0
1
0
0
2017-02-04T10:24:00.000
8
0
false
42,039,231
1
0
0
2
Python fails to quit when using Ctrl-C in Powershell/Command Prompt, and instead gives out a "KeyboardInterrupt" string. Recently I've reinstalled Windows 10. Before the reinstall Ctrl-C quit python (3.5/2.7) fine, with no output. Does anyone know why this has started happening? Whether it's just a simple setting? Th...
FTP Jar file from share path on windows to IFS location in AS400?
42,054,160
0
0
500
0
shell,python-3.x,ftp,ibm-midrange
The CL command RUNRMTCMD can be used to invoke a command on a PC running a rexec() client. iSeries Access for Windows offers such a client, and there are others available. With the iSeries client, the output of the PC command is placed in a spool file on the AS/400, which should contain the results of the FTP session...
0
1
0
1
2017-02-04T19:19:00.000
3
0
false
42,044,560
0
0
0
1
I am looking for an approach / design through which i want to automate the process of FTP from windows location to IFS location present on AS400 environment when ever there is a new file added to windows path. Below is the approach I thought, Please refine it if needed. We have an option WRKJOBSCDEthrough which we ca...
How to run a local python script from django project hosted on aws?
42,053,909
0
0
59
0
python,django
Well, you simply need to find a way for the two of them to communicate without opening huge security holes. My suggestion would be a message queue (rabbit MQ, amazon SQS). The aws application writes jobs to the message queue and a local script runs the worker which is waiting for messages to be written to the queue ...
0
1
0
0
2017-02-05T15:35:00.000
1
1.2
true
42,053,855
0
0
1
1
I have a requirement to run a local python script which takes arguements and will run on local windows computer from python code hosted on aws.
How to access several ports of a Docker container inside the same container?
42,114,253
0
0
42
0
python-3.x,networking,nginx,docker
It's not a good thing to put a lot of applications into one container, normally you should split that with one container per app, it's the way it should be used. But if you absolutly want to use many apps into one container you can use proxy or write a dockerfile that will open your ports itself.
0
1
0
0
2017-02-07T22:54:00.000
2
0
false
42,101,552
0
0
1
1
I am trying to put an application that listens to several ports inside a Docker image. At the moment, I have one docker image with a Nginx server with the front-end and a Python app: the Nginx runs on the port 27019 and the app runs on 5984. The index.html file listens to localhost:5984 but it seems like it only listen...
How to change Default Python for Salt in CentOS 7?
42,263,855
1
1
1,084
0
python,python-2.7,salt,salt-stack,salt-cloud
The salt packages are built using the system python and system site-packages directory. If something doesn't work right, file a bug with salt. You should avoid overwriting the stock python, as that will result in a broken system in many ways.
0
1
0
1
2017-02-08T01:58:00.000
1
0.197375
false
42,103,374
0
0
0
1
I am trying to setup a salt-master/salt-cloud on Centos 7. The issue that I am having is that I need Python 2.7.13 to use salt-cloud to clone vm in vmware vcenter (uses pyvmomi). CentOS comes with Python 2.7.5 which salt has a known issue with (SSL doesn't work). I have tried to find a configuration file on the machine...
How to run Python Scripts on Mac Terminal using Docker with Tensorflow?
44,015,407
2
1
2,693
0
python,macos,docker,machine-learning,tensorflow
Lets assume you have a script my_script.py located at /Users/awesome_user/python_scripts/ on your mac By default the tensorFlow image bash will locate you at /notebooks. Run this command in your terminal: docker run --rm -it -v /Users/awesome_user/python_scripts/:/notebooks gcr.io/tensorflow/tensorflow bash This will m...
0
1
0
0
2017-02-08T15:01:00.000
3
0.132549
false
42,116,597
0
0
0
1
I just got a Mac and shifted from Windows and installed Tensorflow using Docker and everything is working fine, but I want to run a python script that I have from before. Is there any way to run a python script in docker on a Mac, using the terminal?
PyCharm PRO for Mac GAE upload not working
42,124,236
0
0
40
0
python,macos,google-app-engine,pycharm
I did a clean install recently, and not using the AppEngineLauncher anymore - not sure it even ships with the newer SDK. My GAE is located here: /usr/local/google-cloud-sdk/platform/google_appengine Looks like you might be using an older version of AppEngine SDK
0
1
0
0
2017-02-08T18:09:00.000
1
0
false
42,120,541
0
0
1
1
My colleague and I both have Macs, and we both have PyCharm Professional, same version (2016.3.2) and build (December 28, 2016). We use a repository to keep our project directories in sync, and they are currently identical. Under Preferences, we both have "Enable Google App Engine support" checked, and we both have the...
How do I use use python with sublime text 3?
42,132,998
0
0
414
0
python,path,sublimetext3
You have to add Python to the Environmental Variables.
0
1
0
0
2017-02-09T09:28:00.000
2
0
false
42,132,797
1
0
0
1
I have installed Anaconda on Sublime Text 3 and this error pops up each time whenever I try to build a file: 'python' is not recognized as an internal or external command, operable program or batch file. If it involves adding the python to the path file(on windows), could please explain exactly what I need to add. I ...
Exporting data from local standard environment and importing it in Datastore Emulator
42,145,088
1
0
344
0
google-app-engine,google-cloud-datastore,google-app-engine-python
In my tests, I found that the database files created by AppEngine Dev and Datastore Emulator are compatible. I was able to copy the local_db.bin from app-engine database to replace the same file in Datastore Emulator's data directory and was able to access the data.
0
1
0
0
2017-02-09T14:29:00.000
1
0.197375
false
42,139,307
0
0
1
1
We have two app engine apps, which read/save to the same datastore (that is, same project). Datastore is actually the way they "transfer data" to each other. One of the apps is running on standard environment, and the other is running in the flexible environment. In the flexible environment, to run local tests in my ma...
Installing Pyomo on a Mac with Anaconda installed
42,165,867
0
0
726
0
macos,python-3.x,anaconda,pyomo
Pyomo is a Python package, so the way you use it is by importing it in Python scripts and executing those scripts with the Python interpreter that you installed Pyomo into. If you want use the pyomo command to solve a model file (rather than creating a Pyomo solver object in your Python script and running it directly) ...
0
1
0
0
2017-02-10T02:21:00.000
1
1.2
true
42,150,448
1
0
0
1
I am new to Mac, having been well-versed in PCs for over 20 years. Unfortunately, the ease at which I can get "under the hood" with a PC is nigh on impossible for me to intuitively sort out in a Mac (ironic isn't it?). In any case, here is my situation: I am looking to install a number of open-source analyst-centric to...
How to update python functions in airflow without the need to restart airflow webserver
42,405,900
-1
5
6,293
0
python,airflow
This has been an issue with the current version. What I usually do is to duplicate the DAG and change its name so it reflects in the web server. As soon as I finish developing I keep the last renamed and delete the old ones.
0
1
0
0
2017-02-10T14:36:00.000
3
-0.066568
false
42,161,928
1
0
0
1
I'm learning to use airflow to schedule some python ETL processes. Each time I update my python code I have to restart the webserver and also rename the DAG before code changes are picked up by airflow. Is there anyway around this, especially so I dont have to be renaming my DAG each time I make changes?
Purpose of opening and closing files python
42,170,966
0
1
70
0
python
Bash command is actually a small script or program, it's supposed to provide end to end operations. For programming, you'll use more basic unit operations (open, close, read, write, rewind, seek) than a set of operations (copy, delete). It's true both for Python, C, etc. If you go deeper into operating system coding,...
0
1
0
0
2017-02-11T00:28:00.000
1
0
false
42,170,796
1
0
0
1
What is the logic behind python requiring that a file be opened for write or append before being written to? Is there an advantage of doing this compared with something like bash which can just directly write to the file with something like: print 'Hello World' >> output.txt?
How to uninstall Anaconda completely from macOS
49,156,868
2
188
380,553
0
python,macos,anaconda,uninstallation
This is one more place that anaconda had an entry that was breaking my python install after removing Anaconda. Hoping this helps someone else. If you are using yarn, I found this entry in my .yarn.rc file in ~/"username" python "/Users/someone/anaconda3/bin/python3" removing this line fixed one last place needed for co...
0
1
0
0
2017-02-11T23:59:00.000
12
0.033321
false
42,182,706
1
0
0
4
How can I completely uninstall Anaconda from MacOS Sierra and revert back to the original Python? I have tried using conda-clean -yes but that doesn't work. I also remove the stuff in ~/.bash_profile but it still uses the Anaconda python and I can still run the conda command.
How to uninstall Anaconda completely from macOS
71,133,391
1
188
380,553
0
python,macos,anaconda,uninstallation
None of these solutions worked for me. Turns out I had to remove all the hidden files that you can reveal with ls -a My .zshrc file had some anaconda references in it that needed to be deleted
0
1
0
0
2017-02-11T23:59:00.000
12
0.016665
false
42,182,706
1
0
0
4
How can I completely uninstall Anaconda from MacOS Sierra and revert back to the original Python? I have tried using conda-clean -yes but that doesn't work. I also remove the stuff in ~/.bash_profile but it still uses the Anaconda python and I can still run the conda command.
How to uninstall Anaconda completely from macOS
50,745,801
0
188
380,553
0
python,macos,anaconda,uninstallation
Adding export PATH="/Users/<username>/anaconda/bin:$PATH" (or export PATH="/Users/<username>/anaconda3/bin:$PATH" if you have anaconda 3) to my ~/.bash_profile file, fixed this issue for me.
0
1
0
0
2017-02-11T23:59:00.000
12
0
false
42,182,706
1
0
0
4
How can I completely uninstall Anaconda from MacOS Sierra and revert back to the original Python? I have tried using conda-clean -yes but that doesn't work. I also remove the stuff in ~/.bash_profile but it still uses the Anaconda python and I can still run the conda command.
How to uninstall Anaconda completely from macOS
51,944,028
2
188
380,553
0
python,macos,anaconda,uninstallation
After performing the very helpful suggestions from both spicyramen & jkysam without immediate success, a simple restart of my Mac was needed to make the system recognize the changes. Hope this helps someone!
0
1
0
0
2017-02-11T23:59:00.000
12
0.033321
false
42,182,706
1
0
0
4
How can I completely uninstall Anaconda from MacOS Sierra and revert back to the original Python? I have tried using conda-clean -yes but that doesn't work. I also remove the stuff in ~/.bash_profile but it still uses the Anaconda python and I can still run the conda command.
Pip does not work after upgrade to ubuntu-16.10
42,346,675
1
2
1,721
0
python-2.7,python-3.x,ubuntu,pip
Upgrade your setuptools: wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python3 Generally sudo combined with pip is considered harmful, avoid this when your system is not already broken.
0
1
0
0
2017-02-12T06:18:00.000
3
0.066568
false
42,184,792
1
0
0
2
Running a command alongwith pip gives the following error. Even the command pip -V produces the following error. I read that the error is due to setuptools version 31.0.0 and it should be lower than 28.0.0. But the version of my setuptools is 26.1.1 and it still gives the same error. Traceback (most recent call la...
Pip does not work after upgrade to ubuntu-16.10
43,832,299
2
2
1,721
0
python-2.7,python-3.x,ubuntu,pip
The only solution I could find is reinstalling pip. Run these commands on your terminal wget https://bootstrap.pypa.io/get-pip.py sudo -H python get-pip.py --prefix=/usr/local/ However, this works only for pip, not pip3!
0
1
0
0
2017-02-12T06:18:00.000
3
1.2
true
42,184,792
1
0
0
2
Running a command alongwith pip gives the following error. Even the command pip -V produces the following error. I read that the error is due to setuptools version 31.0.0 and it should be lower than 28.0.0. But the version of my setuptools is 26.1.1 and it still gives the same error. Traceback (most recent call la...
How to set a 'system level' environment variable?
42,213,924
1
1
834
0
python,linux,bash,export,subprocess
This isn't a thing you can do. Your subprocess call creates a subshell and sets the env var there, but doesn't affect the current process, let alone the calling shell.
0
1
0
0
2017-02-13T21:23:00.000
3
0.066568
false
42,213,820
0
0
0
2
I'm trying to generate an encryption key for a file and then save it for use next time the script runs. I know that's not very secure, but it's just an interim solution for keeping a password out of a git repo. subprocess.call('export KEY="password"', shell=True) returns 0 and does nothing. Running export KEY="password...
How to set a 'system level' environment variable?
42,213,930
2
1
834
0
python,linux,bash,export,subprocess
subprocess.call('export KEY="password"', shell=True) creates a shell, sets your KEY and exits: accomplishes nothing. Environment variables do not propagate to parent process, only to child processes. When you set the variable in your bash prompt, it is effective for all the subprocesses (but not outside the bash prompt...
0
1
0
0
2017-02-13T21:23:00.000
3
0.132549
false
42,213,820
0
0
0
2
I'm trying to generate an encryption key for a file and then save it for use next time the script runs. I know that's not very secure, but it's just an interim solution for keeping a password out of a git repo. subprocess.call('export KEY="password"', shell=True) returns 0 and does nothing. Running export KEY="password...
jupyter does not show all folders in my home directory
63,427,616
-2
4
6,607
0
python,jupyter-notebook
Open command promt, pip If you use pip, you can install it with: pip install notebook Congratulations, you have installed Jupyter Notebook! To run the notebook, run the following command at the Terminal (Mac/Linux) or Command Prompt (Windows): jupyter notebook
0
1
0
0
2017-02-13T22:43:00.000
2
-0.197375
false
42,214,900
1
0
0
1
When I run my jupyter notebook, the home folder displayed in jupyter is always my home directory even if I start my notebook from a different directory. Also not all folders in my home directory are displayed. I tried to change the access of the unshown folders by using chmod -R 0755 foldername, however the folders do...
Installing python modules in production meteor app hosted with galaxy
42,284,125
0
1
192
0
python,node.js,meteor,meteor-galaxy
It really depends on how horrible you want to be :) No matter what, you'll need a well-specified requirements.txt or setup.py. Once you can confirm your scripts can run on something other than a development machine, perhaps by using a virtualenv, you have a few options: I would recommend hosting your Python scripts as...
0
1
0
1
2017-02-14T02:02:00.000
1
0
false
42,216,640
0
0
1
1
I have a meteor project that includes python scripts in our private folder of our project. We can easily run them from meteor using exec, we just don't know how to install python modules on our galaxy server that is hosting our app. It works fine running the scripts on our localhost since the modules are installed on o...
Undefined symbol after Running get-pip on fresh Python source installation
42,234,395
1
1
465
0
python,c,linux,pip,centos6
After digging a bit more, I found the problem. The symbol was undefined in _io.so. I ldd this library and learned that it was pointing to an older libpython2.7.so (which is the library that happens to define the symbol in its new version). This was because I had the old /opt/python/lib in my LDD_LIBRARY_PATH: linux-vd...
0
1
0
1
2017-02-14T18:44:00.000
1
0.197375
false
42,233,903
1
0
0
1
I've installed python 2.7.13 from sources according to their readme file on CentOS 6.6. (just following the configure/make procedure). I run these python from the command line and seems to work fine. However, as it doesn't come with pip and setuptools, I downloaded get-pip.py and tried to run it this way: /share/apps/P...
How do I use protobuf on a Mac with Python?
42,259,034
0
2
1,350
0
python,macos,protocol-buffers
I was/am using PyCharm. The protobuf library doesn't automatically get linked to the PyCharm interpreter. If you run python script.py from the command line, there are no issues with missing modules.
0
1
0
0
2017-02-14T21:27:00.000
1
1.2
true
42,236,545
0
0
0
1
I installed the package and ran all of the correct commands. I did this for 2.6.1, 2.7, and 3.2. Between each I subsequently uninstalled the previous version. Within each version I went into the python folder and ran the python installation commands. I ran brew install protobuf (and subsequently uninstalled it). I ran ...
how to debug python fabric using pycharm
42,261,986
1
2
1,096
0
python,pycharm,fabric
I haven't used this setup on Windows, but on Linux/Mac, it's fairly straightforward: Create a new Run Configuration in PyCharm for a Python script (when you click the "+" button, select the one labelled "Python") The "Configuration" tab should be open. For the "Script" field, enter the full path to fab.exe, like C:\Py...
0
1
0
0
2017-02-15T11:51:00.000
3
0.066568
false
42,248,607
1
0
0
1
There are some posts on SO and tell me to use fab-script.py as startup script for pycharm. It's exactly what I used before. Now when I upgrade fabric to latest version, fab-script disappeared, and only fab.exe left there. I tried a lot of other ways, but still failed to launch debugger in pycharm.
Apple Swift is overriding Openstack swift package
56,529,866
1
0
416
0
swift,python-2.7
For me, Apple Swift is under /usr/bin/swift and python-swiftclient is under /usr/bin/local/swift. Explicitly invoking it as /usr/bin/local/swift works.
0
1
0
0
2017-02-16T03:28:00.000
2
0.099668
false
42,264,307
0
0
0
1
I have installed OpenStack swift python client (pip install python-swiftclient). However /usr/bin has swift executable (which I can not remove as it is owned by root) and is overriding python swift. Requirement already satisfied: python-swiftclient in /Library/Python/2.7/site-packages Requirement already satisfied: req...
Running cronjob every 5 minutes but stopped after first execution?
42,271,741
0
0
227
0
python,cron,crontab
Simple solution is, you can set some Bash env variable MONITORING=true and let your python script to check that variable using os.environ["MONITORING"]. If that variable is true then check if the server is up or down else don't check anything. Once server down is found, set that variable to false from script like os.en...
0
1
0
1
2017-02-16T10:32:00.000
2
1.2
true
42,271,330
0
0
0
2
I have python script that checks if the server is up or down, and if it's down it sends out an email along with few system logs. What I want is to keep checking for the server every 5 minutes, so I put the cronjob as follows: */5 * * * * /python/uptime.sh So whenever the server's down, it sends an email. But I want th...
Running cronjob every 5 minutes but stopped after first execution?
42,295,869
0
0
227
0
python,cron,crontab
write an empty While True script that runs forever (ex: "mailtrigger.py") run it with -nohup mailtrigger.py from shell in infinite loop once the server is down check if mailtrigger.py is running, if its not then terminate mailtrigger.py (kill process id) your next iterations will not send mails since mailtrigger.py is...
0
1
0
1
2017-02-16T10:32:00.000
2
0
false
42,271,330
0
0
0
2
I have python script that checks if the server is up or down, and if it's down it sends out an email along with few system logs. What I want is to keep checking for the server every 5 minutes, so I put the cronjob as follows: */5 * * * * /python/uptime.sh So whenever the server's down, it sends an email. But I want th...
How to install tkinter in python 3.6 in CentOS release 6.4
42,347,600
0
3
2,402
0
tkinter,python-3.6
If you want to install tkinter in order to use matplotlib you may try import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt It worked for me
1
1
0
0
2017-02-17T10:12:00.000
1
0
false
42,295,171
0
0
0
1
I have started to play with Python and I went directly to Python 3.6. I have two Python environments now in my system: Python 2..6.6 and Python 3.6 Python 2.6.6 is under: which python /usr/bin/python And Python 3.6 is under /opt/python3/bin My problem is that if I try to import tkinter in Python 3.6 it does not work: ...
Kafka optimal retention and deletion policy
42,328,553
17
11
19,180
0
apache-kafka,kafka-consumer-api,kafka-producer-api,kafka-python
Apache Kafka uses Log data structure to manage its messages. Log data structure is basically an ordered set of Segments whereas a Segment is a collection of messages. Apache Kafka provides retention at Segment level instead of at Message level. Hence, Kafka keeps on removing Segments from its end as these violate reten...
0
1
0
0
2017-02-18T04:35:00.000
1
1.2
true
42,311,100
0
0
0
1
I am fairly new to kafka so forgive me if this question is trivial. I have a very simple setup for purposes of timing tests as follows: Machine A -> writes to topic 1 (Broker) -> Machine B reads from topic 1 Machine B -> writes message just read to topic 2 (Broker) -> Machine A reads from topic 2 Now I am sending messa...
nltk for python 3.6 in windows64
43,109,101
5
3
21,144
0
python-3.x,nltk
I had the same problem as you, but I accidentally found pip.exe in my python directory, so I navigated to said directory with CMD and ran the command pip install -U nltk and it worked.
0
1
0
0
2017-02-18T10:09:00.000
6
0.16514
false
42,313,776
1
0
0
4
I'm new to python, I'm using Windows 10 and have python36 and I basically have to use nltk for my project and i basically have two questions. 1 I heard pip is automatically downloaded for versions 3+ but when I type pip install nltk in command prompt im getting the following error even though i added its path "C:\Us...
nltk for python 3.6 in windows64
43,700,474
3
3
21,144
0
python-3.x,nltk
Run the Python interpreter and type the commands: import nltk>>> nltk.download()>>> A new window should open, showing the NLTK Downloader. Click on the File menu and select Change Download Directory. For central installation, set this to C:\nltk_data (Windows), /usr/local/share/nltk_data(Mac), or /usr/share/nltk_data...
0
1
0
0
2017-02-18T10:09:00.000
6
0.099668
false
42,313,776
1
0
0
4
I'm new to python, I'm using Windows 10 and have python36 and I basically have to use nltk for my project and i basically have two questions. 1 I heard pip is automatically downloaded for versions 3+ but when I type pip install nltk in command prompt im getting the following error even though i added its path "C:\Us...
nltk for python 3.6 in windows64
48,652,887
1
3
21,144
0
python-3.x,nltk
I will recommend you to use the Anaconda on Windows. Anaconda has nltk version for Python 64-bit. Now I'm using Python 3.6.4 64-bit and nltk. Under python shell run: import nltk nltk.download() then the downloader will be open in new window and you can download what you want.
0
1
0
0
2017-02-18T10:09:00.000
6
0.033321
false
42,313,776
1
0
0
4
I'm new to python, I'm using Windows 10 and have python36 and I basically have to use nltk for my project and i basically have two questions. 1 I heard pip is automatically downloaded for versions 3+ but when I type pip install nltk in command prompt im getting the following error even though i added its path "C:\Us...
nltk for python 3.6 in windows64
46,702,612
3
3
21,144
0
python-3.x,nltk
Directly Search for pip folder and navigate throught that path example: C:\Users\PAVAN\Environments\my_env\Lib\site-packages\pip> Run cmd and then run the command pip install -U nltk
0
1
0
0
2017-02-18T10:09:00.000
6
0.099668
false
42,313,776
1
0
0
4
I'm new to python, I'm using Windows 10 and have python36 and I basically have to use nltk for my project and i basically have two questions. 1 I heard pip is automatically downloaded for versions 3+ but when I type pip install nltk in command prompt im getting the following error even though i added its path "C:\Us...
Not able to install scrapy in my windows 10 x64 machine
45,332,173
1
1
1,285
0
python,windows,scrapy,pypi
Use pip3 insttead of pip since you are using python3
0
1
0
0
2017-02-18T20:15:00.000
3
1.2
true
42,320,197
1
0
1
1
I got pip install scrapy in cmd, it said Collecting scrapy and after a few seconds I got the following error: Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-build-2nfj5t60\\Twisted\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read...
Cant enable fail2ban jail sshd
49,656,117
0
2
4,535
0
python,centos6,systemd,fail2ban
I was able to fix this by editing the paths-common.conf file from: default_backend = %(default/backend)s to: default_backend = pynotify or default_backend = auto
0
1
0
0
2017-02-18T21:41:00.000
3
0
false
42,320,994
0
0
0
1
When enabled sshd jail i see Starting fail2ban: ERROR NOK: ("Failed to initialize any backend for Jail 'sshd'",) ERROR NOK: ('sshd',) In logs : ERROR Backend 'systemd' failed to initialize due to No module named systemd ERROR Failed to initialize any backend for Jail 'sshd' Centos 6.7 no have systemd module . CentOS ...
How to detect backup drive in windows using python?
42,328,184
1
0
130
0
python
Expanding on my comment Is there a way to do that in python? I think the short answer is: No. Not in Python, not in another language. I want to write a python script that detects the backup drive I don't think there's a way to do this. There's nothing inherent to a drive that could be used to detect whether a conn...
0
1
0
0
2017-02-19T13:50:00.000
2
0.099668
false
42,328,024
0
0
0
1
I have 2 drives, OS drive and the backup drive in windows. I want to write a python script that detects the backup drive and returns the letter it is assigned and makes sure it is an external disk not thumbdrive or dvdrom. The letter assigned to the drive can vary. Is there a way to do that in python? I have been searc...
Python module in 'dist-packages' vs. 'site-packages'
42,436,834
0
2
5,617
0
python,debian
From what I learnt from IRC is that I should install the modules in 'dist-packages' only, assuming that the admin would have installed the python provided by Ubuntu repo only.
0
1
0
0
2017-02-20T07:46:00.000
3
1.2
true
42,339,034
1
0
0
2
I am building a deb package from source. The source used to install the modules in 'site-packages' in RHEL. On Ubuntu, 'site-packages' doesn't work for me. Searching over the net, it says that python Ubuntu would require it in 'dist-packages' But there are also references that python built from source would look in 'si...
Python module in 'dist-packages' vs. 'site-packages'
46,771,967
11
2
5,617
0
python,debian
dist-packages is a Debian convention that is present in distros based on Debian. When we install a package using the package manager like apt-get these packages are installed to dist-packages. Likewise, if you install using pip and pip is installed via package manager then these packages will be installed in dist-packa...
0
1
0
0
2017-02-20T07:46:00.000
3
1
false
42,339,034
1
0
0
2
I am building a deb package from source. The source used to install the modules in 'site-packages' in RHEL. On Ubuntu, 'site-packages' doesn't work for me. Searching over the net, it says that python Ubuntu would require it in 'dist-packages' But there are also references that python built from source would look in 'si...
is Python called differently via Jenkins?
42,340,973
1
0
859
0
python,jenkins
Jenkins is running your jobs as a different user, and typically on a different host (unless you let your Jenkins run on your local host and don't use slaves to run your jobs). Resulting from these two aspects you will have also a different environment (variables like HOME, PATH, PYTHONPATH, and all the other environme...
0
1
0
1
2017-02-20T08:33:00.000
1
0.197375
false
42,339,728
0
0
0
1
I did notice something strange on my python server running jenkins. Basically if I run a script, which has dependencies (I use python via Brew), from console, it works fine. But when I run it via Jenkins, I get an error because that package was not found. When I call the script, I use python -m py.test -s myscript.py I...
Unable to run pyspark
42,718,191
1
22
21,967
0
python,pyspark
The Possible Issues faced when running Spark on Windows is, of not giving proper Path or by using Python 3.x to run Spark. So, Do check Path Given for spark i.e /usr/local/spark Proper or Not. Do set Python Path to Python 2.x (remove Python 3.x).
0
1
0
0
2017-02-20T16:45:00.000
5
0.039979
false
42,349,980
0
1
0
1
I installed Spark on Windows, and I'm unable to start pyspark. When I type in c:\Spark\bin\pyspark, I get the following error: Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. Traceback (...
Can I generate Enterprise Architect diagrams from Python?
42,353,157
3
3
1,220
0
python,enterprise-architect
EA is using a RDBMS to store it's repository. In the simplest case, this is a MS Access database renamed to .EAP. You can modify this RDBMS directly, but only if you know what you're doing. The recommended way is to use the API. Often a mix of both is the preferred way. You can use Python in both cases without issues. ...
0
1
0
1
2017-02-20T17:15:00.000
1
1.2
true
42,350,592
0
0
0
1
One of the first things I do on a new project is to knock up a quick script to parse a log file and generate a message sequence chart, as I believe that picture is worth a thousand words. New project, and it is mandated that we use only Enterprise Architect. I have no idea what its save file format is. Is it possible ...
Run shell script inside Docker container from another Docker container?
42,352,587
1
2
775
0
python,shell,ubuntu,docker
Simply launch your container with something like docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker ... and it should do the trick
0
1
0
1
2017-02-20T18:44:00.000
1
1.2
true
42,352,104
0
0
0
1
If I am on my host machine, I can kickoff a script inside a Docker container using: docker exec my_container bash myscript.sh However, let's say I want to run myscript.sh inside my_container from another container bob. If I run the command above while I'm in the shell of bob, it doesn't work (Docker isn't even installe...
gcloud.py attributeError: module 'enum' has no attribute 'Int Flag'
45,141,694
0
3
4,609
0
python,google-cloud-sdk
Ensure two things: While installing the GoogleCloudSDK, check the 'BundledPython' option. It will install both python and python3. Make sure your environment variable-PYTHONPATH is pointing to the directory having the python.exe file. This worked out for me.
0
1
0
0
2017-02-20T21:16:00.000
3
0
false
42,354,363
1
0
0
1
I get this error message when running install.bat (or install.sh through 'bash' shell) of google-cloud-sdk. Python is version 3.6. Any suggestions?
Having other subprocess in queue wait until a certain flag is set
42,402,047
0
0
47
0
python,parallel-processing,queue,multiprocessing
So, we went ahead with creating n number of processes instead of having a suspender. This would not be the ideal approach, but for the time being; it solves the issue at hand. I'd still love a better method to achieve the same.
0
1
0
0
2017-02-21T14:52:00.000
1
1.2
true
42,370,620
0
0
0
1
The problem is still on the drawing board so far, so I can go for another better suited approach. The situation is like this: We create a queue of n-processes, each of which execute independently of the other tasks in the queue itself. They do not share any resources etc. However, we noticed that sometimes (depending o...
How to install pip for a specific python version
62,927,458
1
8
17,626
0
python,python-3.x,pip
I have python 3.6 and 3.8 on my Ubuntu 18.04 WSL machine. Running sudo apt-get install python3-pip pip3 install my_package_name kept installing packages into Python 3.6 dist directories. The only way that I could install packages for Python 3.8 was: python3.8 -m pip install my_package_name That installed appropriate pa...
0
1
0
0
2017-02-21T15:26:00.000
4
0.049958
false
42,371,406
1
0
0
1
I have my deployment system running CentOS 6. It has by default python 2.6.6 installed. So, "which python" gives me /usr/bin/python (which is 2.6.6) I later installed python3.5, which is invoked as python3 ("which python3" gives me /usr/local/bin/python3) Using pip, I need to install a few packages that are specific t...
Automate ssh commands with python
42,375,591
-1
4
9,599
0
python,linux,ssh
If these manual stuffs is too many, then I may look into some server configuration managements like Ansible. I have done this kinda automation using: Ansible Python Fabric Rake
0
1
1
1
2017-02-21T18:40:00.000
3
-0.066568
false
42,375,396
0
0
0
1
So everyday, I need to login to a couple different hosts via ssh and run some maintenance commands there in order for the QA team to be able to test my features. I want to use a python script to automate such boring tasks. It would be something like: ssh host1 deploy stuff logout from host1 ssh host2 restart stuff log...
Getting this error when running python 3 version on macOS sierra 10.12
42,405,571
0
0
141
0
python
It looks like you are using the python of the system. I am myself on macOS and I went crazy several times with Apple tricks. I strongly advise to install python with anaconda, it is very simple and then you can try as many environments you want with different versions of python and of the modules. And you have a much b...
0
1
0
0
2017-02-23T01:19:00.000
1
0
false
42,405,357
1
0
0
1
Please any one help me, I am reading a fasta file through python3.6 or 3.5 on my macOS sierra and getting this error but code working properly when running on windows machine with python 3.5.2. Please any one tell me what's the actual problem. I install twice python on my mac but nothing works. File "/Library/Framework...
How to combine hadoop mappers output to get single result
42,406,958
1
1
750
0
python,hadoop,mapreduce
your job is generating 1 file per mapper, you have to force a reducer phase using 1 reducer to do this, you can accomplish this emitting the same key in all the mappers.
0
1
1
0
2017-02-23T03:42:00.000
3
0.066568
false
42,406,596
0
0
0
2
I have about 170 GB data. I have to analyze it using hadoop 2.7.3. There are 14 workers. I have to find total of unique MIME type of each document e.g. total number of documents that are text/html type. When I run mapreduce job(written in python), Hadoop returns many output files instead of single one that I am expecti...
How to combine hadoop mappers output to get single result
42,414,979
1
1
750
0
python,hadoop,mapreduce
Make your mapper to emit for each document processed - (doc-mime-type, 1) then count up all such pairs at reduce phase. In essence, it is a standard word count exercise except your mappers emit 1s for each doc's mime-type. Regarding number of reducers to set: Alex's way of merging reducers' results is preferable as al...
0
1
1
0
2017-02-23T03:42:00.000
3
0.066568
false
42,406,596
0
0
0
2
I have about 170 GB data. I have to analyze it using hadoop 2.7.3. There are 14 workers. I have to find total of unique MIME type of each document e.g. total number of documents that are text/html type. When I run mapreduce job(written in python), Hadoop returns many output files instead of single one that I am expecti...
lftp pause and resume download
42,412,125
5
4
3,150
0
python-2.7,lftp
You can either suspend the whole lftp process (command suspend) or limit transfer rate to e.g. 1Bps (set net:limit-total-rate 1). In either case the files being transferred remain open. You can also stop the transfer and continue it later using -c option of get or mirror.
0
1
0
0
2017-02-23T06:05:00.000
1
0.761594
false
42,408,247
0
0
0
1
Googled around and looked on this forum but couldn't find if I can pause a download using lftp. Currently downloading tons of logs and would like to pause, add more drives to the system and continue downloading. Thanks
Allow a python file to add to a different file linux
42,446,617
0
0
31
0
python,html,linux,ubuntu
I'm going to answer your question but also beg you to consider another approach. The functionality you are looking for is usually handled by a database. If you don't want to use anything more complex, SQLite is often all you need. You would then need a simple web application that connects to the database, grabs the fie...
0
1
0
0
2017-02-24T19:04:00.000
1
1.2
true
42,446,403
0
0
0
1
I'm making a "wargame" like the ones on overthewire.org or smashthestack.org. When you finish the game, the user should get a python program that has extra permissions to edit a file in /var/www/html so that they can sign their name. I want to have a program like this so that they can add text to the html file with...
Uniquely Identify Computer, prevents hackers
42,464,260
0
0
104
0
python,security,uuid
There are probably far simpler and more effective ways to DOS / DDOS your server. Bear that in mind when you decide home much effort to expend on this. Here are a couple of ideas that may be (partially) effective. Rate limit the creation of UUIDs ... globally. If you do this, and monitor how close you are to the po...
0
1
0
0
2017-02-26T02:41:00.000
1
1.2
true
42,464,131
0
0
0
1
I fully recognize that the answer to this question may be "No." I am writing the client portion of a client-server program that will run on potentially thousands of computers and will periodically report back to the server with system settings and configurations. When the computer first initiates, currently the client ...
How do I print colored text in IDLE's terminal?
61,460,514
0
8
19,362
0
python,python-3.x,colors,python-idle
The strnage output of the length is with the return keyword, and NORMAL is also a color
0
1
0
0
2017-02-26T19:14:00.000
5
0
false
42,472,958
1
0
0
1
This is very easily a duplicate question--because it is. However, there are very many inadequate answers to this (e.g. try curses! -- pointing to a 26 page documentation). I just want to print text in a color other than blue when I'm outputting in IDLE. Is it possible? What's an easy way to do this? I'm running Python ...
Error 193 %1 is not a valid Win32 application
42,478,265
6
3
4,749
0
python,dll
If you are using a 32 bit Python and the DLL is a 64 bit DLL you will get this error, likewise if the DLL is 32 bit and your Python is 64 bit. You can check this using the dumpbin /HEADERS <dll filepath> command from a visual studio command prompt.
0
1
0
0
2017-02-27T04:42:00.000
1
1
false
42,477,956
0
0
0
1
I found this error [Error 193] %1 is not a valid Win32 application when i run this python command windll.LoadLibrary("C:\Windows\System32\plcommpro.dll") For this error i found my plcommpro.dll file is not executable file.But I don't know how to make it as a executable file.If someone knows please share me. Thanks and ...
Run a python script as a background service in linux
42,500,440
0
0
1,140
0
python
You can create init script in /etc/init/ directory Example: start on runlevel [2345] stop on runlevel [!2345] kill timeout 5 respawn script exec /usr/bin/python /path/to/script.py end script Save with .conf extension
0
1
0
0
2017-02-28T04:06:00.000
2
0
false
42,500,030
0
0
0
1
I am currently using linux. I have a python script which I want to run as a background service such as the script should start to run when I start my machine. Currently I am using python 2.7 and the command 'python myscripy.py' to run the script. Can anyone give an idea about how to do this. Thank you.
Run Python 3.6 in Terminal on Mac?
49,884,463
0
2
6,719
0
python,terminal,version-control
as usual in Mac python 2.7 is already installed, however if you installed python 3+ then you can just type in terminal: python3 so that you can use the newer version that you installed. if you want to use python 2.7 then just type: python
0
1
0
0
2017-02-28T07:26:00.000
5
0
false
42,502,614
1
0
0
2
I am using a Python on a Mac and I know that Python 2 comes preinstalled on the system (and in fact usable through Terminal). Is there a way to make it so Terminal can run Python 3? Can/should you set this as a default? I know changing the default settings for Python version usage could break your system so should I ju...
Run Python 3.6 in Terminal on Mac?
42,502,774
0
2
6,719
0
python,terminal,version-control
Best option is to install Python through Anaconda. This allows easy management and much more. You can have virtual environments having different Python versions as well as different modules installed.
0
1
0
0
2017-02-28T07:26:00.000
5
0
false
42,502,614
1
0
0
2
I am using a Python on a Mac and I know that Python 2 comes preinstalled on the system (and in fact usable through Terminal). Is there a way to make it so Terminal can run Python 3? Can/should you set this as a default? I know changing the default settings for Python version usage could break your system so should I ju...
Make python process writes be scheduled for writeback immediately without being marked dirty
42,558,956
0
2
46
0
python,linux,numpy,linux-kernel
So heres one way I've managed to do it. By using the numpy memmap object you can instantiate an array that directly corresponds with a part of the disk. Calling the method flush() or python's del causes the array to sync to disk, completely bypassing the OS's buffer. I've successfully written ~280GB to disk at max thro...
0
1
0
0
2017-02-28T23:15:00.000
2
0
false
42,520,522
0
0
0
2
We are building a python framework that captures data from a framegrabber card through a cffi interface. After some manipulation, we try to write RAW images (numpy arrays using the tofile method) to disk at a rate of around 120 MB/s. We are well aware that are disks are capable of handling this throughput. The problem ...
Make python process writes be scheduled for writeback immediately without being marked dirty
52,653,381
0
2
46
0
python,linux,numpy,linux-kernel
Another option is to get the os file id and call os.fsync on it. This will schedule it for writeback immediately.
0
1
0
0
2017-02-28T23:15:00.000
2
1.2
true
42,520,522
0
0
0
2
We are building a python framework that captures data from a framegrabber card through a cffi interface. After some manipulation, we try to write RAW images (numpy arrays using the tofile method) to disk at a rate of around 120 MB/s. We are well aware that are disks are capable of handling this throughput. The problem ...
Designing a pinging service
42,525,826
0
1
45
1
python,architecture
Let me put it like this. You will be having these 4 statements in the following way. In the simplest way you could keep a table of users and a table of hostnames which will have following columns -> fk to users, hostname, last update and boolean is_running. You will need the following actions. UPDATE: You will run this...
0
1
0
0
2017-03-01T06:01:00.000
1
0
false
42,524,336
0
0
0
1
The ping service that I have in mind allows users to keep easily track of their cloud application (AWS, GCP, Digital Ocean, etc.) up-time. The part of the application's design that I am having trouble with is how to effectively read a growing/shrinking list of hostnames from a database and ping them every "x" interval...
How do I install a python deb package for Python3 on Ubuntu?
42,525,853
0
0
1,157
0
python,python-3.x,ubuntu
You can use sudo dpkg panda3d1.9_1.9.3-xenial_amd64.deb it won't affect your default package.
0
1
0
0
2017-03-01T07:17:00.000
2
0
false
42,525,463
1
0
0
2
I downloaded a deb package panda3d1.9_1.9.3-xenial_amd64.deb and I want to install it for Python 3. My OS is Linux Ubuntu 16.04. The default python is 2.7.12 and I would prefer to keep it as default, but Python 3 is installed too and available to use. How do I install this package for Python 3 only? I am not sure pip m...
How do I install a python deb package for Python3 on Ubuntu?
42,528,081
1
0
1,157
0
python,python-3.x,ubuntu
If the package was built to only support Python 2, there is no straightforward way to install it for Python 3. You will want to ask the packager to provide a package built for Python 3 if there isn't one already. (This replaces my earlier answer, which was incorrect or at least misleading. Thanks to @Goyo in particul...
0
1
0
0
2017-03-01T07:17:00.000
2
1.2
true
42,525,463
1
0
0
2
I downloaded a deb package panda3d1.9_1.9.3-xenial_amd64.deb and I want to install it for Python 3. My OS is Linux Ubuntu 16.04. The default python is 2.7.12 and I would prefer to keep it as default, but Python 3 is installed too and available to use. How do I install this package for Python 3 only? I am not sure pip m...
IBM Bluemix IoT Watson service Driver Behaviour
42,668,207
1
0
114
0
python,ibm-cloud,iot-for-automotive,iot-driver-behavior
I think your procedure is OK. There are following possibilities not to get valid analysis result. (1) In current Driving Behavior Analysis, it requires at least 10 valid gps points within a trip (trip_id) on a vehicle (trip_id). Please check your data which is used on "sendCarProbe" API. (2) Please check "sendJobReq...
0
1
0
0
2017-03-02T11:04:00.000
1
1.2
true
42,553,676
0
0
0
1
I want to explore and use the driver behavior service in my application. Unfortunately I got stuck as I'm getting empty response from getAnalyzedTripSummary API instead Trip UUID. Here are the steps I've followed. I've added the services called Driver behavior and Context Mapping to my application @Bluemix. Pushed mul...
Python script very slow in a remote directory
43,487,256
-1
0
1,102
0
python,import,sshfs,fedora-25,remote-host
In my case it were the Cern ROOT libraries import. When importing, they look in the current directory, no matter what I do. So the solution is to store the current directory cd to some really local directory, like "/" or "/home" before imports come back to the stored directory after imports
0
1
0
1
2017-03-03T04:07:00.000
1
-0.197375
false
42,570,494
0
0
0
1
I have trouble running my a little bit complex python program in a remote directory, mounted by SSHFS. It takes a few seconds to perform imports when executing in a remote directory and a fraction of a second in a local directory. The program should not access anything in the remote directory on its own, especially in ...
how to switch python interpreter in cmd?
42,583,156
0
0
10,377
0
python,python-2.7,python-3.x
In my case, /usr/bin/python is a symlink that points to /usr/bin/python2.7. Ususally, there is a relevant symlink for python2 and python3. So, if you type python2 you get a python-2 interpreter and if you type python3 you get a python-3 one.
0
1
0
0
2017-03-03T15:46:00.000
7
0
false
42,583,082
1
0
0
5
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
42,583,347
0
0
10,377
0
python,python-2.7,python-3.x
It depends on OS (and the way Python has been installed). For most current installations: on Windows, Python 3.x installs a py command in the path that can be used that way: py -2 launches Python2 py -3 launches Python3 On Unix-likes, the most common way is to have different names for the executables of different ve...
0
1
0
0
2017-03-03T15:46:00.000
7
0
false
42,583,082
1
0
0
5
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
71,958,209
0
0
10,377
0
python,python-2.7,python-3.x
As has been mentioned in other answers to this and similar questions, if you're using Windows, cmd reads down the PATH variable from the top down. On my system I have Python 3.8 and 3.10 installed. I wanted my cmd to solely use 3.8, so I moved it to the top of the PATH variable and the next time I opened cmd and used p...
0
1
0
0
2017-03-03T15:46:00.000
7
0
false
42,583,082
1
0
0
5
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
42,583,188
0
0
10,377
0
python,python-2.7,python-3.x
Usually on all major operating systems the commands python2 and python3 run the correct version of Python respectively. If you have several versions of e.g. Python 3 installed, python32 or python35 would start Python 3.2 or Python 3.5. python usually starts the lowest version installed I think. Hope this helps!
0
1
0
0
2017-03-03T15:46:00.000
7
0
false
42,583,082
1
0
0
5
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
how to switch python interpreter in cmd?
42,583,177
0
0
10,377
0
python,python-2.7,python-3.x
If you use Windows OS: py -2.7 for python 2.7 py -3 for python 3.x But first you need to check your PATH
0
1
0
0
2017-03-03T15:46:00.000
7
0
false
42,583,082
1
0
0
5
I have installed both versions of python that is python 2.7 and python 3.5.3. When I run python command in command prompt, python 3.5.3 interpreter shows up. How can I switch to python 2.7 interpreter?
How to make auto indention in nano while programming in python in linux?
70,208,117
0
7
18,957
0
python,linux,nano
Try just "M-I" (Esc-I) to switch off autoindent before pasting with Ctrl-Ins (or right mouse click)
0
1
0
0
2017-03-03T16:58:00.000
3
0
false
42,584,551
1
0
0
1
I am a beginner programmer as well as linux user. Before, I was using windows and the python IDLE was so good. I need not needed to press tab button after the "If" statement or any other loops. Now, I am using Linux and started to write programs through the command line text editor of ubuntu called as "nano". Here, I n...
ANSI color lost when using python subprocess
42,589,699
11
11
2,656
0
python,subprocess
Processes that produce color output do it by sending escape codes to the terminal(-emulator) intermixed with the output. Programs that handle the output of these programs as data would be confused by the escape codes, so most programs that produce color output on terminals do so only when they are writing to a termina...
0
1
0
0
2017-03-03T22:32:00.000
1
1.2
true
42,589,584
1
0
0
1
I'm trying to run a process within another python process. The program I run normally has colored output when run in an ANSI terminal emulator. When I have my controlling python program print the output from the sub-process, I don't see any color. The color from the subprocess is lost when I read from it and print t...
Installing Python modules
42,596,435
0
1
614
0
python-3.6
You need to add the location of the python.exe to your $PATH variable. This depends on your installation location. In my case it is C:\Anaconda3. The default is C:\Python as far as I know. To edit your path variable you can do the following thing. Go to your Control Panel then search for system. You should see somethin...
0
1
0
0
2017-03-04T13:09:00.000
1
0
false
42,596,399
1
0
0
1
I am trying to install the pyperclip module for Python 3.6 on Windows (32 bit). I have looked at various documentations (Python documentation, pypi.python.org and online courses) and they all said the same thing. 1) Install and update pip I downloaded get-pip.py from python.org and it ran immediately, so pip should be...
Appengine Python - How to filter tab content depending if entity has been created
43,709,266
0
0
29
0
twitter-bootstrap,python-2.7,google-app-engine,google-cloud-datastore,app-engine-ndb
When rendering the page just check if the assessment exists by retrieving it from the Consult (I imagine you store the assessment key inside the Consult). That's it
0
1
0
0
2017-03-04T15:05:00.000
1
0
false
42,597,497
0
0
1
1
I have a page View-Consult with 4 bootstrap tabs. There are two entities retrieved from the Datastore on this page (Consult and Assessment). The consult is created first and the assessment later (by a different user). Note: Consults have a property called "consult_status" that is PENDING before the Assessment is added,...
User friendly way to distribute Python Application
46,517,871
0
1
75
0
python,macos,exe,software-distribution,dmg
This is a pretty broad question. The "best way" to distribute any software is to use a software distribution/systems management suite. It takes time to implement but once done the time savings is enormous. There are several suites that will do this; I believe that AirWatch will work as will ThingWorx, Helix Device Cl...
0
1
0
0
2017-03-04T19:38:00.000
1
0
false
42,600,500
1
0
0
1
What could be the best way to distribute a python application to both windows and mac user without scaring them away during the installation process? I'm writing a software which will be of help to my university's students. This software will be used by student of various discipline, a lot from those which have little...
How to import user-defined python modules in cygwin?
43,129,047
0
0
378
0
python,cygwin,anaconda,python-module,pythonpath
Python at the startup builds the sys.path using site.py available in the PYTHONHOME directory. I appended to the file, addsitedir(). That worked for me. If there exists a space in the path, use double quotes around the path.
0
1
0
0
2017-03-04T22:28:00.000
1
0
false
42,602,126
1
0
0
1
This might be trivial, but I can't identify the reason for not being able to import user-defined python modules into my python environment. I use Ananconda installation of python in cygwin. I have made entries in bash_profile to append module directory path to PYTHONPATH in this format. export PYTHONPATH=$PYTHONPATH:"<...
How do I change the environment variable LANG from within a Python script?
42,617,322
0
1
2,637
0
python,linux,encoding,utf-8
I think you're overdoing it. Python comes with batteries included; just use them. A correctly configured terminal session has the LANG environment variable set; it describes which encoding the terminal expects as output from programs running in this session. Python interpreter detects this setting and sets sys.stdout.e...
0
1
0
0
2017-03-05T01:22:00.000
2
0
false
42,603,373
1
0
0
2
I'm writing a script in python that generates output that contains utf-8 characters, and even though most linux terminals use utf-8 by default, I'm writing the code presuming it isn't in utf-8 (in case the user changed it, for some reason). From what I tested, os.environ["LANG"] = "en_US.utf-8" does not change the syst...
How do I change the environment variable LANG from within a Python script?
42,617,801
0
1
2,637
0
python,linux,encoding,utf-8
It is not clear what you want to see happen when you change the LANG environment. If you want to test your Python code with other character encodings, you will need to set LANG before starting the Python code, as I believe LANG is read when Python first starts. There might(?) be a function call you can call to change t...
0
1
0
0
2017-03-05T01:22:00.000
2
0
false
42,603,373
1
0
0
2
I'm writing a script in python that generates output that contains utf-8 characters, and even though most linux terminals use utf-8 by default, I'm writing the code presuming it isn't in utf-8 (in case the user changed it, for some reason). From what I tested, os.environ["LANG"] = "en_US.utf-8" does not change the syst...
CGI Script For Python Webserver
42,608,590
0
0
74
0
python,bash,nginx,webserver,cgi
Why are you not try to pass the address/location of your file which you want to download as a argument to the class and then use that in the < a href> tag to convert that into the link and implement the download functionality
0
1
0
1
2017-03-05T12:28:00.000
2
0
false
42,608,362
0
0
0
1
I have a simple python webserver but I want to use the CGI script for file download and upload according to client-request .But I couldnt find the any way of adjusting the CGI except using apache2 ,nginx or etc... Is there any way to adjust cgi script to my python webserver with Bash script or with other way ? Can...
Installing AWS elasticbeanstalk command line tool in ubuntu:error The 'awsebcli==3.10.0' distribution was not found and is required by the application
42,709,943
1
3
418
0
php,python,python-2.7,amazon-web-services,ubuntu
Finally i resolved the issue. First upgrade the pip and then pip install --upgrade --user awsebcli.
0
1
0
0
2017-03-06T06:57:00.000
1
1.2
true
42,619,331
0
0
0
1
I am trying to install AWS elasticbeanstalk command line tool in my ubuntu machine Installed with pip install --upgrade --user awsebcli But when i try to get the eb version with eb --version i got the following error Traceback (most recent call last): File "/home/shamon/.local/bin/eb", line 6, in from pkg_...
Launch console window pre-activated with chcp 65001 using python
42,631,022
7
4
4,940
0
python,windows,python-3.x,unicode,console
Add /k chcp 65001 to the shortcut launching the cmd window. Alternatively, use Python 3.6 which uses Windows Unicode APIs to write to the console and ignores the code page. You do still need font support for what you are printing, however.
0
1
0
0
2017-03-06T16:04:00.000
2
1.2
true
42,630,191
1
0
0
1
I use a python library that prints out a Unicode character to windows console. If I call a function on the library that prints out Unicode character, it will throw an exception 'charmap' codec can't encode characters. So this is what I tried to solve that error: Call "chcp 65001" windows console command from python usi...
How to run one airflow task and all its dependencies?
42,646,246
7
12
12,887
0
python-3.6,airflow,airflow-scheduler
You can run a task independently by using -i/-I/-A flags along with the run command. But yes the design of airflow does not permit running a specific task and all its dependencies. You can backfill the dag by removing non-related tasks from the DAG for testing purpose
0
1
0
0
2017-03-06T19:22:00.000
2
1
false
42,633,892
0
0
0
1
I suspected that airflow run dag_id task_id execution_date would run all upstream tasks, but it does not. It will simply fail when it sees that not all dependent tasks are run. How can I run a specific task and all its dependencies? I am guessing this is not possible because of an airflow design decision, but is there ...
Installing open-cv on Windows 10 with Python 3.5
42,637,351
0
0
591
0
python,opencv
You need to update your environment variables. In search, go to the control panel Click the Advanced system settings link. Click Environment Variables. In the section System Variables, find the PYTHONPATH variable. Click edit, and add the absolute path to your Lib directory
0
1
0
0
2017-03-06T22:54:00.000
1
0
false
42,637,127
1
0
0
1
I'm having some trouble installing open-cv I've tried several approaches but only succeeded in installing open-cv by downloading the wheel file from a website which I don't remember and running this command in the command prompt: pip3 install opencv_python-3.2.0-cp35-cp35m-win32.whl; I can now import cv2 ONLY if I'm on...
Error when executing `jupyter notebook` (No such file or directory)
49,881,600
1
123
125,723
0
python-3.x,jupyter-notebook
For me the fix was simply running pip install notebook Somehow the original Jupiter install got borked along the way.
0
1
0
0
2017-03-07T12:41:00.000
12
0.016665
false
42,648,610
1
0
0
6
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
47,619,339
67
123
125,723
0
python-3.x,jupyter-notebook
For me the issue was that the command jupyter notebook changed to jupyter-notebook after installation. If that doesn't work, try python -m notebook, and if it opens, close it, then export PATH=$PATH:~/.local/bin/, then refresh your path by opening a new terminal, and try jupyter notebook again. And finally, if that do...
0
1
0
0
2017-03-07T12:41:00.000
12
1
false
42,648,610
1
0
0
6
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
47,279,945
4
123
125,723
0
python-3.x,jupyter-notebook
Since both pip and pip3.6 was installed and pip install --upgrade --force-reinstall jupyter was failing, so I used pip3.6 install --upgrade --force-reinstall jupyter and it worked for me. Running jupyter notebook also worked after this installation.
0
1
0
0
2017-03-07T12:41:00.000
12
0.066568
false
42,648,610
1
0
0
6
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
53,039,574
5
123
125,723
0
python-3.x,jupyter-notebook
Jupyter installation is not working on Mac Os To run the jupyter notebook:-> python -m notebook
0
1
0
0
2017-03-07T12:41:00.000
12
0.083141
false
42,648,610
1
0
0
6
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
54,565,364
2
123
125,723
0
python-3.x,jupyter-notebook
Deactivate your virtual environment if you are currently in; Run following commands: python -m pip install jupyter jupyter notebook
0
1
0
0
2017-03-07T12:41:00.000
12
0.033321
false
42,648,610
1
0
0
6
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
Error when executing `jupyter notebook` (No such file or directory)
50,421,008
0
123
125,723
0
python-3.x,jupyter-notebook
I'm trying to get this going on VirtualBox on Ubuntu. Finally on some other post it said to try jupyter-notebook. I tried this and it told me to do sudo apt-get jupyter-notebook and that installed a bunch of stuff. Now if I type command jupyter-notebook, it works.
0
1
0
0
2017-03-07T12:41:00.000
12
0
false
42,648,610
1
0
0
6
When I execute jupyter notebook in my virtual environment in Arch Linux, the following error occurred. Error executing Jupyter command 'notebook': [Errno 2] No such file or directory My Python version is 3.6, and my Jupyter version is 4.3.0 How can I resolve this issue?
From which directory to run python Script in webserver
45,730,408
0
0
341
0
php,python
if your python file and php file in same folder: $command_to_run = "test.pyw $arg1 $arg2 , $output, $result"; $response = shell_exec($command_to_run); else: $command_to_run = "<php_folder>/scripts/python/test.pyw $arg1 $arg2 , $output, $result"; $response = shell_exec($command_to_run);
0
1
0
1
2017-03-07T13:37:00.000
1
0
false
42,649,784
0
0
0
1
I am trying to run a python script from a webserver(apache) using php. I used the following command exec (python test.py $arg1 $arg2 , $output, $result) It executes successfully when I put the test.py in the document root directory. However, I wanted to run the python script from another subdirectory so that it would ...
Toree Installation Issue
46,944,308
0
3
1,230
0
python,apache-spark,pip,apache-toree
my situation is similier to you,your jupyter client version is higher than the toree can find,try uninstalled jupyter client before.
0
1
0
0
2017-03-08T02:23:00.000
3
0
false
42,661,846
1
0
0
1
I wanted to pip install Toree package, but I ended up with the following error msg: Could not find a version that satisfies the requirement toree (from versions: ) No matching distribution found for toree I couldn't find any documentation on requirements for toree. Also, pip doesn't seem to be the issue here either...