Context
Earlier this week, while my computer was starting Ubuntu 17.10 it shutoff due to low battery.
The Problem
Upon plugging in and rebooting I noticed some unusual behavior. One of the key things was that Oh My ZSH appears to be broken. Meaning, when I opened Terminal, pressed the up arrow to cycle through my history, and hit enter to execute the command: it reported it could not find my ZSH history log and failed to execute the command.
What I've Tried
So I assumed that ZSH was corrupted as a consequence of the improper shut down. So I reinstalled and the history error disappeared. But then it couldn't find NPM, Gulp or Bower. Meaning, when I executed something like gulp watch it reports zsh: command not found: gulp.
So I attempted to reinstall gulp with NPM and it reported the same error but for NPM.
I concluded that they were still installed and not corrupted but that ZSH simply can't find them.
So I tried a random command to export "paths" from a bash file to my ZSH file (I think they're called .rc files but I don't remember).
Then it seems to work.
Then I closed Terminal and it stopped working.
So I reinstalled ZSH again, this time using apt-get and it worked without having to export my paths.
Then I restarted (properly) and discovered it's broken again.
The Question
Can anyone explain why this is happening and how to resolve it?
short answer: add path in your ~/.zshrc
tl;dr
find executable path for your libraries or programs and add them
nano ~/.zshrc
export PATH=/path/to/lib/or/bin:$PATH
then save the file (ctl+o)
after this restart your zsh or reload the rc file (source ~/.zshrc)
Related
I'm a newbie in programming but now have to use terminal a lot.
After having a brush with losing my .zshrc once before, I've been careful not to disrupt it but I installed iterm2 and oh my zsh and now almost no commands are working. I've been through all the links I could find to try trouble shoot it but i'm coming up bagels.
Context:
Mac OS monterey 12.5 macbook air M1.
default terminal was zsh
Installed iterm2 and zsh according to this tutorial.
My .zshrc file now looks like the default that is overwritten by oh my zsh (hence the issue as my paths are now gone).
I've tried the following pages for help:
This one which suggests that I copy across my ~/.bashrc which I don't have. or the other work around which I went through and tried all the suggestions in there to no avail. Brew wasn't working so I tried that again, tried to uninstall everything and even tried to 'pip-purge' but that wasn't a recognised command either.
The first thing I've been trying to run was jupyter so I'll use that as the reference point. which and where are pulling up nothing. Trying to install it again shows it is installed. trying jupyter --version or --path shows nothing. I even tried 'sudo' on one of the solutions and it said that sudo was an unrecognised command.
My current paths that I have tried to put into the .zshrc file are as follows:
export PATH=$PATH:~/.local/bin
export PATH="/opt/homebrew/bin:$PATH"
export PATH="$PATH:/Users/itamar/Desktop/Dev/flutter/bin"
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.10/bin"
export PATH="$PATH:/Users/itamar/Library/Python/3.10/lib/python/site-packages"
export PATH="$PATH:/Users/itamar/Library/Python/3.10/bin/jupyter"
export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH="/Users/pierrethiollent/.oh-my-zsh"
I don't even mind if I have to nuke everything and start fresh but I don't know what will work short of reinstalled mac osx and even then I don't know if this will actually solve the problem.
Okay. solution found for those who have the same issue and are not migrating from bash to zsh.
Underneath your /.zshrc iterm2 or ohmyzsh will have backed up your previous path list to a file called '.zshrc.pre-oh-my-zsh' which will have your old paths. copied these into the zshrc file and it's working. Phew!
I'm using zsh on Linux with OhMyZsh and the powerlevel10k theme. I'm also using nvm since I have to switch node versions for different projects.
I'd like to achieve that zsh automatically uses the node version set in the .nvmrc file (if one exists). That should be triggered when changing into a directory that has a .nvmrc file, but also when opening a terminal (e.g. opening a vscode project, the internal terminal should be set to the respective node version).
I tried the ohmyzsh nvm plugin (with export NVM_LAZY=true and export NVM_AUTOLOAD=true), but that causes this behavior with powerlevel10k when opening a terminal:
[WARNING]: Console output during zsh initialization detected.
When using Powerlevel10k with instant prompt, console output during zsh
initialization may indicate issues.
...
The zsh-nvm plugin works better (with export NVM_LAZY_LOAD=true and export NVM_AUTO_USE=true). It automatically changes the version when changing directories, however not when opening the terminal.
I achieved that by adding this line to my .zshrc file:
[ -s "./.nvmrc" ] && nvm use > /dev/null 2>&1
That does not cause the above mentioned powerlevel10k issue, however the terminal changes the look (applying the powerlevel10k theme) after a couple seconds. I guess that is because of loading nvm right away (and not lazy loading it anymore). If I open the terminal in a directory without .npmrc, it opens fast and with the p10k theme right away.
I can live with this setup, but it is still not ideal and feels hacky. Is there a better way to do it?
Just for reference, there is also this issue on the zsh-nvm github
I am learning to program in Python and Rust. On different versions of Ubuntu these programs compiled and ran perfectly. Now that I have a dedicated Fedora 30 KDE system, every time I try and build a program, I get a warning: Failed to load module "appmenu-gtk-module"
I have tried looking this up and have re/installed anything GTK on my system. The programs otherwise function well, but no menus are drawn. I was also trying things in GNOME and hit the same thing.
I am also using QT. Those programs also build and run fine, but again, no menu.
I'm going bonkers with this. Any help is appreciated.
The appmenu-gtk module is not packaged on Fedora. (GNOME doesn't support them anyway.)
The real questions are:
Why is it configured to load? Did you copy or share GTK config files from an Ubuntu system? You should remove this module from your settings.
Even with improper configs I don't believe this should result in menus not appearing. It should just fail to load and work as normal. How is your application using menus?
I finally got so fed up with getting this error that I went full nerd-diagnosis, and ran this command to find out which file contained the errant reference to the appmenu-gtk (the package that would provide this is not installable on my system either).
(Replace "dolphin" with the command that is giving you the error.)
strace -e openat,access dolphin 2>&1 |grep -v ENOENT |awk '/appmenu-gtk/ {exit} !/appmenu-gtk/ {print}'|cut -d '"' -f2 |sort|uniq|xargs grep appmenu-gtk 2>/dev/null
This will then give you a list of files which contain the line appmenu-gtk, and in my case it was ~/.config/gtk-3.0/settings.ini. From there I just commented it out, and that gets rid of the error message (not sure if this will fix your problem of not having any menus, but you might just be able to edit that line to fix it in another way if commenting it out doesn't work).
I am trying to install the pyperclip module for Python 3.6 on Windows (32 bit). I have looked at various documentations (Python documentation, pypi.python.org and online courses) and they all said the same thing.
1) Install and update pip
I downloaded get-pip.py from python.org and it ran immediately, so pip should be updated.
2) Use the command python -m pip install SomePackage
Okay here is where I'm having issues. Everywhere says to run this in the command line, or doesn't specify a place to run it.
I ran this in the command prompt: python -m pip install pyperclip. But I got the error message "'python' is not recognized as an internal or external command, operable program or batch file.
If I run it in Python 3.6, it says pip is an invalid syntax. Running it in IDLE gives me the same message.
I have no idea where else to run it. I have the pyperclip module in my python folder. It looks like a really simple problem, but I have been stuck on this for ages!
You need to add the location of the python.exe to your $PATH variable. This depends on your installation location. In my case it is C:\Anaconda3. The default is C:\Python as far as I know.
To edit your path variable you can do the following thing. Go to your Control Panel then search for system. You should see something like: "Edit the system environment variables". Click on this and then click on environment variables in the panel that opened. There you have a list of system variables. You should now look for the Path variable. Now click edit and add the Python path at the end. Make sure that you added a semicolon before adding the path to not mess with your previous configuration.
On windows after running the grunt build command for creating brackets shell it gives done without errors but i dont see any .exe file generated..
What might be the problem???
Here are some possible solutions:
Are you following the full brackets-shell build instructions, including all prerequisites?
Make sure Brackets isn't running at the same time. The build will fail silently if the .exe file is currently in use (see bug).
Try with a fresh git clone of the repo. If your brackets-shell local copy has been around for a while, sometimes the build & deps folders can get in a bad state. (I'm assuming you haven't modified the source at all. If you have, try with an unmodified copy of the source first to make sure it builds correctly without any of your changes).
Check that python --version shows 2.7.x
Verbose build output would also be helpful in diagnosing issues like this, but unfortunately there's not yet an easy way to get that...
If you follow the instructions on bracket-shell's wiki page, the Windows executable should be created in the Release directory.