0

I have Python 3.5 so I think pip is already installed on my system. The website says:

pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org, but you'll need to upgrade pip.

Now, I downloaded the get-pip.py and put it in C:\Program Files\Python 3.5. After that I ran the command:

C:\WINDOWS\system32>cd C:\Program Files\Python 3.5
C:\Program Files\Python 3.5>python get-pip.py

Here is a screenshot of my console:

enter image description here

So, I guess pip is working fine and the Django website recommends that I install virtualenv for which I ran the command pip install virtualenv but nothing has happened after that for about half an hour.

Am I missing something? Have I made a silly mistake? Please don't be rude about it as I am new to Python and Django.

EDIT: I am stuck at pip install virtualenv. Nothing happens after that.

UPDATE: I left out virtualenv and directly typed C:\Program Files\Python 3.5>pip install Django but it does not do anything either.

I have also used C:\WINDOWS\system32>setx PATH "%PATH%;C:\Program Files\Python 3.5\Scripts" to add the Path variable.

Should I uninstall Python and do a fresh install?

Thanks.

SanJeet Singh
  • 1,291
  • 2
  • 15
  • 28
  • Try pip3 and check http://stackoverflow.com/questions/24285508/how-to-use-pip-with-python-3-4-on-windows – dmitryro Jul 07 '16 at 03:56
  • @dmitryro on writing this command `python -m pip install -U pip`. It says `Requirement already up-to-date: pip in c:\program files\python 3.5\lib\site-packages`. What do I do now? – SanJeet Singh Jul 07 '16 at 04:03
  • Your pip is already there - as of version 3.4 it's a part of distribution, so you can run ***pip install --upgrade virtualenv*** - and if this fails - download from https://pypi.python.org/pypi/virtualenv , unpack and install from source. – dmitryro Jul 07 '16 at 04:10
  • Thanks. When I run `C:\Program Files\Python 3.5>pip install --upgrade virtualenv`. The cursor keeps blinking and nothing else happens. How long is it supposed to take? I feel bad about not being able to install it using pip. Is there no way to no why is it happening? – SanJeet Singh Jul 07 '16 at 04:15
  • I am pretty sure that python3 uses(packaged with it): `python3 -m venv myvenv` where myenv is the directory. I have to use `virtualenv` on 2.7. And yes, pip was already installed. try doing `pip freeze` to see all of your installed (external) packages – tenwest Jul 07 '16 at 04:20
  • @tenwest So, I am supposed to type `C:\Program Files\Python 3.5>python3 -m venv myvenv`? – SanJeet Singh Jul 07 '16 at 04:23
  • @tenwest I got `'python3' is not recognized as an internal or external command, operable program or batch file.` – SanJeet Singh Jul 07 '16 at 04:25
  • It's probably just python , not python3 as this is the only interpreter you have - so try installing it from https://pypi.python.org/pypi/virtualenv pip gets stuck as your local machine has some memory not sufficient to run virtualenv, so some cleanup might be helpful – dmitryro Jul 07 '16 at 04:46
  • @SanJeet Singh as dmitryro says, just use `python`...also, virtualenv is included as `venv` since python3.3. that may be why pip is having trouble. Rather than installing manually, I would use what's bundled, but thats me. see: http://stackoverflow.com/questions/12971443/is-python-package-virtualenv-necessary-when-i-use-python-3-3 – tenwest Jul 07 '16 at 04:49
  • Also see this http://stackoverflow.com/questions/4527958/python-virtualenv-questions – dmitryro Jul 07 '16 at 04:52
  • @dmitryro and tenwest I have updated the question to add more details. :) – SanJeet Singh Jul 07 '16 at 05:01
  • There's still an option of getting fresh ***setuptools*** from https://pypi.python.org/pypi/setuptools and once ***easy_install*** is set, try ***easy_intall virtualenv*** and see, if it still not moving on. As I mentioned, you can install ***virtualenv*** from source using ***setup.py*** and see what's going on during the instillation. There's no need to reinstall Python. – dmitryro Jul 07 '16 at 05:10
  • Try using pip install ... --verbose to get more verbose output. Also virtualenv now is a part of python and it doesn't work with 3.x, use python -m venv (maybe you should install it) – FeroxTL Jul 07 '16 at 07:10

1 Answers1

0

I think the problem is in unlinked pip command for Windows cmd. To resolve this issue on Linux, the most common way is to link executable from directory where it lives to /usr/bin by ln -s command.

I dont't know how to do this in Windows, but one simple way to run pip without linking is to run it directly in folder, where it's exe file exists. By default on Windows it should be in \path\to\python_directory\Scripts. So in your case command C:\Program Files\Python 3.5\Scripts\pip.exe install django should work.

Edit 1

And I see another issue here - as you have installed Python globally (in Program Files) - in order to install packages throug pip, you should run cmd as Administrator, otherwise you will get PermissionError

Compadre
  • 815
  • 1
  • 10
  • 18