New answers tagged

1

If you want Python 3 support in vim, install the vim-nox package (sudo apt install vim-nox). However, if you still need Python 2 support, install the vim-nox-py2 package (sudo apt install vim-nox-py2).


1

Try installing vim-gnome instead of vim. sudo apt-get install vim-gnome If that can help, you can install the package python-support by downloading the latest version of python-support_X.X.X_all.deb there : https://launchpad.net/ubuntu/+source/python-support Open a terminal in same folder and install with: dpkg -i python-support_X.X.X_all.deb See if it ...


4

You have a typo in shebang line, which specifies interpreter to use. It should be: #!/usr/bin/env python which will default to python2.7. Since you've tagged your question python3, you may want to use: #!/usr/bin/env python3 You should use the #!/usr/bin/env python3 line . As it stands now, your shell is interpreting the script with shebang being ...


-2

table = [map(int, s.split()) for s in open('pe18.txt').readlines()] for row in range(len(table)-1, 0, -1): for col in range(0, row): table[row-1][col] += max(table[row][col], table[row][col+1]) print "Maximum top-bottom total in triangle", table[0][0


1

Use gnome-terminal: gnome-terminal -e "python /path/to/file.py"


1

remove vim and install vim-gnome. sudo apt-get install vim-gnome


0

@daltonfury42's answer is one way to do it, but note that it will run the script first before going into the interpreter. Another one is to just run the interpreter in the same directory as your script and import it. $ cat spam.py def main(*args): print("Called main() with args: ", args) if __name__ == "__main__": main("foo") $ python3 spam.py ...


1

the file .bashrc (hidden file), located in the home directory, runs codes every time a new terminal is opened. Then add a line on it: export PATH=~/anaconda3/bin:$PATH


1

What you are looking for is the -i switch. According to the manpages: -i When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command. It does not read the $PYTHONSTARTUP file. This can be useful to inspect global variables or a stack trace when a ...


1

Wouldn't it be nice if somebody else would handle that for you? ;-) Edit your .profile and add something like the following lines: if [ -d "$HOME/anaconda3/bin" ] ; then PATH="$HOME/anaconda3/bin:$PATH" fi


2

sudo apt-get install python3.5-gdbm helped me


0

I found @David Foerster's comment quite helpful. I also had python3-numpy and python3-scipy installed, which was overriding my later install, so I simply issued: sudo apt-get remove python3-numpy And then all the proper versions were already there, as revealed by pip3 show numpy


0

sudo apt-get install python3-mysql.connector this will install mysql.connector for python3 on ubuntu


-1

Searching which package the file /usr/bin/python3.4 is in actually points to the package python3.4-minimal stm@ubu01:~$ apt-file search /usr/bin/python3.4 python3-coverage: /usr/bin/python3.4-coverage python3.4-dbg: /usr/bin/python3.4-dbg python3.4-dbg: /usr/bin/python3.4-dbg-config python3.4-dbg: /usr/bin/python3.4dm python3.4-dbg: ...


-1

Try this: sudo apt-get install ubuntu-minimal ubuntu-standard ubuntu-desktop If not Maybe install from source? I found this from a quick Google search. http://rspeer.github.io/blog/2014/03/31/python-3-4-from-scratch/ The scary part is if you don't have any dependencies you will have to dependency hunt but they should all be working if you didn't ...


0

Not what I wanted first, but I simply installed scipy using pip: pip3 install scipy


0

Let's make some wild assumptions. Your "data" partition partition is ntfs file system for Windows. It is not automagically mounted in the Ubuntu system and therefore invisible from within the system. To make data on the 'data' partition available from within the Ubuntu system the partition needs to be mounted. It could be mounted as needed, or for ...



Top 50 recent answers are included