24
votes

Python2.6 was installed by default in my old centos server. Now I want to create a Python3 environment to install python3 specific module by conda

conda create -n py3 python=3.5.3
source activate py3

After activate the py3, I try to install hovercraft by pip3 install hovercraft, the shell tells "command not found: pip3". At first I thought pip3 was installed with Python3, but the result was not the case.
So I think I can install it manually. The package gzip file was downloaded from python package index, and install by conda install --file hovercraft-2.3.tar.gz. But it doesn't work.
Now I have two problems:

  1. how to install pip3 for virtual-env create by conda?
  2. Is it possible to install python package index downloaded package locally in conda?
1
Does just plain pip work after activating the virtualenv? - wmorrell
Hi, @wmorrell, plain pip is ok. pip --version show "pip 9.0.1 from /export/home/user01/envs/py3/lib/python3.5/site-packages (python 3.5)". The message indicate this pip is pip3 for python3.5? - l0o0
Yep, the virtualenv will add items to your shell PATH where both python and pip point to the correct 3.5.3 versions, and pip will install to your py3 environment as long as it is active. - wmorrell
@wmorrell, thank you for your help. - l0o0

1 Answers

42
votes

pip3 and pip would make a difference only when you are not using any environment managers like virualenv (or) conda. Now as you are creating a conda environment which has python==3.x, pip would be equivalent to pip3.