pip won't execute from Windows command line - python

I have pip.exe in the Python27 directory I'm trying to check if it is installed well by giving the command:
C:\Python27>pip
Every time I do so I get the following error message:
Fatal error in launcher: Unable to create a process using `"C:\Python34\python.exe" "C:\Python27\pip.exe" `
I have changed the PATH in the environment variables so there is NO mention of Python34.
Why won’t it show pip is installed? Thanks for help.
I have followed advice about changing the PATH by editing the environment variables etc... For some reason it always tries to follow a path via Python34 which is not there! Is that why it gives the error?
I can get Python to execute with the same approach but never pip.
I want to install Django.

Related

Having trouble creating a virtualenv in Visual Studio

This might be a very basic problem but I can't seem to be able to install and name a virtualenv in VisualStudio.
Once I open up the terminal I enter
pip3 install virtualenv.
It then says it's been successfully installed but when I enter virtualenv env
it shows an error in the terminal stating The term 'virtualenv' 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.
So far I have tried uninstalling and installing the virtualenv but that hasn't seemed to work. I suspect that it might be an issue of the path but I'm not sure how to solve it. I have been trying to follow the first 5 minutes of this flask tutorial:https://www.youtube.com/watch?v=Z1RJmh_OqeA
Try running python3.9 -m virtualenv env. The error you are getting is because of issues with your path. (You can fix them but it's not mandatory, google "add python virtualenv to path" if you want)

Python Pip Install: The filename, directory name, or volume label syntax is incorrect

I am using Anaconda Spyder and whenever I need to install a new package I just type pip install and then the name of the package in the console. However, when I tried installing a new package today I receive the error:
The filename, directory name, or volume label syntax is incorrect.
I don't believe I've changed any of my settings. The directory is the same directory I always use. I also tried in Jupyter notebooks and receive the same error. Tried googling the error and while I see it is a common error, nobody seems to be getting it while trying to pip install.
Not sure where to begin researching this error, does anyone have any solutions?
Not sure which OS are you trying on but could be issue with your PATH settings. Pls ensure you have valid directory path for your python directory. Can you pls provide more info about pip version and python version you are using

"Fatal error in launcher: unable to create process with c:\pythonXX\python.exe" when launching jupyter after python re-install

I had by error installed python twice (3.8 via Windows Store and 3.9 via python installer) on a Win10 machine and after removing both of them and reinstalling 3.9, Python works fine but jupyter (installed with pip) keeps returning the fatal error: Fatal error in launcher: Unable to create process using '"c:\pythonXX\python.exe" "C:\Users\xx\AppData\Roaming\Python\PythonXX\Scripts\jupyter.exe" ': Le fichier spÚcifiÚ est introuvable.
(specified file not found in french)
I tried to specify the path to the python.exe in the kernel.json but no luck.
The folder c:\pythonXX\ doesn't exist, but I check the PATH and there's no mention of this folder.
Does someone have an idea of how to correct it ? Or should I make a clean and full uninstall of Python again ?
Thanks in advance
After some searching on the jupyter/notebook github issues, I found a correction/workaround:in my PATH environment variable, I had duplicate folders pointing to PythonXX and PythonXX/Scripts folders.
I kept the set corresponding to "where python" was, and forced the re-install of jupyter.
pip install jupyter --force-reinstall
and I was then able to launch jupyter without the error.

Installing Python packages through pip?

I am trying to install the python package pyperclip.
I've been trying to do this for a while now, but it's simply not working. Here is what I've tried (from other answers on the internet):
Opened Windows Powershell, changed the directory to where I installed Python. The location of the file is below:
C:\Users\Jamie\AppData\Local\Programs\Python\Python37\Scripts
Entered the command pip install pyperclip. I get the following error message:
pip : The term 'pip' 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 also get the following suggestion from Powershell:
Suggestion [3,General]: The command pip was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\pip". See "get-help about_Command_Precedence" for more details.
Entered the command python -m pip install pyperclip. Here, nothing happens. I get no error message but I still can't import the package in Python IDLE.
I don't know what else to do? Any help is appreciated.
SOLVED: I ran the same command on cmd instead of PowerShell and it worked. Not sure why, though.

How to install packages with pip in Windows PowerShell

I am using Python 2.7.9 on a Windows 8 computer.
I tried to install lxml by typing pip install lxmlin Windows PowerShell after typing python, but I get the following error: SyntaxError: invalid syntax
I tried installing pip by using the following tutorial http://www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/ only to later realize that I already had pip.exe, pip2.7.exe and pip2.exe installed when I first installed Python. They are located in the C:\Python27\Scripts directory.
Yet, if I try something like pip help I will get an invalid syntax error.
Do I have to reinstall pip or how do I get it to work in order to install the lxml library.
Thank you for any help you can provide.
I had the same problem. You need to set the PATH environment variable, so that the system recognizes the command "pip".
If typing easy_install or pip [in PowerShell] doesn’t work, it means the Scripts folder is not in your path. Run the next command in that case (Note that this command must be run only once or your PATH will get longer and longer). Make sure to replace c:\Python33\Scripts with the correct location of your Python installation:
setx PATH "%PATH%;C:\Python33\Scripts"
Close and reopen PowerShell after running this command.
Source: http://arunrocks.com/guide-to-install-python-or-pip-on-windows/
Starting from Python versions 2.7.9 and 3.4.0, 'pip' is already included in the regular install. Check if the path to the 'Scripts' directory inside your Python installation directory is contained in your system's 'PATH' environment variable, so 'pip' can be found.
Look here for more information:
How do I install pip on Windows?
Edit: Sounds like you are trying to run pip inside python, You shouldn't get an 'invalid syntax' error through the command prompt. More like "'pip' is not recognized". Try simply just opening command prompt and typing 'pip help'

Categories

Resources