LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   CentOS 7 w/KDE - Trying to get AWS CLI & Terraform installed (https://www.linuxquestions.org/questions/linux-newbie-8/centos-7-w-kde-trying-to-get-aws-cli-and-terraform-installed-4175602124/)

buymycorp 03-19-2017 11:41 AM

CentOS 7 w/KDE - Trying to get AWS CLI & Terraform installed
 
I just installed a new CentOS 7 w/KDE (I think I like Gnome better - but I digress) VM inside VMware Fusion 8.5.5.
I'm trying to follow these instructions: http://docs.aws.amazon.com/cli/lates...all-linux.html
You'd think that'd be easy. But I needed to look elsewhere for more detailed instructions in how to install Python-3.6.0:
http://www.tecmint.com/install-python-in-linux/

Insert newb whining, is it just me or do ALL the Linux instructions (ever written) forget to explicitly tell you WHERE to install things? I mention this because my root problem feels like my $PATH variable isn't seeing Pip (step #4 in the AWS CLI installation instructions). I can't get passed that - so I'm no closer to install AWS CLI or Terraform.

My (not so) educated guess was to install Python in /usr/local/bin (notice that the AWS instructions mention ~/.local/bin - but all I see there is wheel - and I remember that from a post on using su - you need to be 'in the wheel'). So ~/.local/bin looks obviously wrong to me. I successfully downloaded the Python 3.6 tar ball to /usr/local/bin, and followed the instructions to the letter in that second Python URL. And I was met with what I hope is success.

$ python3 --version
Python 3.6.0

However, I was looking around I saw Python 2.7 in /usr/bin - and now I'm worried you are laughing and typing a post to tell me that oops - you need to start over. Note: do NOT be shy about just telling me to blow away this VM and start over - I don't really like KDE and I'm not afraid of starting over. Back to trying to follow the AWS instructions in /usr/local/bin

$ python3 get-pip.py --user
Requirement already up-to-date: pip in ./lib/python3.6/site-packages

It tells me to edit my .bash_profile and add the new directory to the path and the export $PATH. Did that with $ vi .bash_profile.

$ pip --version
:bash: $: command not found

I am out of ideas.

buymycorp 03-19-2017 08:06 PM

I needed to do this:
$ yum install epel-release # I think this enables a specific Enterprise RPM source.

That allowed me to do this:

$ yum -y install python-pip
This worked

$ pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)

Believe me, I'm thankful for finding this. But, I'd prefer 'pip' was associated to Python-3.6.0 NOT Python-2.7.

Anyone have any ideas?

Thank you.

buymycorp 03-19-2017 08:55 PM

I think I have it now.
This is what I did.
$ yum remove python-pip

$ yum install python34-setuptools # I don't know if this was necessary. You might try 'easy_install-3.6 pip' first to see if you can just skip this step altogether.

$ easy_install-3.6 pip # Freaking finally!

$ which pip
/usr/local/bin/pip # for the first time it isn't either giving an error or pointing at the /usr/bin/ where Python 2.7 lives

$ pip -V # However, this gave me a weird error

$ pip3.6 install virtualenv # I have no idea what this does

$ pip -V # Still gave me a weird error

$ mkvirtualenv py3 # have no idea what this does

$ which python3 # My system finally recognizes python3 commands!
/usr/bin/python3/

$ export PATH=/usr/local/bin/pip:$PATH # You might try this prior to the (2) commands I entered that I have no idea what they did and see if pip works for you.

$ source ~/.bash_profile

$ pip -V
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6) # This is the result I'm been fighting for all day!

Now I'll see if I can finally install the AWS CLI & Terraform!


All times are GMT -5. The time now is 04:28 PM.