Paul
Paul

Reputation: 6737

Install venv for python3

I'm trying to create venv using python3 on Ubuntu 15.10. I have installed python 3.4.4. First, I tried to install venv via pip3 (I already installed it via python2.7 but as far as I understand, for py3 I should install it again)

pip3 install virtualenv

And I got The 'pip==8.0.0' distribution was not found and is required by the application error.

Next I tried to install pip3 with this command:

> sudo apt-get install python3-pip

and looks like it was successfully completed. But when I run

> pip3

I get following error:

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3130, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3116, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3143, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 644, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 657, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 830, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==8.0.0' distribution was not found and is required by the application

If I run

> pip --version
pip 8.1.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)

Am I doing something wrong? Does pip3 require only pip==8.0?

Upvotes: 2

Views: 5832

Answers (1)

Manas Marthi
Manas Marthi

Reputation: 121

Your pip is pointing to python 2.7

  usr/local/lib/python2.7/

first change path

  export PATH=/path/to/python3:/path/to/python3/scripts-folder:/path/to/python3-pip:$PATH

check path

  echo $PATH

then run pip or pip3

Upvotes: 1

Related Questions