I want to start my first Django project using python in VSCode. I've gathered that I need to create a virtual environment, and I'm trying to use pipenv for this. I've installed Pipenv correctly, but when I run "pipenv shell" it gives me an error, syntax error: "invalid syntax". Why is this happening? How can I solve it?
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (12)
Ensure you choose the right pip environment (if you are having multiple versions of python running on your system) at the time of installing pipenv.
Run
pipenv --help
to see if pipenv is working otherwise.PS: giving the entire snip of the error that you are getting from the terminal prompt would be helpful.
I've recently re-installed python, and deleted the old versions I had.
When running 'pipenv --help' I get
'''
NameError Traceback (most recent call last)
in
----> 1 help(pip)
NameError: name 'pip' is not defined
'''
It's better to launch it through Python itself, aka run
python3 -m pipenv install
andpython3 -m pipenv shell
:)Fixed it. Thank you for the help👌
What fixed the issue?
Beginner mistake. Installing python via Anaconda is not the same as installing python. I just installed python independently😅
Ah ok !
You might want to use Poetry instead.
Does Poetry work the same?
Have you created the virtual environment using something like 'python -m venv .venv' ?
No I haven't. Should I?
It's using python3
venv
package, which is used by pipenv :)The command creates the virtualenv, and then you need to activate it with
. .venv/bon/activate