Thanks Steve,
Below is the results from following your steps. I started clean with the
sample application, not my app.
> * Use your *system* package manager to update the system (sudo yum
update).
[ec2-user@ip-172-31-28-79 ~]$ sudo yum update
... Omitted checks
Running transaction
Updating : 1:openssl-1.0.1k-15.99.amzn1.x86_64
1/11
Updating : 1:openssl-devel-1.0.1k-15.99.amzn1.x86_64
2/11
Updating : kernel-headers-4.4.51-40.58.amzn1.x86_64
3/11
Updating : kernel-tools-4.4.51-40.58.amzn1.x86_64
4/11
Installing : kernel-4.4.51-40.58.amzn1.x86_64
5/11
Updating : python27-crypto-2.6.1-1.14.amzn1.x86_64
6/11
Cleanup : 1:openssl-devel-1.0.1k-15.96.amzn1.x86_64
7/11
Cleanup : kernel-headers-4.4.44-39.55.amzn1.x86_64
8/11
Cleanup : 1:openssl-1.0.1k-15.96.amzn1.x86_64
9/11
Cleanup : kernel-tools-4.4.44-39.55.amzn1.x86_64
10/11
Cleanup : python27-crypto-2.6.1-1.12.amzn1.x86_64
11/11
Verifying : python27-crypto-2.6.1-1.14.amzn1.x86_64
1/11
Verifying : kernel-4.4.51-40.58.amzn1.x86_64
2/11
Verifying : kernel-tools-4.4.51-40.58.amzn1.x86_64
3/11
Verifying : kernel-headers-4.4.51-40.58.amzn1.x86_64
4/11
Verifying : 1:openssl-devel-1.0.1k-15.99.amzn1.x86_64
5/11
Verifying : 1:openssl-1.0.1k-15.99.amzn1.x86_64
6/11
Verifying : 1:openssl-1.0.1k-15.96.amzn1.x86_64
7/11
Verifying : 1:openssl-devel-1.0.1k-15.96.amzn1.x86_64
8/11
Verifying : kernel-tools-4.4.44-39.55.amzn1.x86_64
9/11
Verifying : kernel-headers-4.4.44-39.55.amzn1.x86_64
10/11
Verifying : python27-crypto-2.6.1-1.12.amzn1.x86_64
11/11
Installed:
kernel.x86_64 0:4.4.51-40.58.amzn1
Updated:
kernel-headers.x86_64 0:4.4.51-40.58.amzn1 kernel-tools.x86_64
0:4.4.51-40.58.amzn1
openssl.x86_64 1:1.0.1k-15.99.amzn1 openssl-devel.x86_64
1:1.0.1k-15.99.amzn1
python27-crypto.x86_64 0:2.6.1-1.14.amzn1
Complete!
> * Verify that you have Python 3.4.3, pip, and setuptools (easy_install)
by checking their --version.
[ec2-user@ip-172-31-28-79 bin]$ /usr/bin/python --version
Python 2.7.12
[ec2-user@ip-172-31-28-79 bin]$ /usr/bin/python3 --version
Python 3.4.3
[ec2-user@ip-172-31-28-79 bin]$ /usr/bin/pip --version
pip 6.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
[ec2-user@ip-172-31-28-79 bin]$ /usr/bin/easy_install --version
setuptools 12.2
> * Create a virtual environment inside your user home directory.
[ec2-user@ip-172-31-28-79 bin]$ cd
[ec2-user@ip-172-31-28-79 ~]$ export VENV=${PWD}/env
[ec2-user@ip-172-31-28-79 ~]$ python3 -m venv $VENV
Error: Command '['/home/ec2-user/env/bin/python3', '-Im', 'ensurepip',
'--upgrade', '--default-pip']' returned non-zero exit status 1
Again, no pip, so executing
> $VENV/bin/pip install --upgrade pip setuptools
yields the following
[ec2-user@ip-172-31-28-79 ~]$ $VENV/bin/pip install --upgrade pip setuptools
-bash: /home/ec2-user/env/bin/pip: No such file or directory
However, I will note that we can create custom environments, so maybe this
is the key. Whatever AWS is using for python (which I imagine is for flask
and django) has been tailored for that. They also say you can also use
Ubuntu or RHEL. I am thinking that a custom environment is needed with a
proper python3 install.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html
Anyway, I will try to work on this a bit later. I just wanted to report
back asap.
Thanks
--Dan
On Sun, Mar 19, 2017 at 2:58 AM, Steve Piercy <[email protected]>
wrote:
> On 3/18/17 at 7:37 PM, [email protected] (Dan Clark) pronounced:
>
>
> Steve/Bert
>>
>> Let's see where and which version of Python 3 you really have, then look
>>> in the same directory for other Python packaging tools.
>>>
>>
>> [ec2-user@ip-172-31-4-9 ~]$ python3 --version
>> Python 3.4.3
>> [ec2-user@ip-172-31-4-9 ~]$ which python3
>> /usr/bin/python3
>>
>> However, I am not sure what you want me to look for. If I go into /usr/bin
>> here are the ones I think might be relevant
>>
>> lrwxrwxrwx 1 root root 24 Mar 17 09:22 python ->
>> /etc/alternatives/python
>> -rwxr-xr-x 1 root root 5120 Sep 1 2016 python27
>> -rwxr-xr-x 1 root root 5120 Sep 1 2016 python2.7
>> -rwxr-xr-x 1 root root 1846 Sep 1 2016 python2.7-config
>> lrwxrwxrwx 1 root root 25 Mar 7 19:40 python3 ->
>> /etc/alternatives/python3
>> -rwxr-xr-x 3 root root 6864 Sep 1 2016 python34
>> -rwxr-xr-x 3 root root 6864 Sep 1 2016 python3.4
>> lrwxrwxrwx 1 root root 17 Mar 7 19:40 python3.4-config ->
>> python3.4m-config
>> -rwxr-xr-x 3 root root 6864 Sep 1 2016 python3.4m
>> -rwxr-xr-x 1 root root 173 Sep 1 2016 python3.4m-config
>> -rwxr-xr-x 1 root root 3288 Sep 1 2016 python3.4m-x86_64-config
>> lrwxrwxrwx 1 root root 32 Mar 7 19:40 python3-config ->
>> /etc/alternatives/python3-config
>> lrwxrwxrwx 1 root root 31 Mar 17 09:22 python-config ->
>> /etc/alternatives/python-config
>> lrwxrwxrwx 1 root root 25 Mar 7 19:40 python-config2 ->
>> /usr/bin/python3.4-config
>> lrwxrwxrwx 1 root root 25 Mar 7 19:40 pyvenv3 ->
>> /etc/alternatives/pyvenv3
>> -rwxr-xr-x 1 root root 230 Sep 1 2016 pyvenv3.4
>>
>> lrwxrwxrwx 1 root root 21 Mar 17 09:22 pip -> /etc/alternatives/pip
>> -rwxr-xr-x 1 root root 290 Aug 10 2016 pip-2.7
>>
>> lrwxrwxrwx 1 root root 30 Mar 17 09:22 easy_install ->
>> /etc/alternatives/easy_install
>> -rwxr-xr-x 1 root root 328 Aug 10 2016 easy_install-2.7
>> -rwxr-xr-x 1 root root 328 Aug 10 2016 easy_install-3.4
>>
>> in /etc/alternatives we have
>>
>> lrwxrwxrwx 1 root root 18 Mar 17 09:22 python -> /usr/bin/python2.7
>> lrwxrwxrwx 1 root root 34 Mar 17 09:22 python.1.gz ->
>> /usr/share/man/man1/python2.7.1.gz
>> lrwxrwxrwx 1 root root 18 Mar 7 19:40 python3 -> /usr/bin/python3.4
>> lrwxrwxrwx 1 root root 34 Mar 7 19:40 python3.1.gz ->
>> /usr/share/man/man1/python3.4.1.gz
>> lrwxrwxrwx 1 root root 25 Mar 7 19:40 python3-config ->
>> /usr/bin/python3.4-config
>> lrwxrwxrwx 1 root root 25 Mar 17 09:22 python-config ->
>> /usr/bin/python2.7-config
>> lrwxrwxrwx 1 root root 18 Mar 7 19:40 pyvenv3 -> /usr/bin/pyvenv3.4
>>
>> lrwxrwxrwx 1 root root 16 Mar 17 09:22 pip -> /usr/bin/pip-2.7
>>
>> lrwxrwxrwx 1 root root 25 Mar 17 09:22 easy_install ->
>> /usr/bin/easy_install-2.7
>>
>> Versions:
>>
>> [ec2-user@ip-172-31-4-9 bin]$ /usr/bin/pip-2.7 --version
>> pip 6.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
>>
>> [ec2-user@ip-172-31-4-9 bin]$ /usr/bin/easy_install-3.4 --version
>> setuptools 12.2
>> [ec2-user@ip-172-31-4-9 bin]$ /usr/bin/easy_install-2.7 --version
>> setuptools 12.2
>>
>
> Interesting. I've never seen such a structure.
>
> Following the symlink chain:
>
> /usr/bin/python3 -> /etc/alternatives/python3 -> /usr/bin/python3.4
> /usr/bin/pip -> /etc/alternatives/pip -> /usr/bin/pip-2.7
> /usr/bin/easy_install -> /etc/alternatives/easy_install ->
> /usr/bin/easy_install-2.7
>
> I don't think it matters that pip and setuptools point to a 2.7 package
> because I assume that both pip and setuptools work cross-platform for
> Python 2.7.(something) and 3.4.3. Let's leave that alone for now.
>
> I would ignore pyvenv for creating virtual environments, as it eventually
> became deprecated in 3.6 and it invokes the venv module anyway. The venv
> module has been included with Python since v3.3, and is preferred for
> creating virtual environments. Python 3.4.3 should include pip and
> setuptools, too. easy_install is part of setuptools.
>
> When you start clean, here's what I recommend.
>
> * Use your *system* package manager to update the system (sudo yum update).
> * Verify that you have Python 3.4.3, pip, and setuptools (easy_install) by
> checking their --version.
> * Do not update your system Python 3.4.3, pip, or setuptools, except
> through the system package manager. Do not install any of these if they
> appear missing.
> * Create a virtual environment inside your user home directory.
>
> $ cd ~
> $ export VENV=${PWD}/env
> $ python3 -m venv $VENV
>
> * Upgrade pip and setuptools inside your virtual environment, which is
> isolated from your system.
>
> $ $VENV/bin/pip install --upgrade pip setuptools
>
> * Check versions of Python, pip, and setuptools inside your virtual
> environment.
>
> $ $VENV/bin/python --version
> $ $VENV/bin/pip --version
> $ $VENV/bin/easy_install --version
>
> * Now install Pyramid into your virtual environment.
>
> $ $VENV/bin/pip install pyramid
>
> * Create a project.
>
> $ mkdir myproject
> $ cd myproject
> ... create and edit a Hello World app ...
> ... prepare your app for AWS deployment ...
>
> I left the rest of the details up to you.
>
> --steve
>
>
>
> Also I recall that you had to use `sudo` at one point
>>>
>>
>> I have been starting fresh with new EB instances. Haven't used sudo
>> recently.
>>
>> Either way it sounds like pip for 3.4 isn't installed by default. I hope
>> to
>> spend some time tonight to figure out how python -m venv works. Anyway, I
>> then followed Bert's advice and tried installing the packages.
>>
>> Now I have
>>
>> lrwxrwxrwx 1 root root 21 Mar 18 23:17 pip -> /etc/alternatives/pip
>> -rwxr-xr-x 1 root root 290 Aug 10 2016 pip-2.7
>> -rwxr-xr-x 1 root root 290 Aug 10 2016 pip-3.5
>>
>> However, I am still getting the same error. I noticed that the
>> /etc/alternatives link was still pointing to 2.7, so I changed that with
>>
>> sudo alternatives --install /usr/bin/pip pip /usr/bin/pip-3.5 1
>>
>> and now pip's version is
>>
>> [ec2-user@ip-172-31-4-9 alternatives]$ pip --version
>> pip 6.1.1 from /usr/lib/python3.5/dist-packages (python 3.5)
>>
>> but I still get the same error when installing a new env. Not sure what's
>> next.
>>
>> I need to feed the kids now, but on the next go around I am going to blow
>> everything away and start from scratch.
>>
>> Anyway, I do appreciate the help.
>>
>> Thanks,
>> --Dan
>>
>>
>>
>> On Fri, Mar 17, 2017 at 6:40 PM, Steve Piercy <[email protected]
>> >
>> wrote:
>>
>> On 3/17/17 at 5:53 AM, [email protected] (Dan Clark) pronounced:
>>>
>>> Got stuck and then unstuck, but there are questions.
>>>
>>>>
>>>> First, AWS's EB linux instances are redhat-ish
>>>>
>>>> [ec2-user@ip-172-31-4-9 ~]$ cat /etc/*-release
>>>> NAME="Amazon Linux AMI"
>>>> VERSION="2016.09"
>>>> ID="amzn"
>>>> ID_LIKE="rhel fedora"
>>>> VERSION_ID="2016.09"
>>>> PRETTY_NAME="Amazon Linux AMI 2016.09"
>>>> ANSI_COLOR="0;33"
>>>> CPE_NAME="cpe:/o:amazon:linux:2016.09:ga"
>>>> HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
>>>> Amazon Linux AMI release 2016.09
>>>>
>>>>
>>> The ID_LIKE attribute could be misleading.
>>>
>>> Part of the battle might be understanding where everything is located and
>>> their names. I don't have an AWS playground, but maybe this will help.
>>>
>>> Here is Python support information for AWS EB:
>>> http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concep
>>> ts.platforms.html#concepts.platforms.python
>>>
>>> Let's see where and which version of Python 3 you really have, then look
>>> in the same directory for other Python packaging tools.
>>>
>>> $ python3 --version
>>> $ which python3
>>>
>>> You might have a pip3, easy_install-3.4, and virtualenv. Check the
>>> versions and whether they symlink elsewhere. Report back and maybe we
>>> can
>>> figure out what's next.
>>>
>>> Also I recall that you had to use `sudo` at one point, which could be a
>>> sign of system hosing. If you suspect something is terribly wrong, then
>>> there's no harm in blowing away your AWS instance and starting clean, or
>>> rolling back to the initial clean version (if rollbacks are possible with
>>> AWS).
>>>
>>> --steve
>>>
>>> ------------------------
>>> Steve Piercy, Soquel, CA
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "pylons-discuss" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/pylons-discuss/MSAMBzwx7aQ/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> To post to this group, send email to [email protected].
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/pylons-discuss/r473Ps-10123i-C625127BE1D54D76855C51B3331
>>> 2A5AC%40Steves-iMac.local.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>
> ------------------------
> Steve Piercy, Soquel, CA
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "pylons-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/pylons-discuss/MSAMBzwx7aQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/pylons-discuss/r473Ps-10123i-FD312D5DC1984B3091DE8914CAE
> 81E8D%40Steves-iMac.local.
>
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/CAKbG-MiDr_bsAGggD9tVqy8hdpnHtB3dd1ppHkguBzPp0kWH4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.