How to create a new project that uses an existing venv?
已回答
I want my new project to use an existing venv, but can't see a way to do this with PyCharm. I create a new venv with the project, point the project at the existing venv, then delete the new one.
Is there any way to streamline this?
请先登录再写评论。
You should be able to select an existing environment, just make sure to select the full path on the folder button for “Browse…”
Thanks for the suggestion, but I don't see how to get your screenshot in the initial create project dialog.
Playing with the other "Interpreter type" options was the solution.
tl:dr: use the “Custom Environment” option in the New Project dialog.
A little background: For my “play” projects, I typically don't make a Git repo, but host the projects on Google Drive so I have cloud backup. I'm retired, so even for my “real” projects, I don't commit and push very often - again depending on Google Drive for backup.
I recently decided to dig into an issue where projects using requests would appear to delay 15 seconds before executing. Turns out it's the requests import that was taking 15 seconds. Hosting the project directly on the C: drive solved the problem, so I created the all purpose project on the C: drive and use its venv for play projects on GD.
For “real” projects it's a similar process, this time selecting “Generate new” and using a path on the C: drive.
Create new project using existing venv:
Create new project with new venv on separate drive: