Python is an interpreted programming language that is often, but not solely, used as a scripting language. A version of Python is included by default on all Ubuntu distributions.

learn more… | top users | synonyms

87
votes
4answers
121k views

How do I sudo a command in a script without being asked for a password?

I want to turn my system on automatically every day. So I use the below code in my Python script, but sudo asks me for a password every time: os.system('sudo sh -c "echo date \'+%s\' -d \'+ \ ...
58
votes
5answers
16k views

How do I create a deb package for a single python script?

I have a single python script that I want to distribute as a deb package. It is a indicator which shows local date in Unity panel. I did follow create a .deb Package from scripts or binaries but I ...
51
votes
2answers
43k views

apt get install vs pip install

I am a bit confused about the cases in which the above commands must be used when downloading python packages. I was trying to download a package named pyudev in accordance with an answer with this ...
26
votes
4answers
168k views

run python in terminal

Trying to learn how to run my scripts through Ubuntu's terminal regularly. That being said I am familiar with bash, wget, and awk being called but how do I call python files to run in the terminal? ...
23
votes
3answers
5k views

Is it possible to use Python with the Ubuntu SDK?

David Planella wrote in his answer to a question I posted that: ...the recommended way to develop apps for Ubuntu is the Ubuntu SDK. So I installed it, but looks like the supported programming ...
1
vote
4answers
8k views

How do I run Python code as a script? [duplicate]

I need help running python in ubuntu I can run python without a problem in my terminal but when I create a .py file I can't get it to run.
51
votes
3answers
7k views

Is #!/bin/sh read by the interpreter?

In bash or sh, I guess anything which starts with # is a comment. But in bash scripts we write: #!/bin/bash And in Python scripts, there is: #!/bin/python Does this mean that # by itself is a ...
12
votes
3answers
25k views

How do I make the terminal run python 3.1?

Currently, when I type "python" at the terminal I get v2.6 which is all fine and dandy but how can I set it to use v3.1 instead? Is there a "path" variable out there somewhere that I can change like ...
84
votes
4answers
349k views

How do I install python 2.7.2 on Ubuntu?

I want to install python 2.7.2.tgz on Ubuntu, downloaded from http://python.org/download/. Is this a correct way to install : ./configure make make install If not , how can I do that?
40
votes
4answers
55k views

How to set up and use a virtual python environment in Ubuntu?

Python virtual environments are used to create isolated python environments to avoid dependency and version conflicts, and also indirectly takes care of permission issues. But what is the easiest way ...
29
votes
2answers
12k views

easy_install/pip or apt-get

As noted in the Ubuntu wiki page on Rails it is recommended that gems manages your Rails/Ruby dependencies. What is the best practise with Python packages like Django? Should I install them through ...
34
votes
3answers
47k views

How do I install newer Python versions using apt-get?

How can I install a newer version of Python using apt-get? Obviously I realise I can install using the source tar ball, however I would prefer not to install from source and instead use the package ...
8
votes
1answer
373 views

Create a quickly app with build dependencies

I am creating a Quickly app in Ubuntu that depends on Python Twisted, which is available in the package python-twisted. How should I add python twisted as a dependency so that it will be installed ...
10
votes
1answer
1k views

How to create a new Quickly application template?

Cannot find the answer elsewhere, I'm asking for a documentation of the process to create a new template for quickly. I'm interested in writing a pyside (python + qt4) template like the pygtk one. ...
6
votes
1answer
4k views

How to update ubuntu's python with latest version from source?

I'm using Ubuntu 11.10. The python 2.7.2 provided has a bug that has been corrected in the latest 2.7.2 sources from the python repository. What is the recommended way to replace the ubuntu provided ...
9
votes
6answers
7k views

Deleted the python binary, and can't recover using apt-get, what can I do?

Well. Yep. Wanted a fresh start because I was having dependency confusions, so I ran "whereis python" and literally erased all of the files and directories that came up. Then when I go to run apt-get ...
2
votes
2answers
717 views

Horizon: Apache exceptions at import_module

I've deployed Openstack using juju, and everything looks normal except that I cannot browse to openstack-dashboard. I get error 500 Internal Server Error. I looked through apache2 logs at that node ...
63
votes
7answers
94k views

Make default `python` command to use Python 3

I can access Python 3 via python3 command. But I want to make the default interpreter to use python command for Python 3. Simple typing python takes me to Python 2. How to upgrade?
23
votes
3answers
79k views

Installing Anaconda python on ubuntu

How to install anaconda python on ubuntu? https://store.continuum.io/cshop/anaconda/ Is there a way to apt-get install it? I only have command line access to my server, how do i install anaconda ...
8
votes
2answers
12k views

How do I set IDLE as the default editor for Python scripts?

I would like to set IDLE as the default editor for python scripts, but when I click on "open with application" and hit the dropdown to show more applications it isn't an option. Here's exactly what ...
16
votes
3answers
19k views

Ubuntu 14.04 LTS and Python 3.4.2

Is it possible update default Python 3.4 to 3.4.2? How?
26
votes
3answers
10k views

How do I get started creating an Ubuntu Desktop App?

I want to create an Ubuntu desktop app, specifically to replace Gwibber. I can code in Java, Python and a few other technologies. Adobe Flex would have been an option until Adobe decided to suck some ...
17
votes
2answers
9k views

How to read dbus-monitor output?

I'm playing around with dbus-monitor to try and understand how dbus is working in Ubuntu environment. I have several questions in this regard: Could you please let me know how to read the following ...
26
votes
2answers
13k views

What's the best way to get Python 2.5 and 2.7

Ubuntu 10.04 has only two supported Python versions 2.6 and 3.1. Developers often need more, to test that their Python code works on 2.7, 2.5 (and maybe even 2.4 and older ones). What's the best way ...
11
votes
5answers
73k views

What are the best Python IDEs? [duplicate]

Possible Duplicate: What IDEs are available for Ubuntu? What are some of the best Python IDEs for Ubuntu 12.04? Would you benefit from me learning Python?
12
votes
4answers
61k views

Problem installing Python-Dev

I am having trouble installing python-dev. It all started when I tried to install another Python package and got the error: SystemError: Cannot compile 'Python.h'. Perhaps you need to install ...
2
votes
3answers
7k views

Unable to upgrade pip

Apologies for such a basic question... but am new to linux/ubuntu and haven't been able to find answer to this... Was trying to upgrade pip but ran into this... spelee@iggy:~/python$ sudo pip ...
5
votes
2answers
4k views

Changing Python default in 12.04 LTS

I have downloaded and installed python 3.2.3 for Ubuntu/Debian. Also IDLE IDE for 3.2.3. If I execute IDLE for 3.2.3 explicitely, 3.2.3 runs under IDLE and all is well. But if I go to a terminal ...
3
votes
3answers
705 views

Python 3 error when running the print command

All I wrote in the interpreter was as follows: >>> print "Hello, World!" File "<stdin>", line 1 print "Hello, World!" ^ SyntaxError: invalid syntax How ...
94
votes
9answers
91k views

Is there an GUI Designer for python?

Is there a GUI IDE for programming python just like java has netbeans? I wanted one where we could drag & drop test boxes & labels just as we do in swing components using netbeans or eclipse. ...
23
votes
3answers
3k views

How to add support for the global menu to a python non-gtk, non-qt app?

I'm looking for good documentation (an example, tutorial, or guide) on how to add global menu support to a non-gtk, non-qt application. (In gtk it works 'magically' for the main menu...). The ...
15
votes
1answer
3k views

How can I write Nautilus scripts in Python?

I want to write a Nautilus script in Python. Is that possible? If it is possible, how can I do that?
22
votes
4answers
4k views

How to program a status icon that will display in Ubuntu as well as in other distributions?

The application in question does some action (here connecting audio to network streams) and runs minimized if these actions were successful. Therefore a status icon is needed to display the state of ...
20
votes
6answers
31k views

How to remove a deb without removing its dependencies

I would like to install the most recent version of boto, which I do via python setup.py install Yet when I try to remove the old version the following packages also get removed: apt-get remove ...
22
votes
2answers
2k views

What is the black header widget in some programs?

In some of the ubuntu programs (ubuntu control panel, system settings), but not e.g. in banshee, the top part of the window contains elements in dark tone (with the Ambience theme). But I cant find a ...
11
votes
2answers
1k views

Is PyGTK still relevant?

I'm new to Linux but not to app development. I come from a RealBasic on a Mac background. I've accepted that I need to learn a new language to develop for Linux (since RB won't run on 64 bit distros ...
11
votes
2answers
1k views

Quickly template for PyQt?

Because I like Qt and Python, is there a Quickly template for PyQt similar to the PyGTK one?
3
votes
3answers
65k views

The following packages have unmet dependencies!

I am writing this because I am very confused about installing postgresql 9.3 on mine Ubuntu 14.04. First I need it for mine Python/Django development, and I ran in to the problem, when i tried to ...
4
votes
1answer
4k views

Broken dependencies after upgrade

After an apt-get upgrade I got the following error: Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not ...
3
votes
2answers
328 views

Quickly packaging errors

I'm having some trouble packaging my Quickly (Python/GTK) app. Creating and packaging a new app (created using quickly create test and cd test; quickly package) works just fine, but the actual app ...
11
votes
2answers
44k views

How can I remove python 2.7 after installing python 3.3?

I have successfully installed python 3.3 on Ubuntu 12.10. Since I don’t need multiple versions of python, I want to remove the existing python 2.7. When I try to do that, using sudo apt-get remove ...
6
votes
2answers
11k views

How to install XML parsers with Python

I'd like to use etree, expat or similar, though I understood etree is easier to use. But how do I install that when I already have Python 2.7.2 installed on Ubuntu 11.10? All documentation I can find ...
5
votes
1answer
7k views

pyvenv vs venv vs python-virtualenv vs virtualenv and python 3

malikarumi@Tetouan2:~$ pip install virtualenv Collecting virtualenv Downloading virtualenv-12.0.7-py2.py3-none-any.whl (1.8MB) 100% |################################| 1.8MB 330kB/s ...
1
vote
1answer
245 views

AppIndicator documentation for Python

Where has the documentation for the Python bindings to AppIndicator gone? Visiting this official looking page, all the links are broken.
1
vote
1answer
3k views

OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pelican-3.6.3.dist-info'

I run pip install pelican markdown I got this error message: Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main status ...
0
votes
1answer
7k views

how to tell ubuntu to use python 3.4 instead of 2.7? [duplicate]

I have python 2.7 and 3.4 versions installed. But when I say say "python -V", it shows version as 2.7 not 3.4 How to tell ubuntu to use newest python? where is this setting configured ?
0
votes
1answer
160 views

How to uninstall redundant python instance? [duplicate]

When I execute: $ which -a python /usr/local/bin/python /usr/bin/python This bothers me because execute python directly will execute /usr/local/bin/python, but it can't link to correct dependencies....
23
votes
4answers
84k views

What is the best way to install python packages?

What is the best way to install python packages in Ubuntu 11? I am a recent convert to Ubuntu and want to learn best practices. For context, I am looking to install the tweeststream package, but I ...
25
votes
5answers
19k views

Will python2.7 be available for 10.04 in the future?

Since Ubuntu 10.04 is an LTS release will it support python 2.7 as a default package maintainer version or at least have a python2.7 package in future? Since it will be the last major python 2.x ...
35
votes
6answers
88k views

How to create a virtualenv with Python3.3 in Ubuntu?

I'm running Precise Pangolin amd64. I installed Python 3.3 from ppa:fkrull/deadsnakes. Now I want to actually use this new Python version in a virtualenv. But How can I do this? I get the following ...