-bash: /usr/bin/virtualenvwrapper.sh: No such file or directory - linux

I can't figure out where the shell is trying to run /usr/bin/virtualenvwrapper.sh upon server login. I want virtualenvwrapper permanently uninstalled, not just removed from the shell instance. I thought I uninstalled it with pip uninstall virtualenvwrapper, but every time I log into the server I get the error -bash: /usr/bin/virtualenvwrapper.sh: No such file or directory, as if there is some sort of leftover artifact. Yesterday I did a lot of tinkering and I can't remember all the changes I made or how I made this happen. Where is it executing the search for virtualenvwrapper.sh?
SUPPLEMENTARY INFO
$ echo $PATH
/usr/lib64/qt-3.3/bin
/usr/local/bin/ibm/lsf/9.1/linux2.6-glibc2.3-x86_64/etc
/usr/local/bin/ibm/lsf/9.1/linux2.6-glibc2.3-x86_64/bin
/usr/local/bin
/bin
/usr/bin
/usr/local/sbin
/usr/sbin
/sbin/usr/local/bin/CASAVA-1.8.2/bin
/usr/local/bin/blast
/usr/local/bin/mirdeep2
/usr/local/bin/velvet
$ sudo vim ~/.bashrc
1 # .bashrc
2
3 # Source global definitions
4 if [ -f /etc/bashrc ]; then
5 . /etc/bashrc
6 fi
7
8 # User specific aliases and functions

on ubuntu 12.04 LTS, installing through pip, it is installed to
/usr/local/bin/virtualenvwrapper.sh
And if you are using Ubuntu 16.04 or later, it is installed to
~/.local/bin/virtualenvwrapper.sh

Setting up a Virtual Environment
Now open your terminal in the home directory by right clicking and choosing the option “Open in Terminal”. You can also press the CTRL, ALT, and T keys on your keyboard at the same time to open the Terminal application automatically.
You first need to create a special directory that will hold all of your virtual environments. So proceed with creating a new hidden directory called virtualenv.
$ mkdir .virtualenv
Now you should install pip for Python3.
$ sudo apt install python3-pip
Confirm the pip3 installation.
$ pip3 --version
Now install virtualenv via pip3.
$ pip3 install virtualenv
To find where your virtualenv was installed, type:
$ which virtualenv
Install virtualenvwrapper via pip3:
$ pip3 install virtualenvwrapper
We are going to modify your .bashrc file by adding a row that will adjust every new virtual environment to use Python 3. We will point virtual environments to the directory we created above (.virtualenv) and we will also point to the locations of the virtualenv and virtualenvwrapper.
Now open the .bashrc file using Vim editor.
$ vim .bashrc
If you still haven’t used the Vim editor or you don’t have it installed on your computer you should install it now. It is a widely used Linux editor, and for good reason.
$ sudo apt install vim
After you've installed Vim open the file .bashrc file by typing the vim .bashrc command in your terminal. Navigate to the bottom of the .bashrc file, press the letter i to enter the insert mode of Vim, and add these rows:
#Virtualenvwrapper settings:
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_VIRTUALENV=/home/your_username/.local/bin/virtualenv
source ~/.local/bin/virtualenvwrapper.sh
After you are done, press the esc key. Then type :wq and press enter. This command will save and exit the Vim editor. Close and reopen your terminal when you’re done.
To create a virtual environment in Python3 and activate it immediately, use this command in your terminal:
$ mkvirtualenv name_of_your_env
You should confirm that this environment is set up for Python3:
$ Python -V
To deactivate the environment use the deactivate command.
$ deactivate
To list all available virtual environments use the command workon or lsvirtualenv (same result as workon but shown in a fancy way) in your terminal:
$ workon
$ lsvirtualenv
To activate one specific environment use workon + name of your environment:
$ workon name_of_your_env
There are several useful command you might need to use someday:
Rmvirtualenv will remove a specific virtual environment located in your .virtualenv directory.
$ rmvirtualenv name_of_your_env
Cpvirtualenv will copy the existing virtual environment to a new virtual environment and activate it.
$ cpvirtualenv old_virtual_env new_virtual_env
Well done! You have now created your first isolated Python 3 environment.

