.zshrc: command not found: jenv - command-line

I recently followed the steps to install jENV and Corretto-8. Unfortunately now whenever I open a new terminal I see the following:
Last login: XXXXXXX
/Users/username/.zshrc: command not found: jenv
/Users/username/.zshrc: command not found: jenv
Does anyone know how to fix this? I am truly at a loss.

This problem is likely occurring because jenv has not been added to your PATH before jenv init runs. Look at your .zshrc file and ensure the jenv section looks like this
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
Also, be sure that you don't have multiple jenv sections since the installation instructions for Zsh are not re-runnable. If you accidentally ran the instructions for Zsh twice, you will find two jenv sections at the end of your .zshrc file and you should delete one of them.

Today I was running into the same problem. I installed jenv via brew but it showed every time: "command not found".
The solution was, that jenv wasn't linked. So I run the following command and everything worked after that:
brew link jenv

You might have installed it using MacOS brew and did this as well:
$ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(jenv init -)"' >> ~/.bash_profile
Now, you will have a duplicate command in your bash. Remove those two lines in your bash and you should be good.

Related

VS Code Denied Permission unlink 'usr/local/bin/code'

I can add the "shell command install 'code' command". Testing it works, but if i close out of the VS Code or after a couple of hours of adding the command it doesn't work. Terminal says "zsh: command not found: code" and on VS when click on the "shell command install code command" has a "EACCES: permission denied, unlink 'usr/local/bin/code' " pop up. How should i go about this? I'm using a macbook 2020 if that matters
Uninstall the code command from PATH in VS Code and reinstall it.
Open the command palette in VS Code using cmd + shift + p. Search "uninstall 'code'" and select the first option to uninstall.
Once uninstalled, "install 'code'" for installing.
That should fix it.
This happened to me on Macbook Pro M1 Chip. Basically follow this:
Simply uninstall the code command from PATH in vscode and reinstalled. i.e open the command pallete, search "uninstall 'code'" and select the first option to uninstall. Do same for installing too. That should fix it.
Found this solution on github
Try run:
sudo chown -R yourUsername /usr/local/bin
This command solves user just for copy paste.
sudo chown -R $USER /usr/local/bin
From a sample size of me and three friends, this is a common problem on M1 MacBooks and Mac Minis. Running the command:
sudo chown -R yourUsername /usr/local/bin
This resolved the VS issue for me and allowed me to install npm packages globally.
For Mac I have run below steps in my terminal and it resolve my issue.
you can also Try:
Open terminal.
sudo chown -R your_user_name /usr/local/bin
Open visual studio code.
use keybord command + shift + p
Type the bellow command.
install 'code'
Vs Code
For test go to terminal and run code .
I've run into this a few times on before. Steps I took to that fixed it for me:
open vs code and press cmd + shift + p to open the command palette
search for uninstall 'code' and press Enter
lastly, search for install 'code' and press Enter
For macOS:
Try uninstalling and reinstalling. (command + shift + p) >shell Command: Uninstall 'code' command from Path
append the following to your ~/.bash_profile file (~/.zshrc in case you use zsh).
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
I was getting same error to Install on Windows 11:
Just deleted folder C:\Users\my-username\AppData\Local\Programs\Microsoft VS Code\bin
Also removed VS Code from environment variables
Installed successfully!
for any mac users, you can try
sudo rm -f /usr/local/bin/code
That should help. It's important to note that you should be careful using sudo, since you can do a lot of damage in files and folders with it. But in the most dire instances, you should use it, similar to using any kind of --force commands, you should not use it often.

Recipe terminated with fatal error: spawn latexmk ENOENT

