Pipenv: Won't Install [duplicate] - windows-10

This question already has answers here:
pipenv is not recognized on powershell
(4 answers)
Closed 2 years ago.
I am trying to learn Django and I am following a websites instructions to install pipenv. I am using the Windows PowerShell, and every time I try to use a pipenv command such as pipenv shell or anything else, it says "The term 'pipenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if the path was included, verify that the path of correct and try again." I have pip and pipenv both installed and the file path of pipenv is C:\Users\Me\AppData\Roaming\Python\Python39\site-packages. I cannot figure out how to make things work. I might be glancing over some things, but I tried uninstalling python, reinstalling, make sure the PATH is included, and nothing I can do seems to work. Any help or suggestions is appreciated.

Go to command prompt, type "pip install pipenv".
That should be the end of it.

Related

Python 3.10 virtualenv error: "Unable to create process using [PATH of python.exe]"

Mi problem happens after I activate my virtualenv, because when I type commands like "py", "python" or "pip" on the cmd, the error in the title occurs:
Unable to create process using 'C:\Users\user\AppData\Local\Programs\Python\Python310\python.exe'
Everything is updated globally, and both pip and python 3.10 are in the system's PATH. I've already tried reinstalling python but nothing changes. Also, when I type python commands outside my virtualenv they work just fine.
Any idea of what could be happening? Sorry if this is a repeated question but I've already tried a lot of different things.

Cant Install pipx or Brownie for Python

I am very new with coding and was following along with these youtube videos and quickly realized something wasn't right, so I did some trouble shooting and couldn't figure it out.
When I tried to download pipx on VS Code I get this error
Python3 : The term 'Python3' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
I changed my environment variables, changed app execution aliases, and still nothing
I figured I'd check to see if python was working through VS Code and I get the same error
I tried downloading python through Microsoft store to see if that would help but nope.
Not sure what to do
I was having the same issue for a while even though I added the following directory to the environment variable and system variable. C:\Users\username\AppData\Roaming\Python\Python310\site-packages\pipx
What worked for me was adding the following directory to the environment variable and system variable. (c:\users\username.local\bin)
The directory (c:\users\username.local\bin) will be used to create the virtual environments.
I also found this when typing (python -m pipx ensurepath) which returned:
C:\Users\username\.local\bin has been been added to PATH, but you need to open a new terminal or re-login for this PATH change
to take effect.
C:\Users\username\AppData\Roaming\Python\Python310\Scripts has been been added to PATH, but you need to open a new terminal or
re-login for this PATH change to take effect.
The (C:\Users\username.local\bin) path was the only thing I did not manually enter into my environment variable and system variable, so thought I should give that a try and it worked.

Used pip for pyinstaller but pyinstaller still not recognized

Although I have used pip to get pyinstaller without any errors, command prompt tells me "'pyinstaller' is not recognized as an internal or external command, operable program or batch file." I also do not see any files named "pyinstaller" in my Scripts folder.
PATH seems to point to the right place. I can pip other packages successfully.
I have found the script. I located it by looking in the paths mentioned when I used pip. Then I had to place it in my already working PATH (which is just my Scripts folder in Python), and rename it to just "pyinstaller"

Python Virtualemv

I want to setup virtualemv in python in windows 10 but I am unable to do that I don't know why because I am a beginner. I already install get-pip.py in my python/tools/scripts folder and after that, I have also upgraded my virtualemv.
But problem is that when I want to run this command I am getting error C:\Users\Ravi\Documents\Python\my_virtual_emv>virtualemv emv --no-site-packages
'virtualemv' is not recognized as an internal or external command,
operable program or batch file.
please help me with that
I think it may be a mistake, spelling virtualenv not virtualemv

what happens when you call a program from the terminal?

meaning. I call a program. Example 'pip' (since I am having trouble with pip) and what does the Linux system do to find that program?
I'm having trouble with a pip installation and im trying to understand what happens under the hood when I type pip or any program into the terminal and press enter.
My hope is this allows me to fix the issue.
if you wish to know what issue I am having it is ImportError: No module named 'pip'
Linux will search for all available directories listed in the environmental variable PATH, and if it find pip from any path, it will try to execute it. And then in case the file pip has executable permission for the user, system will execute the command.
In general the shell searches through the directories listed in the PATH variable to find a file with the name you typed in. If you want to find out which file the shell is actually trying to run, on a unix-like system (read not windows), run which pip. I believe the windows equivalent is where pip, but don't quote me on that.
The specific error you are encountering, however appears to be the result of python being run something like python -m pip which means Python, please run the module named pip. Given that some file exists named pip on your system that tries to run pip, I am guessing one of two things is happening.
Either you have deleted some of the files somehow, in which case you should attempt to reinstall pip
Or you have changed which python is the default python, and you don't have a pip module in the python you are using now.
To test the last theory, try running which python and if there is a 2 in the path, then run python3 -m pip to see if the pythons got mixed up. Conversely if your are on a system that uses python3 by default, you will see a 3 in the result of the above command, and you can try python2 -m pip.
Hope that helps clear up the mess that is Python versioning.

Resources