简体   繁体   中英

How to make pipenv install virtual environment in project folder on Windows 10

I want to fully understand how pipenv works. I created my project and would like virtual environment also be in same project folder. However pipenv installs virtual environment in C:\Users\username\.virtualenvs .

在此处输入图像描述

With that, if I change the name or location of my project path, the virtual environment will be lost.

So how can I install virtual environment inside project folder? I read about setting variable PIPENV_VENV_IN_PROJECT but I did not understand where and how should I do that using Powershell in windows.

Can somebody advise?

Create a.venv folder in your project root. Then run:

pipenv shell

Obviously run that from a terminal session in your project root. Pipenv should check to see if there is an empty.venv and if it finds one it should blow your virtual environment into that.

You should add PIPENV_VENV_IN_PROJECT=1 to the Windows 10 User variable

Check out this for step by step process link where I mentioned the process with images

if you can't open: https://gist.github.com/Saketh-Chandra/28ac93aca0afb8a627ef66edaf575b0d

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM