Can't make pipenv work in cmd


and also tried it with anaconda prompt :

Hello there, i’m currently on the tutorial to install pipenv which you can find with this link : https://www.codecademy.com/courses/learn-python-3/videos/learn-python3-pipenv?action=resume_content_item

Everything worked more or less close to the video until the 11:30 mn mark, where the pipenv command still doesn’t respond
(I’ve copy/pasted the path to user (and also general, for what it’s worth))
I’ve tried to solve this with some other youtube tutorials but it’s almost worse after those

Any clue of how i could solve this? I’m pretty sure this will be needed for the reste of the Python course.
Thanks !

Edit : Sorry, french version of cmd, the last line after the pipenv --version said that the command isn’t recognized as internal or external blablabla

3 Likes

Looks like the location of pipenv is not in your PATH environment variable.

Take a look here.

You should add your python/miniconda paths here. After doing that, the command should be recognized.

3 Likes

Hey @illian00

pipenv might be missing from the PATH, as mentioned in the pipenv docs here.

:slight_smile:

Edit: Ha, @barelyhere you beat me to it! :slight_smile:

3 Likes

This ?

I’ve already tried it into user or system, no results for both

1 Like

If you open a regular command prompt and type:

python -m site --user-site

you should get something like:

C:\Users\yourusername\AppData\Roaming\Python\Python37\site-packages

If that’s what you get, replace “yourusername” with your username on that PC, and replace “site-packages” with “Scripts” as you’re running on Windows. Then, add that to the user PATH. pipenv should work then… though you may need to log out and back in to your PC.

2 Likes

Okay, so this raised a new issue \o/

Did what you’ve told, it was indeed the same answer from the command python -m site --user-site
So after that, I pasted C:\Users\guillaume\AppData\Roaming\Python\Python37\Scripts to the user PATH.
Since i didn’t change anything with the command prompt, i restarted my computer, and the new path was erased from the list
Tried to only disconnect/reconnect from my session, same issue.


This is what I was supposed to do right ?

What’s the output of this?

echo %PATH%

and this?

C:\Users\guillaume\AppData\Roaming\Python\Python37\Scripts\pipenv

or maybe

C:\Users\guillaume\AppData\Roaming\Python\Python37\Scripts\pipenv.exe

Or whatever the name is.

If you visit that directory, is there a file there named pipenv?


In other words, does that file exist in that location, and is that location in your PATH?

3 Likes

For echo %PATH% (no reboot since edit of path with previous answer) :

For C:\Users\guillaume\AppData\Roaming\Python\Python37\Scripts\pipenv and C:\Users\guillaume\AppData\Roaming\Python\Python37\Scripts\pipenv.exe
Same answer :


(Uploaded only the first one since they’re both similar)

Also, when i first tried the C:\Users\guillaume\AppData\Roaming\Python\Python37\Scripts\pipenv it opened another command prompt window for a brief moment where i could read some errors in red, then it shut itself quickly before i could screen it.

Edit : Also, still no answer from pipenv --version
Edit2: At least i know understead a little how path work, (or here doesn’t, for some reasons)
Here is kind of a workaround i guess :

So the program is installed, but you haven’t added the path. You said something about it being erased, absolutely no clue what you mean by that. Surely, windows should either refuse to let you modify PATH, or otherwise leave the modification in place.

Entering the full (or relative) path is the alternative to having the directory in PATH, yes. Python is also aware of that location, so you can likely also run it as:

python -m pipenv

3 Likes

Oh and another alternative may be to create a link in a location that IS in your path, to pipenv. That’s a bit inappropriate but I mean… You can.

Uh. Assuming windows even supports symlinks. The kind of links you use on your desktop are text files, I think, idk if those “work” … whatever. don’t care. >_<

3 Likes

Well, i have no clue why, but after this reboot (it was like, the 4th), instead of erasing C:\Users\guillaume\AppData\Roaming\Python\Python37\Scripts it erased the previous similar PATH to python3.7

First screenshot before the reboot :


Second after the reboot :

Well, now pipenv --version work, and i kinda of understand why, but i don’t know if i messed up with other paths for the future :sweat_smile: and also i don’t really get what happened with the path-erasing thingy

2 Likes