Can't Install `pip` for `python 3.3` but worke

2019-07-10 06:41发布

问题:

I'm new to python but not programming. My goal is to learn Django for web development.

I've been trying to install the later versions of python, pip and Django. I could install pip for python 2.7 just fine but now that I'm trying to install it on python 3, it gives me an error which I think is related to SSL certifications but not sure how to resolve it. My confusion is the fact that it worked fine once but doesn't happen again. I really appreciate the help.

My code is below:

~$> which python3
/Library/Frameworks/Python.framework/Versions/3.3/bin/python3
~$> which pip
/usr/local/bin/pip
~$> pip -V
pip 1.5.6 from /Library/Python/2.7/site-packages (python 2.7)
~$> sudo python3 /Applications/get-pip.py 
Downloading/unpacking pip
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /Users/Gemeni/.pip/pip.log
~$> 

I'm still very much stuck. I used a work around and installed pip...

easy_install pip==1.2.1

but the version is not 1.2.1 and I can't install anything else with pip now.

~$> pip install django

Downloading/unpacking django

Cannot fetch index base URL https://pypi.python.org/simple/

Could not find any downloads that satisfy the requirement django

Cleaning up...

No distributions at all found for django

Storing debug log for failure in /Users/Gemeni/.pip/pip.log

~$> pip --version

pip 1.5.6 from /Users/Gemeni/.virtualenvs/yara-project/lib/python3.3/site-packages (python 3.3)

Can someone please help me out to figure this out? I installed python3.4 at first but I saw that Django is not supporting it now. I comes with pip already installed. I read everywhere that it's a SSL issue and can be solved by modifying proxy setting but I'm not sure how it can be done. Any thoughts?

回答1:

pip is for python2
pip3 is for python3

Try to install the package python3-pip with your distro package manager, then use pip3 to install Django. Come back if you get any other problem

Like:

~#>apt-get install python3-pip
~$>pip3 install django