-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory #10 - ubuntu-14.04

I have no 'sudo' privilege.
When I run
printf '\n%s\n%s\n%s' '# virtualenv' 'export WORKON_HOME=~/virtualenvs'
'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bashrc
it shows error:
-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
how to solve this problem? Can anyone give some advises?

Without sudo or any other way to raise privileges you don't have write access to /usr/local/bin/ so you cannot install virtualenvwrapper.sh there. Download a distribution, extract it and copy virtualenvwrapper.sh to a directory where you have write access. Edit your .bashrc to source virtualenvwrapper.sh from that directory.

I had a similar issue because pip installed virutalenvwrapper into ~/.local.
You can change its path in .bashrc:
source $HOME/.local/bin/virtualenvwrapper.sh

Related

CentOS 6.7 Root user home deleted?

Some how I managed to delete the /root directory, so I went and recreated and set the proper permissions to the file directory. However, my command line is different and instead of showing root#my-machine# I get -bash-4.1#.
How can I fix this?
Thanks
So you deleted /root and now you have -bash-4.1# in your command line huh?
Well this is caused of a missing / corrupt .bashrc (in your case missing) file in /root (.bashrc sources /etc/bashrc which is what sets the prompt). To fix it, you will run the following command which runs when an account is created. Run as the root user (since it is the user having the problem) or you can define the destination path.
command: (make sure you are in /root)
cp -v /etc/skel/.bash* ~/
Exit terminal and log back in.
I was able to fix the error by creating a new .bashrc
Because the /root directory was removed the default .bashrc was deleted.
I fixed it by running
/bin/cp /etc/skel/.bashrc ~/
and then sourcing the new .bashrc file with source ~/.bashrc

Installation difficulty; Cannot add apportable sdk bin directory into path

I am attempting to install Apportable, and I am currently attempting to add the apportable sdk bin directory into the path. Like the sample app instruction video says, I copy and paste this: "(echo; echo 'PATH="/Users/testuser/.apportable/SDK/bin:$PATH"') >> ~/.bash_profile; source ~/.bash_profile" into terminal, but I keep getting this error message: "-bash: "/Users/testuser/.bash_profile: Permission denied"
I am not sure how to proceed, or what I'm doing wrong. Any advice that you can provide would be greatly appreciated.
Thanks
It's strange that you don't have write permission to your own .bash_profile.
Here's something to try -
save the original .bash_profile
cp /Users/testuser/.bash_profile /Users/testuser/.bash_profile-save
change the permissions
chmod +w .bash_profile
update the path
(echo; echo 'PATH="/Users/testuser/.apportable/SDK/bin:$PATH"') >> ~/.bash_profile; source ~/.bash_profile

Virtualenv: workon command not found

I have installed virtualenv and the virtualwrapper via apt-get, I got to a point where I created a virtual enviroment but however later on during that same day when I used the workon command it was not found. I further on went and inspected my home directory and .virtualenvs dir and the virtualenv I created earlier were still there.
Solving this problem took two steps:
Add this to your .bashrc / .bash_profile / .zshrc:
# load virtualenvwrapper for python (after custom PATHs)
venvwrap="virtualenvwrapper.sh"
/usr/bin/which -s $venvwrap
if [ $? -eq 0 ]; then
venvwrap=`/usr/bin/which $venvwrap`
source $venvwrap
fi
Then use:
source .bash_profile
# or .bashrc / .zshrc
to reflect the changes.
Additionally, if the terminal still sometimes cant find workon, use source .bash_profile to reset and find it again.
type source .profile in home directory from terminal.
Read the readme in the top of which virtualenvwrapper.sh
You need to source it inside bashrc
open ~/.profile
cd ~
nano .profile
add at the end
#virtualenvwrapper setup
export WORKON_HOME=$HOME/envs
export PROJECT_HOME=$HOME/dev
source /usr/local/bin/virtualenvwrapper.sh
to load your .profile file you just edited:
$ . .profile
I ran in to this problem too and I simply needed to logout and log back in.
This read in the changes which the debian package manager made to my system at /etc/bash_completion.d/virtualenvwrapper

Wrong executable path for python in linux

In linux bash, I need to run an application (HTSeq) which uses python. When I run the command I get this error:
-bash: /app/HTSeq-0.5.3p7/bin/htseq-count: /usr/bin/python26: bad interpreter: No such file or directory
The thing is that I do not have "python26" in my executable path. So in my /usr/bin/ path I have followings:
/usr/bin/python2.6
/usr/bin/python
I think sometimes I have manually changed something incorrectly. But how can I fix it?
Thanks in advance.
Try renaming "python2.6" to "python26" with sudo mv /usr/bin/python2.6 /usr/bin/python26
Well, since you don't have sudo rights, you could try this:
First create a symlink,
ln -s /usr/bin/python2.6 ~/Desktop/python26
and then adding the symlink dir to your PATH variable
export PATH=$PATH:/home/<your account>/Desktop

mkdir $HOME/ error

I tried a one line script that worked in one Linux based distro(Linux mint) but doesn't work in another(Fedora). I typed the following line in my bash script.
mkdir $HOME/folder123
The error i receive:
bash: create.sh: No such file or directory
I tried creating a folder myself, it gave me a permission denied?
To clear things hopefully: mkdir is in the script create.sh and i run it in the terminal with the command bash create.sh
If I interpret your post correctly, you have a file create.sh that contains mkdir $HOME/folder123, and you're trying to run it by typing create.sh.
To execute a script, chmod +x yourscript.sh then run it with either ./yourscript.sh if it's in the current directory, or /home/whatever/yourdir/yourscript.sh if it's in another directory.
To make just yourscript.sh work, you have to place it in a directory listen in $PATH.
You can do this by copying it to any of the directories listed in echo $PATH.
Alternatively, you can create a new directory such as mkdir /home/you/bin and then add export PATH="$PATH:/home/you/bin" at the end of your ~/.bashrc. Also make sure ~/.bash_profile contains the line source .bashrc. Then log out and in again.

Resources