I have just installed debian 10 as well as vscode. I have been struggling with this for 3 days now.. I installed texlive from terminal with the following command:
sudo apt install texlive
I then installed the latex workshop extension in vscode and tried building a .tex file. The following error popped up:
Recipe terminated with fatal error: spawn latexmk ENOENT.
I then preceded to install latexmk from terminal with:
sudo apt install latexmk
The same error kept popping up after that. The output showed this.
[14:59:34] Recipe step env: {}
[14:59:34] cwd: /home/phoenix/Documents/stellies/year4/2021/s&s-414/pracs/prac-4/report
[14:59:34] LaTeX build process spawned. PID: undefined.
[14:59:35] LaTeX fatal error: spawn latexmk ENOENT, . PID: undefined.
[14:59:35] Does the executable exist? PATH: /app/bin:/usr/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/node/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/cargo/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/python/bin
[14:59:35] The environment variable $SHELL: /bin/sh
I then proceded to review the texlive website. I noticed that i did not set the path variable to include the texlive binaries. The texlive website gives the following path to the binary files : PATH=/usr/local/texlive/2021/bin/x86_64-linux:$PATH
however /usr/local/texlive does not exist on my system for some reason. Where can i find the correct path to the texlive binaries on Debian 10?
I had the same problem. The root cause was: (1) software's bin folder missing from PATH; (2) bad file privileges. Consequently, VSC couldn't access latexmk, which explains the error messages.
In my case, the problem occurred on a mac, and specifically after I installed MacTex, which, in turn, installs Tex Live. I believe the same solution may apply to linux distros too.
Solution:
Claim file ownership (which was originally root) under folder /usr/local/texlive: sudo chown -R <username> /usr/local/texlive, where <username> is the OS-level user name. The fix will work for this specific user. If it is not enough, try instead setting group owner appropriately, and/or consider Step 3.
Add /usr/local/texlive/2021/bin/<software_dialect> to PATH. <software_dialect> depends on the installed software version: in my case it is universal-darwin; on linux it might be x86_64-linux.
If the problem persists, try to change file access permissions under /usr/local/texlive using chmod.
EDIT: As a final step, restart VSC for changes to take effect.
I recently encountered the same problem on MacOS Monterrey (M1 based). I used basictex (just for the context). As required by the installation instruction,
I added TeXLive to PATH,
installed latexmk package to the TeX distribution.
However, still got the same error as OP.
Afte reading the wiki again more carefully, what finally worked for me was as simple as restarting VS Code and MacOS. Everything works as expected after a reboot of the MAC.
I had this same problem on Mac recently, the fix that worked for me was to uninstall and reinstall the LaTeX Workshop extension.
I got the same issue , seems to be a misbehaving from Vscode on MacOS
check if the command is in the path on mac
-which command_you are running example which latexmk
If this output something that means you have your latex installed, otherwise go and installed it and make sure it is accessible via command line.
If latex is installed and you are getting that issue you can just restart your VSCode and everything will be okay.
Had a similar error and came across this post when looking for a solution.
I wanted to use texlive on Vscode with WSL2 on Windows 10. Installing texlive-full in wsl fixed this error for me.
On Mac, this is a way to fix the issue
Step1: reinstall mactex by downloading it from this link: http://www.tug.org/mactex/mactex-download.html
Step2: In your terminal do cd /usr/local, you should see texlive folder
Step3: In your terminal do sudo vim etc/paths to set the environment. Details are in this link: https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/
Step4: In your terminal do /usr/local/texlive/2021/bin/x86_64-linux at the bottom. check the folder to see if the year is correct. Details in: http://www.tug.org/texlive/quickinstall.html.
Step5: Quit VC code completely, and reopen it.

Fail to open vscode in WSL bash on ubuntu using cmd code

When I tried to open vscode in WSL bash on Ubuntu 20.04 using command code ., it failed and the following message was logged:
/mnt/c/Users/john/.vscode/extensions/ms-vscode-remote.remote-wsl-0.50.1/scripts/wslCode.sh: 57: /home/john/.vscode-server/bin/d2e414d9e4239a252d1ab117bd7067f125afd80a/bin/code: not found
I would like to ask how to fix this problem? Thx a lot!
I found the solution. Even though I think that you've already know it.
You need to delete the folder /home/john/.vscode-server/ with sudo rm -rf /home/john/.vscode-server.
Then, you just run code . or try to open any project that you want it.
Then a script will load and will install a new .vscode-server in your machine with the right files.

Can't connect to jupyter server in vscode

My settings file looks like this
{
"python.pythonPath": "/home/username/.conda/envs/myenv/bin/python",
"terminal.integrated.inheritEnv": false
}
And I can see the conda environment in the interpreter that I'd like to activate from vscode interpreter selections but whenever I try to run the a cell in vscode I get a long error message.
Activating Python 3.7.7 64-bit ('myenv': conda) to run Jupyter failed with Error: Command failed: . activate myenv && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /home/username/.vscode/extensions/ms-python.python-2020.8.105369/pythonFiles/pyvsc-run-isolated.py /home/username/.vscode/extensions/ms-python.python-2020.8.105369/pythonFiles/printEnvVariables.py bash: activate: No such file or directory .
I chdecked my $PATH variable and it each directory existed in it. (Looks like how other stack questions suggested it should look as well)
What am I missing? I had it working on a similar machine a couple weeks ago but I can't seem to get it to work now.
I'm on Ubuntu 20.04 if that's important.
I am not completely familiar with the issue, but some digging around lead me to this, try these settings
"terminal.integrated.env.linux": {
"PATH": ""
}
If that doesn't work please reference this link. They seem to be experiencing the same issue as you, but on windows. You may be able to extract more information from it than I could. Sorry if this didn't help.
After messing around quite a bit, I made a new environment and it worked. I'm not sure what I did within that environment to make vscode unhappy with it but vscode didn't like something about it.
Before making the new environment I also ran a few commands including
sudo chown -R $USER:$USER ~/.conda
sudo chown -R $USER:$USER ~/miniconda3
conda update -n base -c defaults conda
I'm not sure what got it to work but I'm happy it's working now!

mkvirtualenv: command not found Git Bash Windows

I'm following the Django installation tutorial for Windows. I ran the installation command below and it worked fine.
pip install virtualenvwrapper-win
However, when I try running mkvirtualenv myproject I get an error saying bash: mkvirtualenv: command not found
I am running Git Bash on Windows. I found a solution for the Windows Command Prompt here, but I was hoping to use Git Bash, because I'm much more familiar with it.
Thanks!
Maybe it is too late to answer this, but let me put my anser here anyhow.
I ran the pip install command twice, and finally everything is working for me. Just run "pip install" line this:
First do it: "pip install virtualenv virtualenvwrapper"
Second, do it: "pip install virtualenvwrapper-win"
Everything should be fine after that.