I have a local device farm that is running python 2.7.13 via Appium 1.6.5 on some android emulators. We want to increase our exposure and make use of the AWS device farm. The problem is that AWS only support Python 2.7.6 and they don't have plans to upgrade.
We need at least Python 2.7.9+ because any python below that doesn't support SSL with the "request" package.
We tried "request[security] == 2.9.1" but it introduces a dependency in the wheel packages that AWS doesn't support.
With python 2.7.6 on Windows and AWS we get the following errors when downloading packages with pip...
...
Collecting cryptography>=2.2.1 (from
pyOpenSSL>=0.13->requests[security]==2.9.1->-r
/tmp/scratchzAHCQI.scratch/test-packagep3mb8i/requirements.txt (line
5))
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning Downloading
https://files.pythonhosted.org/packages/22/21/233e38f74188db94e8451ef6385754a98f3cad9b59bedf3a8e8b14988be4/cryptography-2.3.1.tar.gz
(449kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "/tmp/pip-build-nqoNP_/cryptography/setup.py", line 28, in
"cryptography requires setuptools 18.5 or newer, please upgrade to a "
RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools
---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-build-nqoNP_/cryptography
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning You are using pip version 7.1.2, however
version 18.0 is available. You should consider upgrading via the 'pip
install --upgrade pip' command.
An AWS support engineer mentioned that we can setup our own environment to support a new version of Python. However, the documentation is very confusing as it doesn't specify what the "Tech Spec" file should be called (I assume buildspec.yml), where I should put it, whether we should still use wheel or just pip?
Can I use apt or should I use yum?
I've looked around the internet but can't really find anything related to python and the AWS tech spec. All I want to do is install Python 2.7.9, install the requirements and trigger the tests and be able to make post to https REST services.
Have anyone had to solve this issue before?
You can choose just from default 2.7.6 vs optional 3.4.3. Follow this post to setup python 3 environment: https://forums.aws.amazon.com/message.jspa?messageID=865585#868262
Related
SO when i try to install pip i get this error message any help
i am using python 2.7 because the course uses dependencies from python 2 so ya i cant use python 3 any help is greatly appreciated
python get-pip.py
this is the command i typed
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
f:\temp\temp\tmpbwi9va\pip.zip\pip\_vendor\urllib3\util\ssl_.py:424: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
f:\temp\temp\tmpbwi9va\pip.zip\pip_vendor\urllib3\util\ssl_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
ERROR: Could not find a version that satisfies the requirement pip<21.0 (from versions: none)
ERROR: No matching distribution found for pip<21.0
I have Python2.7 & Python3.8 installed on my computer with pipenv. I managed to create a 2.7 project by running the following command:
pipenv --two install
pipenv shell
> python --version
> > Python 2.7.15
But when I tried to install a new dependancy using pipenv I got an TLS error due to SNIMissingWarning:
pip install pylint
...
[pipenv.exceptions.InstallError]: ['Collecting astroid==1.6.6 (from -r C:\\Users\\aymeric\\AppData\\Local\\Temp\\pipenv-pktqf1dv-requirements\\pipenv-66rq3_4k-requirement.txt (line 1))', " Could not fetch URL https://pypi.org/simple/astroid/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/astroid/ (Caused by SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping"]
[pipenv.exceptions.InstallError]: ["DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020.
Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support", 'c:\\users\\aymeric\\.virtualenvs\\firmware-pjqfwcnq\\lib\\site-packages\\ pip\\_vendor\\urllib3\\util\\ssl_.py:365: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform.
This may cause the server to present an incorrect TLS certificate, which can cause validation failures.
You can upgrade to a newer version of Python to solve this.
For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings', ' SNIMissingWarning', 'c:\\users\\aymeric\\.virtualenvs\\firmware-pjqfwcnq\\lib\\site-packages\\pip\\_vendor\\urllib3\\util\\ssl_.py:149: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
Which is odd because SNIMissingWarning should have been patch in 2.7.9 as explained in this link
If remote repositories are now unreachable from 2.7 virtualenv how can you do?
Kinds regards
I'm trying to install SimpleCV on a RaspberryPi 2 running Ubuntu 14.04 LTS. I don't believe this to be be specific to the Pi or even to Ubuntu, it is more a general question and I feel OK to ask here.
I'm following the directions at
https://github.com/sightmachine/SimpleCV/blob/develop/doc/HOWTO-Install%20on%20RaspberryPi.rst
When trying the first part of step 4 I get a long list of trace then a "memory error"
When trying the second part I get the following error
Collecting PIL (from -r requirements.txt (line 3))
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Could not find a version that satisfies the requirement PIL (from -r requirements.txt (line 3)) (from versions: )
Some externally hosted files were ignored as access to them may be unreliable (use --allow-external PIL to allow).
No matching distribution found for PIL (from -r requirements.txt (line 3))
and breaking it further down I get an error trying to install PIL by itself (well, forcing it really, but apparently not hard enough...)
robert#furbot:~/Code/SimpleCV$ pip install --allow-external --allow-unverified PIL
Collecting PIL
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Could not find a version that satisfies the requirement PIL (from versions: )
Some externally hosted files were ignored as access to them may be unreliable (use --allow-external PIL to allow).
No matching distribution found for PIL
I notice that PIL is itself deprecated and wonder if there's a better way to do this ? The SSL error is common on this system it's a cause for concern but it's not really a mission critical exercise either. The goal is as said to install SimpleCV on a Ubuntu 14.04 system. I already have openCV compiled locally and it seems OK and I believe the system itself should be OK (I have a backup of its SD card...)
TIA
Rob
I ran into similar issues with installing PIL a few days ago on a Macbook. I ended up skipping that step altogether and proceeding with the other installs. When I tried to run the helloworld program, it threw a couple errors along the lines of "could not find x in PIL library," so I installed the pillow library instead, which was recommended in countless other SO questions related to PIL. It seemed to work fine after that. I know it's a different system from an RPi2, but I'd say give it a shot.
It would probably be easier here to follow the "install SimpleCV from source" instructions under step 4. Since it's looking for PIL in your requirements.txt, go ahead and edit that file to remove PIL from the list before running the line: sudo pip install -r requirements.txt. If that doesn't work, try replacing PIL with pillow.
I am trying to install django-dash to run one of the dashboard examples and see what it's like.
I am on Windows running Python 2.7 and Django 1.6.5. I know the usual approach is to download pip then install the package using pip. However, I am on a work computer with no administrative rights so I can't access my Internet Option Settings to find my proxy URL to follow the instructions below:
Proxy problems
If you work in an office, you might be behind a HTTP proxy. If so, set the environment variables http_proxy and https_proxy. Most Python applications (and other free software) respect these. Example syntax:
http://proxy_url:port
http://username:password#proxy_url:port
I had the same issue when trying to install Django but was able to get it to work by moving the django directory under Python27/Lib/site-packages. Is there something similar I can do with django-dash?
I also tried downloading the sources and running python setup.py install. I received the following error:
File "setup.py", line 3, in <module> from setuptools import setup, find_packages ImportError: No module named setuptools
Link to django-dash: http://django-dash.readthedocs.org/en/latest/
Yes, you can probably get the sources from The Python Package Index
Once you have them, uncompress the files and install them manually (this will depend on you OS).
On Linux systems:
python setup.py build
python setup.py install
Here's the full reference
EDIT : Note that when manually installing those packages, you must also install any missing dependencies, eg. setuptools in your case
I'm trying to install the peewee package on an elastic beanstalk instance to control a bottle application. I think the problem is with the MySQL-python dependency, but peewee doesn't load either. My requirements file looks like this:
bottle==0.11.6
peewee==2.1.1
MySQL-python
I also tried MySQL-python as MySQL-python==1.2.4b4. For a number of reasons which I believe are summed up here, this doesn't work; peewee isn't installed and I get this error message in the log:
2013-05-18 06:57:08,407 [INFO] (15947 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded.
2013-05-18 06:57:08,408 [INFO] (15947 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing script: /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py
2013-05-18 06:57:18,663 [INFO] (15947 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: New python executable in /opt/python/run/venv/bin/python2.6
Not overwriting existing python script /opt/python/run/venv/bin/python (you must use /opt/python/run/venv/bin/python2.6)
Installing distribute..................................................................................................................................................................................................done.
Installing pip................done.
Requirement already satisfied (use --upgrade to upgrade): bottle==0.11.6 in /opt/python/run/venv/lib/python2.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 1))
Downloading/unpacking peewee==2.1.1 (from -r /opt/python/ondeck/app/requirements.txt (line 2))
Running setup.py egg_info for package peewee
Downloading/unpacking MySQL-python (from -r /opt/python/ondeck/app/requirements.txt (line 3))
Running setup.py egg_info for package MySQL-python
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.27 (/opt/python/run/venv/lib/python2.6/site-packages/distribute-0.6.27-py2.6.egg))
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
So pip doesn't work for these packages. I'm pretty sure I could fix this by connecting to the EC2 instance and installing MySQL-python without pip, but it seems to me that would defeat the purpose of elastic beanstalk, since every time a new instance started it would need me to go in and tinker with it manually. Is there a proper way for me to deal with this problem? I've also had the same issue trying to install things like scipy and matplotlib, so broadly, is there a way I can install python packages on elastic beanstalk instances without pip, and without going into each instance individually? Should I be looking into how to make a custom AMI and use it on beanstalk?
Thanks a lot,
Alex
Sorry I forgot I asked this.
I eventually solved this issue by ssh'ing into the instance and installing MySQL-Python using easy_install instead of pip.
Basically I went to the python virtual environment direction at:
opt/python/run/venv/bin
and installed version 1.2.3 using easy_install:
sudo ./easy_install MySQL-Python==1.2.3
I checked to see it was installed by trying to import MySQLdb in the virtual environment's python:
./python
>>>import MySQLdb
>>>
and it worked for me. Then I reset the server by pushing to it again with the elastic beanstalk command line tool:
git aws.push
and that's about it. Somewhat annoying to have to do it, but it seems to continue to work when a new instance is started up.
Thanks,
Alex