0
votes

I have been using the following command line to instll prb package locally,

pip install -t /data/python3.4/site-packages/ /data/pythonlibs/pbr-2.0.0-py2.py3-none-any.whl

The process successfully. Afterwards, when I type import pbr, it still fails. What can be the possible reason for this failed installation process?

enter image description here

1
Your pip symlink points to 3.x interpreter. You are trying to use 2.x interpreter. 2.x and 3.x binaries are independent, you need to install package in correct interpreter before using it.Łukasz Rogalski

1 Answers

0
votes

You seem to not be accounting for Python 2.x and Python 3.x being entirely separate environments.

First, you are installing like this:

pip install -t /data/python3.4/site-packages/ /data/pythonlibs/pbr-2.0.0-py2.py3-none-any.whl

Unless you are currently inside a virtualenv, the pip command will generally be part of the Python 2.x environment. The Python 3 installer is usually pip3.

But you are telling this pip to install in /data/python3.4 - okay, perhaps that can work since you specified where to install.

However, you then run Python 2.6.6, and attempt to load the module which you clearly intended to install into Python 3.x.

You may simply need to run python3 instead of python for this to work.

If that does not do it, then install the module again using pip3 instead of pip and then see if it will work.