New answers tagged

-1

To install or update python just type this in Terminal: sudo apt-get install python That's it :)


0

I had the same error message when running apt-get anything after upgrading to 15.10. Running sudo apt-get install python3 libpython3-stdlib Got me passed that problem. At the moment apt-get dist-upgrade is still running, so I do not know that it is all good yet, but at least it is progress.


1

sudo apt-get update sudo apt-get install python3-pip sudo pip3 install virtualenv Now, whenever you start a new project, you can create a virtual environment for it. Start by creating and moving into a new project dire ctory: mkdir ~/newproject cd ~/newproject Now, create a virtual environment within the project directory by typing : ...


0

Solved a similar error in a separate situation by installing the package future. sudo pip install future It's not clear if your error occurs when running 2to3 or when trying to run the resulting code. If it is when running 2to3 it is likely because it's actually using python2 (the default) and thus if you haven't installed the future, builtins will be ...


9

Don't remove python 2!! Ubuntu versions, later then 12.04 already have python 3 installed. This is an additional version, not instead of. A lot of software (still) depends however on 2.7, removing it will break the system. On Ubuntu, python 2 is called by: python or python2 while python 3 is called by python3 See the current version(s) If you ...


0

You could be just 4 terminal commands away from an easy installation, depending on the state of your system. First, there is always risk breaking from the herd. My 15.10 system only has python-matplotlib 1.4.1something or other. You could download the source Once you have satisfied the requirements detailed in the INSTALL file (mainly python, numpy, ...


0

Ubuntu comes with 2.7 and 3.4, and 2.7 is technically default, with /usr/bin/python being a symlink to /usr/bin/python2.7 skolodya@ubuntu:$ python python python2 python3 python3.4m python/ python2.7 python3.4 python3m skolodya@ubuntu:$ ls -l $(which python) lrwxrwxrwx 1 root root 9 Aug 15 00:39 ...


2

Ubuntu 14.04 comes with both Python 2.7 and 3.4 installed by default, but not with any Python IDEs. For starters, install IDLE for both versions: sudo apt-get install idle idle3 The icons for both will show up in the Dash, and when you run them, you right click on the icons to lock them to the launcher. If you don't mind using a terminal, run python2 and ...


0

There is a separate package for the Python 3 version of the python plugin. If your distribution does not ship it, please complain. Code completion in Python is unfortunately very hard for some of the shipped modules. Look at os.py -- there's no way to find e.g. the declaration of getcwd() there :/ The re module should work ok though, eventually you have to ...


0

It appears that the released version of Pygame does not support Python 3. The latest release is already packaged in Ubuntu, and you can install it with python-pygame, however there it is for Python 2.x only. You need to run your script with python instead of python3.


0

cat > /usr/local/bin/py #!/usr/bin/dash python3 "$@" <CTRL-D> (provided you have write permission to /usr/local/bin) likewise cat > /usr/local/bin/pyi #!/usr/bin/dash python3 -i "$@" <CTRL-D> then you only type py (and use py in #! lines) for your chosen python.


0

In general, many Python packages that do not have explicit python3 implementations in the package manager (aka, python-numpy, python3-numpy) are Python3 compatible and can be installed by downloading the package and running: python3 setup.py install In other words, the setup script from python3. Many of the packages that are not immediately compatible ...


0

Have you tried installing the package python3-gdbm sudo apt-get install python3-gdbm


1

Solution 1: Use Docker I would suggest that you use Docker If you would like to test out a newer version of Python without overwriting your system Python (which it is very important that you don't, because Python 2.x and 3.x are different enough that 3.x will have breaking changes and will cause problems for packages that depend on Python 2.x) Docker is a ...


2

What you actually want Looking at your edit, what you actually want is to create the folders: Pictures Documents Songs Videos Database Others Instead of the folders, named after the extensions, like in the original script. The principle The first rule is always: if you do the same thing more than once, make it a function. Repeating the same thing is ...


0

You have to add identation on that line and below. Python uses identation to identify code blocks and the code below the if statement should be identated since it belongs to the if block. Standard identation acording to PEP8 is 4 spaces.


1

Python is whitespace sensitive, this means you have to indent code correctly; otherwise you'll get errors... After an if block, you need to indent the code, you can use Tab to do this. Your code should look like this: #!/usr/bin/env python3 import os import subprocess import shutil # -------------------------------------------------------- reorg_dir = ...



Top 50 recent answers are included