Virtualenv - workon command not found
So far it was working fine but I restarted the shell
The reason is because you restarted the shell.
If you want this to work with each shell, you'll need to add these to your ~/.bashrc
file:
export WORKON_HOME=~/.virtualenvs
VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3'
source /usr/local/bin/virtualenvwrapper.sh
After adding this, you'll want to source ~/.bashrc
so the changes take effect. You'll find that you have access to virtualenvwrapper
facilities in each new shell.
virtualenvwrapper Command '' not found, but can be installed with
Add these two lines in your .bashrc file
export VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3'
source /usr/local/bin/virtualenvwrapper.sh
Make sure to put them in this order exactly.
The first line means that virtualenvwrapper will use python 3.
You have to replace '/usr/bin/python3'
with your python path. You can find it by typing which python
why virtualenv workon' not work but activate can
You are using it in powershell terminal in vscode try to create command prompt terminal
in vscode and then you can able to use **workon newhouse**
command.
Since workon
is a batch script.
Try to run workon
in cmd.
If you want to run it on powershell then i would recommend this stackoverflow question
[https://stackoverflow.com/a/38945456/14213012]
Virtual Environment Setup in Visual Studio Code -- Workon command
I use the following method to use the command "workon" in the terminal of VS Code, and you could refer to it:
Install the module. (
pip install virtualenvwrapper-win
)Create a "virtualenv" environment. (
mkvirtualenv name
)If you use the new environment created, please install "virtualenv" or "virtualenvwrapper-win" in it.
Use the "workon" command. (
workon name
)
Please use a terminal other than powershell in VS Code, because it does not activate the environment by default.
In addition, if you want to manage and use a virtual environment, it is very convenient to use python commands. (It is created without installing modules, and the created virtual environment exists in the project and displayed in the project structure.) You could refer to this docs: virtual environments in VS Code.
Related Topics
How to Convert Yyyymmddhhmmss to a Date Readable by 'Date'
Remove a Symlink to a Directory
How to Get the Start Time of a Long-Running Linux Process
How to Automatically Add User Account and Password with a Bash Script
How to Monitor the Thread Count of a Process on Linux
How to Use Xargs to Copy Files That Have Spaces and Quotes in Their Names
Optimize PDF Files (With Ghostscript or Other)
Centos 64 Bit Bad Elf Interpreter
Git Status Ignore Line Endings/Identical Files/Windows & Linux Environment/Dropbox/Meld
How to Use Arrow Keys Alone to Expand Tree Node in Package Explorer in Eclipse on Linux
Create Zip File and Ignore Directory Structure
/Usr/Bin/Ld: Cannot Find -Llapack
What Are the Real Rules for Linux Usernames on Centos 6 and Rhel 6
Extracting Columns from Text File with Different Delimiters in Linux
Gcloud Compute Copy-Files': Permission Denied When Copying Files
How Does Pthread Implemented in Linux Kernel 3.2
How to Force Abort on "Glibc Detected *** Free(): Invalid Pointer"