Python - Pipenv not display in the Python interpreter

720 views Asked by At

I installed and activated pipenv in my project folder, but then I couldnt see the Pipenv in the list of Python interpreter. This is the steps I did:

  • Create new project folder, cd to this folder.
  • Install pipenv: pip3 install pipenv
  • Activate it: pipenv shell
  • Then I check the Python interpreter, but the pipenv is not in the list.

Anyone know how to solve this? Thanks in advance!!! Im using Mac btw.

I cannot embed the screenshot to this post, so I attach the screenshot here.

1

1

There are 1 answers

0
Yenna On

Oh, I just figure the manual way to do it, sorry I am newbie so it may seems too simple for many of you haha, post here in case anyone needs it:

  1. After activating pipenv (using pipenv shell), you will notice there're few lines in terminal informing that virtual environment has been created successfully, something like this:
    ✔ Successfully created virtual environment!
    Virtualenv location: /Users/zoey/.local/share/virtualenvs/part_manager-GqnnAfaN
    Creating a Pipfile for this project...
    Launching subshell in virtual environment...
  2. Open the list of Interpreter using Command Shift P in macOS, select Python: Select Interpreter
  3. Select Enter interpreter path...
  4. Paste the virtual location path in step 1 and press Enter, for e.g. in my case it is /Users/zoey/.local/share/virtualenvs/part_manager-GqnnAfaN
  5. Done, the pipenv interpreter will be displayed accordingly in the bottom left of your Visual Studio Code.