Hi friends, I am taking Complete Python Mastery course and stuck at
10-Python Package Index —> 5-Virtual Environments in VScode —> about 2:01 minutes into the video
The part of video talking about changing the Python path. But I think Mosh did it on Mac. Anyone know how to do it in Windows?
I changed Default Interpreter Path to the virtual environment path but it doesn’t work in code runner. I was able to run the code in Terminal.
I found where to change it just now.
File → Preference → Settings → Extensions → Run Code configurations → Executor Map → Edit in settings.json
change “python”: “python-u” to below
I am stuck on this module as well. I have taken a break and come back to it and this is what is happening now when I try to install pipenv
(base) Salmas-Air:hello world salmamalik$ pipenv install requests
Creating a virtualenv for this project…
Pipfile: /Users/salmamalik/Desktop/hello world/Pipfile
Using /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 (3.9.0) to create virtualenv…
⠙ Creating virtual environment…
✘ Failed creating virtual environment
[pipenv.exceptions.VirtualenvCreationException]: Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py”, line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py”, line 147, in _get_module_details
return _get_module_details(pkg_main_name, error)
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py”, line 111, in _get_module_details
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/virtualenv/init.py”, line 3, in
from .run import cli_run, session_via_cli
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/virtualenv/run/init.py”, line 7, in
from …app_data import make_app_data
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/virtualenv/app_data/init.py”, line 11, in
from .na import AppDataDisabled
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/virtualenv/app_data/na.py”, line 5, in
from .base import AppData, ContentStore
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/virtualenv/app_data/base.py”, line 11, in
from virtualenv.info import IS_ZIPAPP
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/virtualenv/info.py”, line 5, in
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/platform.py”, line 119, in
File “/Users/salmamalik/Desktop/hello world/subprocess.py”, line 4
completed = subprocess.run([“false”],
IndentationError: expected an indented block
Failed to create virtual environment.
I am super new to Python and VSCode. Wish I could help.
I would delete everything created and watch the video again and redo the whole process.(That’s what I did) I found all the answers in the video actually. Pay attention to what he said. He did everything in mac but he tells you where need to be changed so look for the thing even if you are using windows and it looks different. Thanks
is it ok if we use pycharm instead of VsCode? I am used to with pycharm