Installing virtualenvwrapper on Windows
Asked Answered
W

7

39

I've installed virtualenv and virtualenvwrapper on Windows using easy_install. But mkvirtualenv is missing. I tried to search on my machine but I couldn't find it. I don't know how to solve it. Do you have any idea?

Wheels answered 11/4, 2010 at 3:42 Comment(4)
I guess it is not for Windows..Wheels
I've ported virtualenvwrapper to Powershell. Grab it from the BitBucket repo!Regulus
BitBucket repo URL has changed - it now lives at bitbucket.org/guillermooo/virtualenvwrapper-powershell (so annoying that BitBucket does not automatically redirect you, as GitHub does).Sollie
Heads up: virtualenvwrapper-powershell seems to install properly via pip, but I was not able to get it working by running it from source.Testerman
G
11

mkvirtualenv is a bash script so you need to run bash shell to make use of it.

mkvirtualenv is a bash function in the mkvirtualenv_bashrc script

You will need to run this from cygwin under Windows. (You can call a native python from this and not need a cygwin python)

Gerthagerti answered 11/4, 2010 at 8:42 Comment(5)
@SalmanPK Yes as this is to set the python environment up before you can use itGerthagerti
@Mark given you would typically pip install virtualenvwrapper the python env is already setup and usable.Mitchelmitchell
@Mitchelmitchell address that comment to the questioner I am just reporting on what mkvirtualenv does, see other answers on the Windows alternativeGerthagerti
@Mark I was just pointing out your premise of "this is to set the python environment" is not accurate. The global Python environment is already setup and therefore virtualenvwrapper could have written its scripts in Python and would be run using the global Python interpreter. For some reason they chose not to... I'm guessing just because the kind of file operations they do are just easier to code in bash and none of them used Windows.Mitchelmitchell
@Enophage - no they could not write it in Python for a bash shell. mkvirtualenv modifies the current shell - if in python you would have to create a new shell to see the environment.Gerthagerti
G
68

virtualenv helpers for Windows command shell:

Gambit answered 30/4, 2011 at 21:36 Comment(1)
seems to fail in git-bashAnte
R
14

I've ported virtualenvwrapper to Powershell. Grab it from the BitBucket repo!

Regulus answered 9/5, 2010 at 18:13 Comment(1)
The link seems to be outdated. Would you be able to update it? Also, is it compatible with Powershell v7? The pip version does not seem to beJokjakarta
G
11

mkvirtualenv is a bash script so you need to run bash shell to make use of it.

mkvirtualenv is a bash function in the mkvirtualenv_bashrc script

You will need to run this from cygwin under Windows. (You can call a native python from this and not need a cygwin python)

Gerthagerti answered 11/4, 2010 at 8:42 Comment(5)
@SalmanPK Yes as this is to set the python environment up before you can use itGerthagerti
@Mark given you would typically pip install virtualenvwrapper the python env is already setup and usable.Mitchelmitchell
@Mitchelmitchell address that comment to the questioner I am just reporting on what mkvirtualenv does, see other answers on the Windows alternativeGerthagerti
@Mark I was just pointing out your premise of "this is to set the python environment" is not accurate. The global Python environment is already setup and therefore virtualenvwrapper could have written its scripts in Python and would be run using the global Python interpreter. For some reason they chose not to... I'm guessing just because the kind of file operations they do are just easier to code in bash and none of them used Windows.Mitchelmitchell
@Enophage - no they could not write it in Python for a bash shell. mkvirtualenv modifies the current shell - if in python you would have to create a new shell to see the environment.Gerthagerti
G
6

virtualenvwrapper is for Linux/Unix, but this post gives some virtualenv support for Windows users (Bitbucket source is here).

Gwyn answered 12/4, 2010 at 10:24 Comment(2)
That link is dead :( In the future, please copy/paste the appropriate info into your comment in case of something like this.Bovid
Looks like you can still access it through the Wayback Machine: web.archive.org/web/20090921091355/http://justindriscoll.us:80/…Throughway
E
5

In windows we need to use virtualenv not mkvirtualenv while creating virtual environments

Emmittemmons answered 30/3, 2018 at 12:12 Comment(0)
A
1

What worked for me (speaking in 2021) is the following:

  1. Clone the virtualenvwrapper-powershell git repo
  2. Navigate to the folder "virtualenvwrapper-powershell"
  3. Open PowerShell there, if you haven't navigated there via PowerShell itself, and execute the command ./Install.ps1
  4. Restart PowerShell and that's it: you should see a success message like "Virtual Env Wrapper for Powershell activated"
Aegospotami answered 15/4, 2021 at 8:30 Comment(0)
G
0

Cloning the virtualenvwrapper-powershell from git repo and building it, worked for me

Granado answered 8/11, 2023 at 19:58 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Nahshon

© 2022 - 2024 — McMap. All rights reserved.