Anaconda Nav not activating environment - terminal

I have been using Navigator a couple of months now with 2 different environments plus the base. I have been able to start a terminal with out fail until today.
Now I get this error on the terminal initializing:
xterm: Can't execvp bash --init-file <(echo ". activate /home/xavier/anaconda3/envs/purple_path;"): No such file or directory
coming up with out any real direct info from searches or documentation.
anyone else run into this??
How would I resolve this issue?

Related

Trying to run a Unix-exec file via MacOS Terminal results in "zsh: exec format error"

I'm on MacOS BigSur 11.4. I'm trying to run an executable file to start a Minecraft server from a folder of set up files associated with a Minecraft/Python coding book (https://nostarch.com/programwithminecraft).
My order of operations has been. 1) I moved to the file's path via cd/, 2) set the file's executable bit via: chmod +x ./NAME_OF_THE_FILE, and 3) try running the following command to execute the file: ./NAME_OF_THE_FILE
Another post advised that once I run those commands, going forward I just need to run the third command while in the files path. However, no matter how many things I try to I keep getting a "zsh: exec format error."
I suspect this has something to do with the book's publication being in 2015 when the current version of MacOS was Mountain Lion, which was before they switched from bash to zsh with all releases successive to Catalina. This would suggest I'm just formatting something wrong in a way that conflicts with the zsh syntax, but I can't figure it out. I'm searching around zsh format error related posts and they all discuss actions and conflicts that seem only tangentially related to my issue. Any help appreciated.
Thank you

Why is git bash behaving weird on PyCharm?

I am using PyCharm 2019.3.3 (Community Edition) on Windows 8. I wanted to integrate Git bash in the PyCharm terminal. I have set the shell path in the terminal application settings of PyCharm as
C:\Program Files\Git\bin\bash.exe
The problem occurs when I activate a venv virtual ennvironment, set up using
python -m venv env
by running
source env/Scripts/activate
I think env is active as I see two parenthesis, () and typing pip freeze displays all installed packages in env. But this is accompanied with an error message that displays in the terminal
bash: basename: command not found
This same message is logged after typing commands like ls, clear which doesn't work but pip freeze and pip --version work. And when I deactivate env, ls, clear and pip stopped working displaying the mentioned error message.
All this problems do not occur in the Git bash application for Windows irrespective of whether I am in env or global environment and all commands work properly. I know I can just use Git bash instead of the integrated terminal of PyCharm but just wanted an answer to this problem.
What seems to be the problem here? Am I setting up my shell path wrongly or is this problem specific to PyCharm?
I solved this issue by disabling "Activate Virtualenv" checkbox in File -> Settings -> Tools -> Terminal
Since, pycharm documents does not show any support for 'Git Bash', that is probably the reason for this weird behaviour.
Terminal Options in Pycharm

iTerm and terminal fail immediately on Mac - 'BrokenPipe'

This happened right after I tried to install pyenv and then virtualenvrapper.
As soon as I open iTerminal I get a "Broken Pipe" message and macOS terminal also shuts down immediately.
I have been trying to debug my .bash_profile but uncommenting one after another but without avail
I tried updating homebrew and bash but no change (using a previously open iterm session)
I restarted my computer with the unfortunate effect that I can't access iterm or terminal now (all old sessions closed)
I am quite at loss here now, I have no clue why this happened and how to go about fixing it without having a functioning terminal.
I'd appreciate any advice or pointers.
Following #user1934428 advice I added set -x to all the bash startup files, unfortunately was still met with the same problem. Changing the startup shell in the terminal preferences didn't work.
Thankfully when using emacs ansi-term I was able to get some information/feedback message:
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
Following the link I found that default shell has been changed to zsh Catalina. So I went and followed the instructions on the support page and changed the default shell back to bash, which fixed the problem. I am not quite sure why this problem occurred initially since the Broken Pipe Error appeared before I updated to Catalina.
Anyways changing the default shell back to bash shell fixed everything

VScode docker - Can't attach to bash running the Docker container

The Docker extension for VS-code attaches /bin/sh to your containers by default. The settings file confirms this:
"docker.attachShellCommand.linuxContainer": "/bin/sh"
I have changed this in the settings editor of VS-code to attach to bash instead:
"docker.attachShellCommand.linuxContainer": "/bin/bash"
I expected to get /bin/bash as CLI when attaching to the container. Instead, it still attached me to /bin/sh.
In the meantime, I'm a day further and the behaviour of my shell has changed to the behaviour of /bin/bash. This is confusing.
After even more experimenting, I found out that I have a problem with the Chrome cache. I installed a clear-cache button in Chrome, which allowed me to clear the cache whenever I suspected this problem. Now I am in control. I did nothing wrong with the settings.
Question answered. :-)
I've had similar issues trying to use:
"docker.attachShellCommand.linuxContainer": "/bin/bash"
Getting and error:
"The terminal process failed to launch: Path to shell executable "/bin/bash" does not exist.
Ended up reverting back to:
"docker.attachShellCommand.linuxContainer": "/bin/sh"

Start /usr/bin/login instead of /bin/bash in PyCharm terminal

After updating to PyCharm 2016.3 my terminal has changed.
In 2016.2 it fired up identical to iTerm or Terminal. Now I am supposed to run /usr/bin/login to achieve it, because PyCharm only invokes /bin/bash and if I change shell path to /usr/bin/login in preferences terminal will collapse right after starting. I assume this is happening because /usr/bin/login requires login and password.
I am a little bit confused and after some research can't figure out what is going under the hood and what should I do to startup shell as in iTerm. May somebody clarify this, please?
UPD: Fixed in 2016.3.2 (in my case)
This worked for me in macOS:
1) Open in PyCharm
Preferences > Tools > Terminal > Shell path
2) Replace
/bin/bash
with
/bin/sh -login -i
Source: https://www.jetbrains.com/help/pycharm/2016.3/working-with-embedded-local-terminal.html
I got this problem too, and it is quite annoying.
The best solution I found so far is to run bash -l in the Terminal of PyCharm every time I start using it.
I tried to put /bin/bash -l into PyCharm Preferences > Tools > Terminal > Shell path, but that doesn't work.
I got the same issue and this issue is common when one installs PyCharm CE from the application market like Software Center in Ubuntu. To get /bin/bash by default in PyCharm CE terminal, you should install it by using Jetbrains Toolbox for any version of PyCharm CE and Linux distro.

Resources