New answers tagged

0

There are different ways to invoke a shell. When you log into a system, either with a terminal emulator (such as when you start WSL) or via SSH, such a shell is called a login shell. Any shell you start and type commands into, whether or not it is also a login shell, is called an interactive shell. A non-interactive shell is any shell that is used for ...


0

Edit your bin/activate file of your virtualenv from this else PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}" fi To this else PS1="(your prompt) ${PS1-}" fi By maintaining the suffix you won't lose your pwd information from the terminal


2

The solution is to combine the relevant parts of bin/activate with ~/git-prompt.sh. Here __git_ps1_venv() is a function that wraps __git_ps1() and modifies the first argument of __git_ps1() to include the virtual environment. The PS1 variable should be set to the format of your prompt. ~/.bashrc: ################## # Prompt ################## __git_ps1_venv(...


2

You need to specify either python2 or python3... As yum install python3-setuptools or yum install python2-setuptools


0

As pointed out by jsbillings while CentOS is listed in below script, only version 7 is explicitly compatible: 77 78 def check_distribution_compatibility(): 79 dist_name, dist_version = get_distribution_info() 80 supported_dists = { 81 'macos': [10.9, 10.10, 10.11, 10.12], 82 'ubuntu': [14, 15, 16, 18, 19, ...


0

You could also get the PID of the last background job: $ FLASK_APP=myapp flask run & [1] 10947 $ mypid=$! $ echo $mypid 10947 $ kill $mypid [1] + terminated FLASK_APP=myapp flask run


1

CPU-G is a python 3 application. The instructions to run it are published here: https://github.com/atareao/cpu-g In short: sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0 pip3 install pycairo PyGObject psutil dbus-python git clone https://github.com/atareao/cpu-g.git cd cpu-g/bin python3 cpu-g


3

If you want to stick to the rule that everything in /usr apart from /usr/local should come from a package, I would actually download the python-is-python3 package and install that. It only ships the /usr/bin/python symlink and required documentation, and its package relations are unlikely to cause problems in the future. An alias won’t help with your scripts’...


2

Your commands.txt has probably its lines terminated by \r\n (windows-style) instead of just \n (unix-style). Just convert it to unix with sed -i 's/\r//' commands.txt or run your script as sed 's/\r//' commands.txt | python postpycess.py.


1

I created a sample input file based on each line being 10 fields with fields 4 and 9 possibly quoted: $ cat file n9sih438,4994fa72322,PMC,here is an unquoted string,10.1371/journal.pone.0000645,PMC1920550,17653272,cc-by,here is an unquoted string,2007-07-25 n9sih438,4994fa72322,PMC,"here is a,",string,","within,", quotes.",10....


1

It doesn't look like a file permission error - see the line that triggered the fault: sock.connect(sa) This is a network connection attempt. Either your local port number is less than 1024 (so it's a privileged port requiring root permissions) or there's something like SELinux getting involved.


1

I don't know the issue but I simply fixed it by curl -O https://bootstrap.pypa.io/get-pip.py; python get-pip.py


-1

If you are interested in using python in shell, you should look into xon.sh. It is a python based shell where you can write scripts in python.


2

E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi' points to the culprit: /usr/lib/cnf-update-db. Disabling that should allow your apt update to go further: sudo mv /etc/apt/apt.conf.d/50command-not-found{,.disabled} ...


0

If you are installing from a depot file, you'll only need the run-time dependencies. Build-time dependencies are only needed if you wish to rebuild the depot from the source code, e.g. to produce a newer version of it. You can even compile new programs that use libffi with only run-time dependencies for it installed. The instructions available with the "...


3

You seem to be using pip as well as yum to install packages. The packages installed by pip would not be visible to yum, which would be the reason why your installation is failing. This article on opensource.com explains the concerns well: Managing Python packages the right way. I will summarize the key information here. When you install a package globally ...


Top 50 recent answers are included