Pip Environment: Cant access python interpreter

I just went through the Pip Environment Video. Everything went as the video intended except when entering the pipenv shell, followed by “python3”. Instead of entering the python interpreter, the windows store will open to the python 3.9 page and tell me to install python.

Python is already installed as shown in the Pipfile:
Pipfile:
[[source]]
url = “Simple index
verify_ssl = true
name = “pypi”

[packages]
numpy = “*”
requests = “==2.18.1”

[dev-packages]

[requires]
python_version = “3.8”

Python is also installed on my computer as anaconda.

Thanks
Sam

  • What is the output you get when typing “pipenv shell” followed by “python3”?
  • Which host environment are you using? Windows command line/powershell/git bash/WSL?

What is the output you get when typing “pipenv shell” followed by “python3”?
ANSWER:
C:\Users\user1\Desktop\python code\project_1>pipenv shell
Launching subshell in virtual environment…
Microsoft Windows [Version 10.0.19043.1110]
(c) Microsoft Corporation. All rights reserved.

(project_1-EV-_G0YX) C:\Users\user1\Desktop\python code\project_1>

Which host environment are you using? Windows command line/powershell/git bash/WSL?
ASNWER: Windows command prompt

After activating the pipenv shell, try running python - - version and if that does not return an error, python - m pip - V

These two commands just output your python and pip versions inside the virtual environment, but we are using them to test that python is functioning properly. If one of them doesn’t work, try doong the whole process in PowerShell and see if you get better luck.

My experience when using Windows was that command prompt (cmd.exe) has several issies running Python, but Powershell works better. The best option would actually be to install Git Bash, which Codecademy has a tutorial on how to do so, or if you are eligible, try upgrading to Windows 11, which integrates WSL into the Windows Terminal.

After activating the pipenv shell, try running python - - version
ANSWER: Python 3.8.8

and if that does not return an error, python - m pip - V
ASNWER: Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see “Managing environments — conda 4.10.3.post10+8bf56feb7 documentation

FURTHER:
So i went to that link and its says to not have installed conda with “Add Anaconda to my PATH environment variable.” checked, but the class says to have that checked so I am not sure if i should uninstall and re-install it.
It then says to activate to run “c:\Anaconda3\Scripts\activate base` in Anaconda Prompt.” But this script does not exist in my anaconda3 directory.

Maybe i should just uninstall anaconda and just install python as a standalone.

If you are planning to use pipenv, then it would be easiest to install Python on its own. You can install Python alongside your conda implementation on the same system, if you want to keep conda for jupyter and other data science work, and Python has some packages to help with that, and there’s a Medium article on doing it (which my work computer blocks for no reason).

An alternative, which is my preferred method, would be to uninstall Anaconda and have only Python 3.8 (or 3.9, your choice.), then get VSCode and install the Python extensions. The Python VSCode extension actually includes Jupyter as well, without needing Anaconda.

The advantage to Anaconda is having a large amount of useful packages already installed at once, but thats more of a convenience feature than anything since you can simply pip install any packages you need.

TL;DR your issues are related to using pipenv with conda. The best solution, imo, is to uninstall conda, install Python 3.8 on its own, then use VSCode with the Jupyter extension if you need it.