There are a number of files that might be run when you login to your terminal if you are using the bash shell.
You should check ~/.bashrc, ~/.bash_profile, ~/.bash_login and ~/.profile for "/usr/bin/virtualenvwrapper.sh".
Likely one of those files is being run on login and contains the missing script which you uninstalled.

It can be that you python packages are installed somewhere else. So try:
$ which python
/home/tesla/miniconda3/bin/python
or
$ which virtualenvwrapper.sh
/home/tesla/miniconda3/bin/virtualenvwrapper.sh
To check the location of python installation. In my case I was using miniconda, therefore system was not able to find the location mentioned in the documentation.
If the above location is not /usr/local/bin/virtualenvwrapper.sh
then now use :
source /home/tesla/miniconda3/bin/virtualenvwrapper.sh
Should work.
UPDATE Nov-2022:
I would recommend using pipenv (official docs) for creating and managing virtual environments.

For anyone finding this in the future. The virtualenvwrapper.sh script is/was now located at /usr/share/virtualenvwrapper/virtualenvwrapper.sh on Ubuntu 20.04.1 LTS (at least for me in my VM).
(Sadly i can't just comment on the above post mentioning the locations so it would all be together, because new user reputation)

sudo -H pip3 install virtualenvwrapper
i ran into to similar problem where installation could not suceed because ~/.cache/pip and ~/.cache/pip/http is not owned by the current user. installing with -H or --set-home option solved my problem.

Confirmed for Ubuntu 18 , as already answered by #Tarique . The shell script virtualenvwrapper.sh for the wrapper is within - ~/.local/bin/
(base) dhankar#dhankar-1:~/opencv_cuda$ cd ~/.local/bin/
(base) dhankar#dhankar-1:~/.local/bin$ ls -ltr
total 100
-rwxr-xr-x 1 dhankar dhankar 41703 Jul 23 20:56 virtualenvwrapper.sh
-rwxr-xr-x 1 dhankar dhankar 2210 Jul 23 20:56 virtualenvwrapper_lazy.sh
-rwxr-xr-x 1 dhankar dhankar 259 Jul 23 20:56 virtualenv

I also confronted the same problem, but this worked for me: -
Create a directory to hold the virtual environments.mkdir $HOME/.virtualenvs
Add a line like export WORKON_HOME=$HOME/.virtualenvsto your
.bashrc.
Add a line like source /path/to/this/file/virtualenvwrapper.sh
to your .bashrc.
Run: source ~/.bashrc
Run: mkvirtualenv temp
This time, the "temp" environment is included.
Run: workon temp
The virtual environment is activated.
If you are on Ubuntu 20 then use the code given below in ~/.bashrc
export WORKON_HOME=~/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=~/.local/bin/virtualenv
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source ~/.local/bin/virtualenvwrapper.sh

In my case on Ubuntu 20, I found this script in:
/usr/share/virtualenvwrapper/

Related

Remove Link Pointing to Old Version of Program in Linux

I installed Python 3 with:
yum install python3 -y
When I do:
which -a python3
I get:
/usr/bin/python3
Which is correct.
However, if I enter:
python3
I get:
-bash: /usr/local/bin/python3: No such file or directory
Apparently, python3 is still linking to a prior version which I have removed. How can I fix this so my system recognizes Python 3 being in /usr/bin/python3 instead of /usr/local/bin/python3.
Since you're dealing with an updated PATH starting a new terminal session should pickup this change.
As stated on the comment section this was the case.
For completeness, if the new path (/usr/bin/python3) is stil not on your PATH on the new session you could manually add it on /etc/profile (globally) or ~/.bash_profile (for your user, assuming you are using bash)

virtualenv not found in path

For some reason virtualenv is not in my path after installing with pip3. I have a fresh install of ubuntu 16.04.
sudo apt-get install pip3
pip3 install virtualenv
virtualenv # command not found!!!
edit: I also installed jupyter notebook with pip3 and its not in the path either.
Python executables are placed in ~/.local/bin/ on Ubuntu 16.04.
This location is not in $PATH so edit your .bashrc to append it there.
# .bashrc file
export PATH=$PATH:~/.local/bin
This is Ubuntu only (didn't check other distros)
TL;DR (if you used pip to install pkg) run following command
$ source ~/.profile
If you examine .profile there is a script looks like following.
(18 version. 16 version has something different)
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
which means everything under ~/.local/bin will be added to PATH.
So, if you used pip to install pkg and try to run from prompt. As long as pip created file under the folder it will let you run commands without full path.
You can restart the session too. Whichever you feel comfortable with.

Can I use Homebrew on Ubuntu?

I just tried to use Homebrew and Linuxbrew to install packages on my Ubuntu Server but both failed. This is how I tried to install them:
sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
I got the following warning:
Warning: /home/tong/.linuxbrew/bin is not in your PATH.
I vi my bash.bashrc in home/etc and add this:
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
Then I tried brew doctor but got No command 'brew' found. How am I able to use Homebrew on Ubuntu?
As of February 2018, installing brew on Ubuntu (mine is 17.10) machine is as simple as:
sudo apt install linuxbrew-wrapper
Then, on first brew execution (just type brew --help) you will be asked for two installation options:
me#computer:~/$ brew --help
==> Select the Linuxbrew installation directory
- Enter your password to install to /home/linuxbrew/.linuxbrew (recommended)
- Press Control-D to install to /home/me/.linuxbrew
- Press Control-C to cancel installation
[sudo] password for me:
For recommended option type your password (if your current user is in sudo group), or, if you prefer installing all the dependencies in your own home folder, hit Ctrl+D. Enjoy.
I just tried installing it using the ruby command but somehow the dependencies are not resolved hence brew does not completely install. But, try installing by cloning:
git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew
and then add the following to your .bash_profile:
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
It should work..
as of august 2020 (works for kali linux as well)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
export brew=/home/linuxbrew/.linuxbrew/bin
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile // for ubuntu and debian
The following steps worked for me:
Clone it from github
git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew
Open your .bash_profile file using vi ~/.bash_profile
Add these lines
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
Then type the following lines in your terminal
export PATH=$HOME/.linuxbrew/bin:$PATH
hash -r
Yes, it is done. Type brew in your terminal to check its existence.
You can just follow instructions from the Homebrew on Linux docs, but I think it is better to understand what the instructions are trying to achieve.
Understanding the installation steps can save some time
Step 1: Choose location
First of all, it is important to understand that linuxbrew will be installed on the /home directory and not inside /home/your-user (the ~ directory).
(See the reason for that at the end of answer).
Keep this in mind when you run the other steps below.
Step 2: Add linuxbrew binaries to /home :
The installation script will do it for us:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 3: Check that /linuxbrew was added to the relevant location
This can be done by simply navigating to /home.
Notice that the docs are showing it as a one-liner by adding test -d <linuxbrew location> before each command.
(Read more about the test command in here).
Step 4: Export relevant environment variables to terminal
We need to add linuxbrew to PATH and add some more environment variables to the current terminal.
We can just add the following exports to terminal (wait don't do it..):
export PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin${PATH+:$PATH}";
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew";
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar";
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew";
export MANPATH="/home/linuxbrew/.linuxbrew/share/man${MANPATH+:$MANPATH}:";
export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH:-}";
Or simply run (If your linuxbrew folder is on other location then /home - change the path):
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
(*) Because brew command is not yet identified by the current terminal (this is what we're solving right now) we'll have to specify the full path to the brew binary: /home/linuxbrew/.linuxbrew/bin/brew shellenv
Test this step by:
1 ) Run brew from current terminal to see if it identifies the command.
2 ) Run printenv and check if all environment variables were exported and that you see /home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin on PATH.
Step 5: Ensure step 4 is running on each terminal
We need to add step 4 to ~/.profile (in case of Debian/Ubuntu):
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >> ~/.profile
For CentOS/Fedora/Red Hat - replace ~/.profile with ~/.bash_profile.
Step 6: Ensure that ~/.profile or ~/.bash_profile are being executed when new terminal is opened
If you executed step 5 and failed to run brew from new terminal - add a test command like echo "Hi!" to ~/.profile or ~/.bash_profile.
If you don't see Hi! when you open a new terminal - go to the terminal preferences and ensure that the attribute of 'run command as login shell' is set.
Read more in here.
Why the installation script installs Homebrew to /home/linuxbrew/.linuxbrew - from here:
The installation script installs Homebrew to
/home/linuxbrew/.linuxbrew using sudo if possible and in your home
directory at ~/.linuxbrew otherwise. Homebrew does not use sudo
after installation. Using /home/linuxbrew/.linuxbrew allows the
use of more binary packages (bottles) than installing in your personal
home directory.
The prefix /home/linuxbrew/.linuxbrew was chosen so that users
without admin access can ask an admin to create a linuxbrew role
account and still benefit from precompiled binaries.
If you do not yourself have admin privileges, consider asking your
admin staff to create a linuxbrew role account for you with home
directory /home/linuxbrew.
Linux is now officially supported in brew - see the Homebrew 2.0.0 blog post. As shown on https://brew.sh, just copy/paste this into a command prompt:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Because all previous answers doesn't work for me for ubuntu 14.04
here what I did, if any one get the same problem:
git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew
PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$(brew --prefix)/share/man:$MANPATH"
export INFOPATH="$(brew --prefix)/share/info:$INFOPATH"
then
sudo apt-get install gawk
sudo yum install gawk
brew install hello
you can follow this link for more information.
October 2019 - Ubuntu 18.04 on WSL with oh-my-zsh;
the instructions here worked perfectly -
(first, install pre-requisites using sudo apt-get install build-essential curl file git)
finally create a ~/.zprofile with the following contents:
emulate sh -c '. ~/.profile'
Whta to do
cd /home/linuxbrew/.linuxbrew/bin
./brew doctor
You will get what path to export
echo 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >> ~/.zshrc

Problems installing Pycharm

I am trying to install pycharm on my linux OS.
following the instructions pycharm/dowload.
Since I run a linux machine I made sure the pychrarm files in the current directory:
ietX220:~$ ls
Desktop pycharm-community-4.0.1
Documents Music
pycharm-community- 4.0.1.tar.gz
Downloads New Folder Templates
Dropbox octave-workspace Videos
examples.desktop Pictures VirtualBox VMs
jdk1.8.0_25 Public Win7-PV2hh-6c3HY-
QJHM9-8RJJH-P86W8.iso
ietX220:~$ pycharm-*.tar.gz
pycharm-community-4.0.1.tar.gz: command not found
As you can see the pycharm file is in the current(home) directory but is not found.
Then I opened the tar file made pycharm.sh executable:
chmod +x pycharm.sh
And then ran:
~/pycharm-community-4.0.1/bin$ ./pycharm.sh
Startup Error: Application cannot start in headless mode
What am I doing wrong?
I am having the same issue. It looks like maybe you and I both have a minimal (headless) Java install on our systems. Use your system's method for finding installed packages and search for Java, and i'll bet you find only openjdk-headless
yum list installed | grep openjdk
# or on debian-based systems
# dpkg --get-selections | grep openjdk
# =>java-1.7.0-openjdk-headless
Solution then is to install the same package without the "-headless" suffix.
Here's where I am getting my information for the solution: https://bugzilla.redhat.com/show_bug.cgi?id=1177379
I had the same problem and as mentioned before the error was that openjdk was headless. What i did is i installed from the begining openjdk using the command apt-get install default-jdk (for ubuntu). I know it's not the best way to do it, however it is rather quick and simple.
If you have already all the prerequisites (such as Java) installed, try out charmy (PyCharm installer for Linux).
virtualenv charmy-env
source charmy-env/bin/activate
pip install charmy
charmy install
That will install PyCharm into your home directory. It will also simplify your feature PyCharm upgrades. To upgrade you would just have to type
charmy install
instead of downloading distribution manually, unpacking it, etc.
See https://pypi.python.org/pypi/charmy for more.
PYcharm is now available as a snap. Can be easily installed as below
sudo apt update && sudo apt install snapd
Then the community edition can be installed by
sudo snap install pycharm-community --classic
The classic escape is to get snaps that have been published with classic confinements
220:~$ pycharm-*.tar.gz
pycharm-community-4.0.1.tar.gz: command not found
gz files are not executable files. I think the current directory is not in your PATH variable. To get around that you would do "./pycharm-community-3.0.1.tar.gz" and you should see the message "Permission denied" as the gz file would not have execute permission. And if you gave it execute permission it would say "cannot execute binary file: Exec format error".
These are the instructions from the JetBrains website:
Copy the pycharm-*.tar.gz to the desired installation location
(make sure you have rw permissions for that directory)
Unpack the pycharm-*.tar.gz using the following command:
tar xfz pycharm-*.tar.gz
Remove the pycharm-*.tar.gz to save disk space (optional)
Run pycharm.sh from the bin subdirectory
NOTE: PyCharm on Linux doesn't need special installation or running
any installation script. It runs out of the pycharm-*.tar.gz
If you run the command "tar xfz pycharm-*.tar.gz" you should end up with a directory in your current directory named "pycharm-community-4.0.3".
If you cd pycharm-community-4.0.3/bin, "ls -al" should show that pycharm.sh is already executable. Run pycharm.sh and you should be done. The script will prompt for a password at the end so it can put a startup script in a system directory. You must have admin privileges for that part to work. But if you don't, you can still start PyCharm by executing "[path to pycharm directory]/bin/pycharm.sh &" at the command prompt.
I am not sure what the "NOTE:" is saying, but I would ignore it as you get a working PyCharm by doing what it says above the NOTE: .
Setup the newest stable jdk(like jdk1.7 or jdk 1.8) in your system, and set it is the default jdk.
1.download JDK8
2.SET JAVA HOME
sudo gedit /etc/environment
export JAVA_HOME=/home/username/Java/jdk1.8
export JRE_HOME=/home/username/Java/jdk1.8
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
sudo gedit /etc/profile
//before umask xxx adde
export JAVA_HOME=/home/username/Java/jdk1.8
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$JAVA_HOME/bin
3. run pycharm
./pycharm.sh

How do I remove/delete a virtualenv?

I created an environment with the following command: virtualenv venv --distribute
I cannot remove it with the following command: rmvirtualenv venv -
This is part of virtualenvwrapper as mentioned in answer below for virtualenvwrapper
I do an lson my current directory and I still see venv
The only way I can remove it seems to be: sudo rm -rf venv
Note that the environment is not active. I'm running Ubuntu 11.10. Any ideas? I've tried rebooting my system to no avail.
"The only way I can remove it seems to be: sudo rm -rf venv"
That's it! There is no command for deleting your virtual environment. Simply deactivate it and rid your application of its artifacts by recursively removing it.
Note that this is the same regardless of what kind of virtual environment you are using. virtualenv, venv, Anaconda environment, pyenv, pipenv are all based the same principle here.
Just to echo what #skytreader had previously commented, rmvirtualenv is a command provided by virtualenvwrapper, not virtualenv. Maybe you didn't have virtualenvwrapper installed?
See VirtualEnvWrapper Command Reference for more details.
Use rmvirtualenv
Remove an environment, in the $WORKON_HOME.
Syntax:
rmvirtualenv ENVNAME
You must use deactivate before removing the current environment.
$ rmvirtualenv my_env
Reference: http://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html
You can remove all the dependencies by recursively uninstalling all of them and then delete the venv.
Edit including Isaac Turner commentary
source venv/bin/activate
pip freeze > requirements.txt
pip uninstall -r requirements.txt -y
deactivate
rm -r venv/
If you are using pyenv, it is possible to delete your virtual environment:
$ pyenv virtualenv-delete <name>
Simply delete the virtual environment from the system:
rm -rf venv
(There's no special command for it)
from virtualenv's official document https://virtualenv.pypa.io/en/latest/user_guide.html
Removing an Environment
Removing a virtual environment is simply done by deactivating it and deleting the environment folder with all its contents:
(ENV)$ deactivate
$ rm -r /path/to/ENV
1. Remove the Python environment
There is no command to remove a virtualenv so you need to do that by hand, you will need to deactivate if you have it on and remove the folder:
deactivate
rm -rf <env path>
2. Create an env. with another Python version
When you create an environment the python uses the current version by default, so if you want another one you will need to specify at the moment you are creating it. To make and env. with Python 3.X called MyEnv just type:
python3.X -m venv MyEnv
Now to make with Python 2.X use virtualenv instead of venv:
python2.X -m virtualenv MyEnv
3. List all Python versions on my machine
If any of the previous lines of code didn't worked you probably don't have the specific version installed. First list all your versions with:
ls -ls /usr/bin/python*
If you didn't find it, install Python 3.X using apt-get:
sudo apt-get install python3.X
I used pyenv uninstall my_virt_env_name to delete the virual environment.
Note: I'm using pyenv-virtualenv installed through the install script.
The following command works for me.
rm -rf /path/to/virtualenv
If you are a Windows user and you are using conda to manage the environment in Anaconda prompt, you can do the following:
Make sure you deactivate the virtual environment or restart Anaconda Prompt. Use the following command to remove virtual environment:
$ conda env remove --name $MyEnvironmentName
Alternatively, you can go to the
C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\envs\MYENVIRONMENTNAME
(that's the default file path) and delete the folder manually.
Actually requires two deletions.
The project folder which everyone in this thread already said you simply delete manually or using rm -r projectfoldername
But then you also need to delete the actual virtualenv located in macOS /Users/edison/.pyenv/versions/3.8.0/envs/myspecialenv.
You can do that by doing pyenv virtualenv-delete myspecialenv or manual removal.
if you are windows user, then it's in C:\Users\your_user_name\Envs. You can delete it from there.
Also try in command prompt rmvirtualenv environment name.
I tried with command prompt so it said deleted but it was still existed. So i manually delete it.
cd \environmentfolder_name\Scripts\deactivate.bat
deactivate is the command you are looking for. Like what has already been said, there is no command for deleting your virtual environment. Simply deactivate it!
If you're a windows user, you can also delete the environment by going to: C:/Users/username/Anaconda3/envs Here you can see a list of virtual environment and delete the one that you no longer need.
If you are using pyenv virtualenv < https://github.com/pyenv/pyenv > to centrally manage python versions and virtual environment the solution would be
pyenv uninstall some_env
(Assuming that you have set up your bash .szh profile correctly.)
The solution to this issue is also answered here:
https://github.com/pyenv/pyenv-virtualenv/issues/17
Hope this helps 👍🏻
Just use Anaconda Navigator to remove selected env.
It is possible that some resources will be activated, making it impossible to just delete the directory. All Python processes should be stopped in advance:
pkill -9 python
rm -rf venv
You can follow these steps to remove all the files associated with virtualenv and then reinstall the virtualenv again and using it
cd {python virtualenv folder}
find {broken virtualenv}/ -type l ## to list out all the links
deactivate ## deactivate if virtualenv is active
find {broken virtualenv}/ -type l -delete ## to delete the broken links
virtualenv {broken virtualenv} --python=python3 ## recreate links to OS's python
workon {broken virtualenv} ## activate & workon the fixed virtualenv
pip3 install ... {other packages required for the project}
For the new versions do:
conda deactivate
conda env remove -n env_name
step 1: delete virtualenv virtualenvwrapper by copy and paste the following command below:
$ sudo pip uninstall virtualenv virtualenvwrapper
step 2: go to .bashrc and delete all virtualenv and virtualenvwrapper
open terminal:
$ sudo nano .bashrc
scroll down and you will see the code bellow then delete it.
# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
next, source the .bashrc:
$ source ~/.bashrc
FINAL steps: without terminal/shell go to /home and find .virtualenv (I forgot the name so if your find similar to .virtualenv or .venv just delete it. That will work.

Resources