Questions tagged [python]

Python is an interpreted, general, high-level programming language. Programming questions are off topic. Questions about the use of Python should be asked at Stack Overflow (https://www.stackoverflow.com) instead.

Filter by
Sorted by
Tagged with
225 votes
8 answers
167k views

Typing “python” on Windows 10 (version 1903) command prompt opens Microsoft store

This is strange issue I have observed. I installed Active Python 2.7 on Windows 10 (version 1903). On typing “python” from search, opens the Python 2.7 prompt but when I type from command prompt ...
Dr. Essen's user avatar
  • 2,522
110 votes
5 answers
715k views

How do I add Python to the Windows PATH?

I want to be able to run Python commands from the Windows CMD. However, if I don't specify Python's full path for each command, I get an error saying "Python is not recognized as an internal or ...
davewise's user avatar
  • 1,203
2 votes
3 answers
8k views

How do I run a Python script from a C shell without specifying whole path?

I would like to run a Python script from a Hamilton C shell without having to specify the whole path of the script. The first thing I tried was to add my scripts folder to the PATH environment ...
Alexandre Vanier's user avatar
19 votes
5 answers
15k views

How to simulate slow internet connection

I currently deploy with GAE (google app engine) and I try to implement some AJAX validation. So I got a couple text-fields and "spinners" (ajax loaders) which should be displayed when an AJAX request ...
V-Light's user avatar
  • 410
2 votes
3 answers
5k views

Association of Python files in Windows not working

On my system (Windows Vista Home Premium 64bit) Python files are associated with Python interpreter: C:\Users\Piotr>assoc .py .py=Python.File C:\Users\Piotr>ftype Python.File Python.File=c:\...
Piotr Dobrogost's user avatar
34 votes
4 answers
442k views

How to install the win32com python library

I am trying to install the win32com module. I know I should download the Python for Windows extension, but it does not work. After I have installed Python for Windows and try import win32com.client, ...
NiklasR's user avatar
  • 479
5 votes
3 answers
2k views

Using Python on Mac

I want to learn Python using my Mac. Now I want to setup a Python version >= 3.1.3, because my materials for learning are using this version. Typing python into terminal results version 2.6.1, using ...
choise's user avatar
  • 197
4 votes
1 answer
7k views

How to install pytorch FROM SOURCE (with cuda enabled for a deprecated CUDA cc 3.5 of an old gpu) using anaconda prompt on Windows 10?

I have (with the help of the deviceQuery executable in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y\extras\demo_suite according to https://forums.developer.nvidia.com/t/what-is-the-compute-...
questionto42's user avatar
  • 2,267
2 votes
4 answers
3k views

How to identify what is starting a process?

On my XP machine, a python.exe process starts every so on which takes up 100% of my CPU. I have to kill it from the task monitor.. How can one identify what this process is and how you can disable ...
Marcus Leon's user avatar
  • 3,045
0 votes
1 answer
696 views

Spyder - touchpad scroll does not work

I use the scroll function with my mouse and it works fine. But either in script, or in terminal sections of Spyder, I can't use the touchpad for scrolling. I do not experience any problems with my ...
Dersu Giritlioğlu's user avatar
103 votes
10 answers
974k views

Updating Python on Ubuntu system

I want to update the Python build on my Linux box, but the only way I know how to do it is uninstalling the current version and installing the new one. My system is already up to date (I updated ...
efficiencyIsBliss's user avatar
72 votes
4 answers
295k views

python3-pip installed but pip3 command not found?

I am testing a Python3 program in several computers. To do that, I need to install a library of Python with pip3. So first, I was installing python3-pip in each computer (everyone is running Kubuntu ...
forvas's user avatar
  • 893
67 votes
7 answers
98k views

Can't install virtual interpreter in PyCharm in Linux

When I try to add virtualenv as an interpreter in PyCharm Community 2018.1.2 in Kubuntu 18.04 I get the following error: ModuleNotFoundError: No module named 'distutils.core' How can I solve this?
Hrvoje T's user avatar
  • 1,949
25 votes
2 answers
123k views

How to increase Python's CPU usage

I use Python to execute some algorithms and no matter which Python I use, and I have tried many versions, the CPU usage goes to 25% max. Why doesn't Python take advantage of the rest of my CPU ...
user avatar
21 votes
5 answers
51k views

installing wxpython via pip or easy_install

I am running into some problems installing wxpython using pip. Here is my current output: [myuserid]% sudo pip install wxpython Downloading/unpacking wxpython Downloading wxPython2.8-win64-devel-2....
dtlussier's user avatar
  • 2,175
14 votes
2 answers
5k views

How can I use the Homebrew Python with Homebrew MacVim on Mountain Lion?

I originally asked and answered this question: How can I use the Homebrew Python version with Homebrew MacVim? These instructions worked on Snow Leopard using Xcode 4.0.1 and associated developer ...
Stephen Jennings's user avatar
7 votes
3 answers
4k views

`which python` points to the python I want, but `python` runs the wrong version

I want to use python24 provided by ports, so I've installed it, and python_select -s shows that the version I want is indeed selected. Running which python gives /opt/local/bin/python, and running /...
tramdas's user avatar
  • 173
4 votes
2 answers
2k views

How do I handle multiple quotes in an alias (for bash or zsh)

I am using zsh, and I am trying to use python as a simple calculator. I'm very familiar with python, but can't seem to get the alias (or function) to work properly. So far I've got: pycalc() { ...
AtHeartEngineer's user avatar
4 votes
3 answers
10k views

How can I get apt-get to install python packages for a different version of python?

In Ubuntu 10.10, I have installed python 2.7. I would like to use apt-get to install packages to this version of python but I haven't been able to figure out how. Things I have tried without success:...
fastmultiplication's user avatar
3 votes
3 answers
3k views

How to Access two different programs from PATH, both having same name in Windows 10?

I added addresses of python 2.7, and Anaconda 4.1.1(Python 3.5) to PATH variable in Windows 10, whenever I run "python" from cmd, program which was added earlier is executed.How can I access both of ...
Yogendra's user avatar
  • 133
2 votes
2 answers
4k views

Permission Denied running python script from samba share

I'm trying to mount a samba share on a Ubuntu 12.04 desktop from a Fedora 17 desktop. I can create, edit and delete files with no problem but when I try to run python scripts on the share i get a ...
James's user avatar
  • 43
1 vote
1 answer
3k views

Set default open-with app to a Python program on a Mac

I use the open source application UliPad to edit restructured text files (rst). It is a Python application that I launch via Terminal like so: python32 UliPad.py I have python32 as an alias to the ...
Vincent's user avatar
  • 263
1 vote
2 answers
16k views

Getting PATH right for python after MacPorts install

I can't import some python libraries (PIL, psycopg2) that I just installed with MacPorts. I looked through these forums, and tried to adjust my PATH variable in ~/.bash_profile in order to fix this ...
BenjaminGolder's user avatar
0 votes
2 answers
4k views

How to install the DLL files in windows 7

I just installed python in my computer and set the path successfully. And Now, When i am trying to run a python program from the command prompt it showing the error 'api-ms-win-crt-runtime-l1-1-0.dll'....
Zaid Khan's user avatar
  • 111
0 votes
1 answer
410 views

Run Python3.4 and Python3.7 simultaneously on Linux

I have a linux VM with preconfigured Python3.4. I need to have Python3.7 to run my code. I tried to uninstall Python3.4 but there are some system dependencies, so I kept old version. Then I ...
Jareq's user avatar
  • 3
56 votes
4 answers
54k views

How do you install git-filter-repo?

I'm attempting to use git-filter-repo to remove large binaries from my repository. I have not used python before. I installed the latest python by clicking on the downloaded .exe file as that is a ...
CBFT's user avatar
  • 773
38 votes
3 answers
470k views

The script is installed in directory, which is not PATH

During the installation process of Jupiter Notebook using pip, it said that scripts were installed in a folder that is not on PATH. Can it cause any problems? How can I fix it? Here is full log: ...
keddad's user avatar
  • 729
19 votes
1 answer
14k views

How to build and install Python 3.7.x from source on Debian 9.8

I have a fresh install of Debian 9.8, the current stable release version. $ lsb_release --description Description: Debian GNU/Linux 9.8 (stretch) This system includes Python 3.5.3: $ python3 --...
Charlie's user avatar
  • 741
19 votes
10 answers
26k views

How to install matplotlib on OS X?

I want to install matplotlib on OS X. If possible, using homebrew. I installed Python 2.7.1 using brew install python, I modified my path to use it I installed pip using brew install pip I installed ...
bastibe's user avatar
  • 3,872
17 votes
7 answers
39k views

Where do I put plugins for Gimp 2.8 on Windows?

I am currently using a Windows XP 32-bit machine, and I am trying to make some gimp plugins. I just learned Python yesterday, and I saved a sample script here: C:\Program Files\GIMP-2.0\share\gimp\2.0\...
Daniel's user avatar
  • 409
16 votes
9 answers
20k views

Vim: execute the script I'm working on in a split screen

I'm working on a small python script, which needs frequent execution in order to debug and further develop. Can I split the vim screen and execute my script on one part with a keystroke?
Adam Matan's user avatar
  • 8,380
14 votes
7 answers
6k views

What is the best method to remove duplicate image files from your computer?

I have a lot of duplicate image files on my Windows computer, in different subfolders and with different file names. What Python script or freeware program would you recommend for removing the ...
BioGeek's user avatar
  • 592
14 votes
1 answer
8k views

How can I use the Homebrew Python version with Homebrew MacVim on Snow Leopard?

Note: For Mountain Lion, see: How can I use the Homebrew Python with Homebrew MacVim on Mountain Lion? I've installed Python 2.7 with Homebrew on Mac OS X Snow Leopard. When I install MacVim using ...
Stephen Jennings's user avatar
14 votes
14 answers
68k views

Scripting: what is the easiest to extract a value in a tag of a XML file?

I want to read a pom.xml ('Project Object Model' of Maven) and extract the version information. Here is an example: <?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache....
Anthony Kong's user avatar
  • 5,018
14 votes
3 answers
103k views

How do I make a python file executable on macOS Sierra?

I've been looking around the internet for days now, just to find a way to make a python file executable. I've tried the (chmod +x filename.py) by adding the #!/usr/bin/env python at the top, but it ...
shadown's user avatar
  • 143
11 votes
3 answers
30k views

Python IDLE disappeared from the right click context menu

My IDLE shortcut in the right click menu has disappeared. I think it's because I used to use Python 2.7, but I installed Python 2.5 without uninstalling Python2.7, and then uninstalled Python 2.5. I ...
Jimmy Lin's user avatar
  • 213
11 votes
7 answers
18k views

vim could not load library python27.dll

I need Windows 7 + vim + python for writing vim plugins. :python print("hello") E370: Could not load library python27.dll E263: Sorry, this command is disabled, the Python library could not be loaded....
Andriy Drozdyuk's user avatar
10 votes
4 answers
39k views

How do I make a script run upon startup of the Ubuntu machine?

I want to run /home/myuser/go.py How do I make that run in the background, everytime my linux machine boots up?
Alex's user avatar
  • 2,471
8 votes
1 answer
9k views

Use a Python function as formula in LibreOffice Calc cells

Since LibreOffice Calc supports macros, and the builtin functions are somewhat limited, I'd like to write my own functions in Python and then use them as formulas in individual cells. Ideally, I would ...
Superbest's user avatar
  • 1,990
8 votes
5 answers
53k views

How can I update the default Python installation/fix my $PATH on Mac OS X 10.6.7?

I know this question has been asked before on this site, and I have found a couple worthy discussions, but the solutions I've found and tried do not work. I want to learn Python and I'm having trouble ...
user avatar
7 votes
1 answer
1k views

Modern alternative to POVray scene description languade [closed]

in short: Do you know something for generative scripting of 3D scene and rendering it like POVray, but with more modern rendering technology ( Metropolis-light transport, GPGPU, ambient occlusion ), ...
Prokop Hapala's user avatar
6 votes
4 answers
13k views

Why sudo python and python in terminal start two different versions python?

I had python 2.6 in my server to begin with. Then I downloaded python 2.7 and installed using make and make altinstall. When I try just python in the terminal it opens up python 2.7 but sudo python ...
user avatar
5 votes
0 answers
882 views

Conda update all wants to remove all packages

I've downloaded latest anaconda and when I want to update all, it wants to remove all packages. Any idea about what is going on? C:\WINDOWS\system32>conda update --all Collecting package ...
user2743931's user avatar
5 votes
2 answers
15k views

How can I install python-dev without sudo?

I am trying to install python package (scikits.learn) on my user directory (on a ubuntu server for which I don't have sudo permission) but I am getting error: Python.h: No such file or directory It ...
d.putto's user avatar
  • 151
4 votes
1 answer
7k views

Using Launchd to invoke a Python script?

As a continuation from my initial question... Routinely backup log file in OSX? I'm attempting to backup a logfile on an OSX computer and a jailbroken iPhone. LaunchD was recommended as a solution ...
Ashley's user avatar
  • 227
4 votes
1 answer
7k views

Notepad++ how to copy the text (only) which matches the regex expression (not the whole line)

I am looking for a simple way to copy into the clipboard all the "marks" in notepad++. I found that I could copy the whole line that match the regex using the bookmark option. But I'm looking for a ...
JinSnow's user avatar
  • 824
4 votes
1 answer
12k views

ping: socket: Operation not permitted Ubuntu docker image

Hi i am new to docker and linux. I am trying to ping a particular ip address from a python file in a container built on ubuntu 18.04 base. I get the following error when the kubernetes pod container ...
karthik's user avatar
  • 41
4 votes
2 answers
67k views

Failed at step EXEC spawning: No such file or directory

Given the following one-shot service, enabled at boot, [Unit] Description = My Server Daemon Documentation = https://etcetc.org Wants = network-online.target getty.target NetworkManager-wait-online....
Patrizio Bertoni's user avatar
4 votes
1 answer
4k views

apt-offline on Windows

Following this tutorial, I don't know how to reproduce step 2 on a windows machine: apt-offline get C:\apt-offline.sig --threads 5 How do I install apt-offline on a Windows machine so I can run this ...
Christian Heinrichs's user avatar
4 votes
1 answer
8k views

Windows 7 : Prevent computer from sleeping while there is network traffic

I have a python script that is downloading data on a remote computer. I want to prevent the computer from going to sleep as long as the data download is in progress. However if the program finishes/...
user's user avatar
  • 1,177