Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

windows cmd not showing python virtualenvwrapper in front of the command

I'm try to use "virtualenvwrapper-win" to build django project on my windows 10 pc. I think i setup it correctly, and it seems work fine. but I can't see what virtual environment am i using right now. it doesn't show in front of the command line. But on my laptop, i can see it correctly.

C:\Users\User>workon

Pass a name to activate one of the following virtualenvs:
==============================================================================

C:\Users\User>mkvirtualenv my_django
created virtual environment CPython3Windows(dest=C:\Users\User\Envs\my_django, clear=False, global=False) with seeder FromAppData pip=latest setuptools=latest wheel=latest app_data_dir=C:\Users\User\AppData\Local\pypa\virtualenv\seed-v1 via=copy

C:\Users\User>workon

Pass a name to activate one of the following virtualenvs:
==============================================================================
my_django

C:\Users\User>workon my_django
C:\Users\User>cdvirtualenv
C:\Users\User\Envs\my_django>

Above is the command line on my pc. I think i activate virtual environment correctly, but it didn't show what environment in the front. like below:

(my_django) C:\Users\User>
like image 390
Hansen Avatar asked Feb 12 '20 01:02

Hansen


2 Answers

It is because of the new version 20.0.1 which doesn't show that, don't know whether its bug or not,the activate command does activate it, but it no visible. Solution, uninstall and install last stable release

pip install virtualenv==16.7.9
like image 55
Ajay Tom George Avatar answered Sep 23 '22 01:09

Ajay Tom George


use the --prompt command line option.

eg.

virtualenv newenvironmentname --prompt "(newenvironmentname)"  

or be even more clever...

virtualenv newenvironmentname --prompt "(here's the new environment)"  
like image 33
Benjamin Schollnick Avatar answered Sep 25 '22 01:09

Benjamin Schollnick