Hot answers tagged

3

The Python that ships with CentOS 7 comes in an RPM, under normal situations it is best to leave that version installed and install a different/newer version of Python in a separate location, otherwise strange issues can occur when system level applications that use Python are run (not all the time but it might be best since you are new to Linux to avoid ...


2

The package didn't disappear from Debian 8 (Jessie), it wasn't part of the release. python-pyds9 (which provides the python3-pyds9 package) builds just fine on Debian 8, so the easiest way to do this is (currently): sudo apt-get --no-install-recommends install devscripts debhelper dh-python python{,3}-setuptools python{,3}-six dget http://httpredir.debian....


2

Because they are not Python scripts. That's a bash script, as you can see in the first line (#!/usr/bin/env bash). To run that script just save it to a file, give it executable permissions and open it or just run bash /path/to/script in the Terminal.


2

When you invoke python3.5 -m site then python searches for a file site.py in your sys.path. This sys.path is a list determined where your python is installed and by environment variables, and various other mechanisms including the ones to recognise packages installed under site-packages. Now your matplotlib might be in one of those paths. But if you e.g. ...


1

If apt is borked, sometimes it's possible to set things right manually with dpkg and the full path of the local cached package. Here's how: cd to where apt stores the packages, namely /var/cache/apt/archives/ dpkg then (as needed) the switch for install, remove, purge or whatnot, then the filename of the package in the current directory. So to install ...


1

Perhaps a better way without having to re-install your OS would be to download the python package (and possibly any python modules package) and use rpm to install them over your upgraded Python. The python package for RHEL 6 should be python-2.6.6-64.el6.x86_64 which should be available from Red Hat or you can pull it off a RHEL6 .iso file. You will ...


1

pip install gprof2dot installs the script as gprof2dot, not gprof2dot.py. Just remove the .py in your command and you should be good to go. For future reference: You can enter a part of an unknown command at your shell prompt and press Tab to try and auto-complete it (which I did in this case). For packages installed via pip, you can also list the files ...


1

From the SyntaxError you have pasted, it sounds like you are running the script under the wrong version of python, specifically Python 2 instead of Python 3 (because the SyntaxError may be complaining about the annotations, which only exist in Python 3). If you read the error you actually got, you can see that this really doesn't have anything to do with ...


1

print subprocess.check_output(['zsh','-i','-c','echo $PS1']) When running zsh from another shell, the quotes around echo $PS1 are necessary so that the whole string is passed as the single argument after -c. They had to be single quotes because in double-quotes, the first shell would have expanded $PS1. In Python, the whole command is a single string, so ...


1

I think the correct way is to call subprocess as follows: >>> prompt = subprocess.check_output("""echo $PS1""",shell=True,executable="/bin/zsh") Then you can check the result by >>> prompt Enter or you can use call to see the results directly: >>> subprocess.call("""echo $PS1""",shell=True,executable="/bin/zsh") So you don't ...


1

It is defined in an include-file read by the make program, e.g., by this line at the end of the port makefile: .include <bsd.port.mk> On my FreeBSD 10 system, the include-files are in /usr/ports/Mk, and grep finds these matches: $ fgrep -n PYTHON_REL * bsd.python.mk:70:# PYTHON_REL - Version number in numerical format, to ease bsd.python....


1

If I understand you correctly, you want to edit files under Windows locally and run these as Python scripts on the Linux server without having to copy them manually over to the server. The easiest way would be to define X:\mapped_drive\all_folders\etc as a share on Windows and to mount it with e.g. smbmount or pref. cifs on the Linux server. Once mounted ...



Only top voted, non community-wiki answers of a minimum length are eligible