0

I have installed the two python versions v2.7 and v3.7 on the same machine. I want to install the some packages for Python 3.7 when i am trying to install it installing for python2.7. Can any one help here how can i install the packages for python3.7.

Installed /usr/lib/python2.7/site-packages/configlib-2.0.4-py2.7.egg Processing dependencies for configlib==2.0.4 Searching for everett==0.9 Reading https://pypi.python.org/simple/everett/

[root@nodehost configlib-2.0.4]# /usr/local/lib/python3.7 setup.py install bash: /usr/local/lib/python3.7: Is a directory [root@nodehost configlib-2.0.4]#

1
  • python3.7 is a directory, is python inside it? Commented Dec 10, 2019 at 12:28

2 Answers 2

1

A more elegant solution is to create a separate environment for different python. Anaconda is the way to go. It is free and it installs many everyday libraries already.

Download and install the python 3.7 version. And then create a python 2 version is simple:

conda create -n py27 python=2.7 

Every time you need the 2.7, just

conda activate py27 

And then you can install libraries there just for 2.7, without messing up your 3.7. Vice versa for 3.7.

Sign up to request clarification or add additional context in comments.

Comments

0

You should be able to choose your Python version with the two following commands:

>> python --version Python 2.7 >> python3 --version Python 3.7 

If this works, just call pip like so:

>> python3 -m pip install everett 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.