Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Pipenv interpreter has already been added, select "Pipenv (<project>)"...'

Tags:

pycharm

pipenv

I had a Python project using Pipenv in PyCharm, which I have removed, and now when I try to create a new project at the same location, I get the following error:

Pipenv interpreter has already been added, select "Pipenv ()" in your in...

Unfortunately the error is truncated right in the middle so I cannot read the rest.

I presume pipenv pollutes the environment so there must be some rogue files/directories left around.

like image 451
Bora M. Alper Avatar asked May 30 '19 05:05

Bora M. Alper


1 Answers

  1. In CLI, cd to project directory, exit pipenv w/ 'exit' if necessary, and run pipenv --rm to remove virtualenv
  2. Back in PyCharm, hit 'Cancel' to return to 'Welcome to PyCharm' screen.
  3. Select 'Configure' dropdown.
  4. Select 'Settings'.
  5. Under 'Project Interpreter' section, to the right of 'Project Interpreter' dropdown, select gear icon.
  6. Select 'Show All...'.
  7. Select virtualenv from list. NOTE: In my case, virtualenv name is prepended with '[invalid]'.
  8. Hit '-' (Remove) button.
  9. Hit 'OK'.
  10. Hit 'OK' again from 'Settings for New Projects' screen. NOTE: In my case, this initially didn't fix and caused PyCharm to hang at splash screen on restart. A system restart cleared this up.
  11. Create project as initially attempted.
like image 50
user2540711yo Avatar answered Oct 03 '22 08:10

user2540711yo