0

I have both python 2.7 and 3.5 installed(3.5 is the default one), and I am using pycharm as IDE. I am having hard time to install packages for 2.7 because it isn't the default environment. When I use pip install, it always installs package for 3.5. If I use pycharm package manager, I don't know how to install custom packages that is not in the repo.

My question is: When I have 2 version of python installed, how do I install packages only for one environment or the other, and how do I install packages for both environment?

Thanks

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • This is what [`pip`](https://pip.pypa.io) is for. – MattDMo May 05 '16 at 17:51
  • Can you give a syntax for installing a package for python 2.7 and a syntax for installing a package for python 3.5? I couldn't figure it out. I always do pip install package. – hong pan May 06 '16 at 03:06
  • Use `pip2` for Py2 and `pip3` for Py3. Easy. – MattDMo May 06 '16 at 03:07
  • I tried pip2 and pip3. They aren't recognized as valid command. Do I need to set anything up for pip? – hong pan May 07 '16 at 05:19
  • What operating system are you running? What is the output of `pip -V`? Also, what is the output of `python -V` and `python3 -V`? – MattDMo May 07 '16 at 12:18
  • 1. windows 7 2. pip -V = pip 8.1.1 from C:\Anaconda3\lib\site-packages (python 3.5) 3. python -V = Python 3.5.1 :: Anaconda 4.0.0 (64-bit) 4. python3 -V = 'python3' is not recognized as an internal or external command, 5. python2 -V = 'python2' is not recognized as an internal or external command thanks for the help – hong pan May 09 '16 at 04:36

0 Answers0