24

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?
l0o0
  • 773
  • 1
  • 9
  • 26
  • 1
    Does just plain `pip` work after activating the virtualenv? – wmorrell Jun 05 '17 at 05:31
  • 1
    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 Jun 05 '17 at 05:34
  • 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 Jun 05 '17 at 05:38

1 Answers1

43

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.

yottabytt
  • 2,280
  • 1
  • 18
  • 14
  • 9
    this isn't true in some cases. For some libraries (like malmo https://github.com/Microsoft/malmo) the wheel requires a pip3 command – physincubus Oct 21 '19 at 04:22
  • 1
    When a Conda env is created it's pip version looks as: `pip conda-forge/noarch::pip-20.0.2-py_2` is this pip3? – sAguinaga Mar 19 '20 at 10:19