Codalab setup issue using python2.7 - python-2.7

I am having trouble installing codalab (https://codalab.org/) using python2.7.x. The codalab site has provided a tutorial here through which one can install their CLI to interact with their server.
The tutorial says that we need to have python 2.7 and to install codalab simply run the command "pip install codalab -U --user" whereas here it says, run "pip install codalab" but none of the commands work and i get the error from both of the commands.
The error trace is as follows
https://pip.pypa.io/en/latest/development/relea
se-process/#python-2-support
Collecting codalab
c:\python27\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.<br />
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:\python27\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.You can upgrade to a newer version of Python to solve this. For more information, seehttps://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecurePlatformWarning <br />
Using cached https://files.pythonhosted.org/packages/78/c9/596147d4836372f07c2
463cc8ad79eba3c6b18f3a9ab50b57fbac94ea3f2/codalab-0.3.2.tar.gz
Collecting codalabworker>=0.3.2 (from codalab)
Using cached https://files.pythonhosted.org/packages/8e/16/7bdc06efeab5d712a55
7a0fed8d1e050dbf4769d96afac295f620e2b44a2/codalabworker-0.3.2.tar.gz <br />
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\hafiza~1\\appdata\\local\\temp\\pip-install-rbchpi\\codalabworker\\setup.py'"'"';__file__='"'"'c:\\users\\hafiza~1\\appdata\\local\\temp\\pip-installrbchpi\\codalabworker\\setup.py'"'"';f=getattr(tokenize, '"'"'
open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'egg_info --egg-base pip-egg-info <br />
cwd: c:\users\hafiza~1\appdata\local\temp\pip-install-rbchpi\codalabworker\ <br />
Complete output (1 lines):<br />
**error in codalabworker setup command: "values of 'package_data' dict" must be a list of strings (got 'requirements.txt')** <br />
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.<br />
I have tried different versions of python from 2.7.0 to2.7.8 and the 2.7.16 but I get the same error. I have also tried the 3.7.0.
OS: windows 8.1
Python --version tried : mentioned above
pip version tried: latest 19 for both 2.7 and 3.0
every python tool was upgraded.
Other links tried: could not found none related to this problem

You may need to fix the codalabworker/setup.py file.
Check this: https://github.com/codalab/codalab-worksheets/commit/6e92da072e17ad7a25c287325d0795233fd2d168
Or change package_data={'': 'requirements.txt'} to
package_data={'': ['requirements.txt'\].

Related

Getting error "post-link script failed for package defaults ::ipykernel-4.10.0-py27_0" while installing ipykernel in anaconda with python 2.7

I am trying to install ipykernel in a separate python 2.7 environment (py27) for use of jupyter notebook. My base environment uses python3.9 that works great. When trying to use conda install ipykernel, I get the error below. Yes, this was done in a separate environment from my base and I am not aware of any virus softwares that are impeding this from successfully completing. Those are the only answers that I've seemed to find online. I also tried reinstalling anaconda. I did not attach the output from conda install -v ipykernel, but saw an error saying invalid syntax in decorator.py on line 162. It was pointing to the file=stderr in a print function call.
Similar to this problem https://github.com/conda/conda/issues/7351, but was unable to solve the problem with the suggestions.
(py27) C:\Users\Heath>conda install ipykernel
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: C:\Users\Heath\anaconda3\envs\py27
added / updated specs:
- ipykernel
The following NEW packages will be INSTALLED:
backports pkgs/main/noarch::backports-1.0-pyhd3eb1b0_2
backports.shutil_~ pkgs/main/noarch::backports.shutil_get_terminal_size-1.0.0-pyhd3eb1b0_3
backports_abc pkgs/main/noarch::backports_abc-0.5-py_1
colorama pkgs/main/noarch::colorama-0.4.4-pyhd3eb1b0_0
decorator pkgs/main/noarch::decorator-5.1.0-pyhd3eb1b0_0
enum34 pkgs/main/win-64::enum34-1.1.6-py27_1
futures pkgs/main/win-64::futures-3.3.0-py27_0
ipykernel pkgs/main/win-64::ipykernel-4.10.0-py27_0
ipython pkgs/main/win-64::ipython-5.8.0-py27_0
ipython_genutils pkgs/main/noarch::ipython_genutils-0.2.0-pyhd3eb1b0_1
jupyter_client pkgs/main/win-64::jupyter_client-5.3.4-py27_0
jupyter_core pkgs/main/win-64::jupyter_core-4.6.1-py27_0
libsodium pkgs/main/win-64::libsodium-1.0.16-h8b3e59e_0
pathlib2 pkgs/main/win-64::pathlib2-2.3.5-py27_0
pickleshare pkgs/main/win-64::pickleshare-0.7.5-py27_0
prompt_toolkit pkgs/main/win-64::prompt_toolkit-1.0.15-py27h3a8ec6a_0
pygments pkgs/main/noarch::pygments-2.5.2-py_0
python-dateutil pkgs/main/noarch::python-dateutil-2.8.2-pyhd3eb1b0_0
pywin32 pkgs/main/win-64::pywin32-227-py27h0c8e037_1
pyzmq pkgs/main/win-64::pyzmq-18.1.0-py27hc56fc5f_0
scandir pkgs/main/noarch::scandir-1.10.0-pyh5d7bf9c_3
simplegeneric pkgs/main/win-64::simplegeneric-0.8.1-py27_2
singledispatch pkgs/main/noarch::singledispatch-3.7.0-pyhd3eb1b0_1001
six pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0
tornado pkgs/main/win-64::tornado-5.1.1-py27h0c8e037_0
traitlets pkgs/main/win-64::traitlets-4.3.3-py27_0
wcwidth pkgs/main/noarch::wcwidth-0.2.5-pyhd3eb1b0_0
win_unicode_conso~ pkgs/main/win-64::win_unicode_console-0.5-py27hc037021_0
zeromq pkgs/main/win-64::zeromq-4.3.1-h2880e7c_3
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
ERROR conda.core.link:_execute(699): An error occurred while installing package 'defaults::ipykernel-4.10.0-py27_0'.
Rolling back transaction: done
LinkError: post-link script failed for package defaults::ipykernel-4.10.0-py27_0
location of failed script: C:\Users\Heath\anaconda3\envs\py27\Scripts\.ipykernel-post-link.bat
==> script messages <==
<None>
==> script output <==
stdout:
stderr:
return code: 1
()```

Is it still possible to use pipenv with Python 2.7?

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

On Plone 4.3.15, how to install latest Stripe's API

On Plone 4.3.15 (Universal installation), it is not possible to install stripe 2.32.1.
See logs :
Getting distribution for 'stripe==2.32.1'.
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'project_urls'
warnings.warn(msg)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
error: Setup script exited with error in stripe setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
An error occurred when trying to install stripe 2.32.1. Look above this message for any errors that were output by easy_install.
While:
Installing instance.
Getting distribution for 'stripe==2.32.1'.
Error: Couldn't install: stripe 2.32.1
It seems that easy_install / Setuptools is too old ?
Do I need to upgrade Setuptool ? If so, how can it be done ?
'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
Yes, your setuptools is too old. To upgrade:
pip install -U setuptools
Perhaps you also need to upgrade pip:
pip install -U pip setuptools

Using Conan with Python3 on Travis-CI

I have a C++ project that uses Travis-CI and Conan. My Linux build on Travis-CI is failing when it attempts to download libcurl:
libcurl/7.61.1#bincrafters/stable: Building your package in /home/travis/.conan/data/libcurl/7.61.1/bincrafters/stable/build/b6dbf799dd7e6d1c740e159bea361666320a3db8
libcurl/7.61.1#bincrafters/stable: Configuring sources in /home/travis/.conan/data/libcurl/7.61.1/bincrafters/stable/source
/usr/local/lib/python2.7/dist-packages/urllib3/util/ssl_.py:150: 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
InsecurePlatformWarning
ERROR: Error downloading file https://curl.haxx.se/download/curl-7.61.1.tar.gz: 'HTTPSConnectionPool(host='curl.haxx.se', port=443): Max retries exceeded with url: /download/curl-7.61.1.tar.gz (Caused by SSLError(CertificateError("hostname 'curl.haxx.se' doesn't match 'c.sni.fastly.net'",),))'
Waiting 5 seconds to retry...
/usr/local/lib/python2.7/dist-packages/urllib3/util/ssl_.py:150: 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
InsecurePlatformWarning
libcurl/7.61.1#bincrafters/stable: WARN: Trying to remove corrupted source folder
libcurl/7.61.1#bincrafters/stable: WARN: This can take a while for big packages
ERROR: libcurl/7.61.1#bincrafters/stable: Error in source() method, line 131
tools.get("https://curl.haxx.se/download/curl-%s.tar.gz" % self.version)
ConanException: Error downloading file https://curl.haxx.se/download/curl-7.61.1.tar.gz: 'HTTPSConnectionPool(host='curl.haxx.se', port=443): Max retries exceeded with url: /download/curl-7.61.1.tar.gz (Caused by SSLError(CertificateError("hostname 'curl.haxx.se' doesn't match 'c.sni.fastly.net'",),))'
The command "conan install .. --build missing" exited with 1.
Per the advise in the error, I have tried to get Travis to use Python3 to see if that would resolve the problem but I have had no luck. First I added python3 to my packages: like so:
matrix:
include:
- os: linux
dist: trusty
sudo: required
env:
- CC_COMPILER=gcc-7
- CXX_COMPILER=g++-7
- BUILD_TYPE=RelWithDebInfo
addons:
apt:
packages:
- python3
- gcc-7
- g++-7
sources:
- ubuntu-toolchain-r-test
But I received the same error as above. Then I tried alias'ing the command:
install:
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo pip install conan
alias python=python3
fi
Yet, I get the same results.
How can I get Travis-CI to use python3 for Conan? Or is there another way I can get my conan install command to work?
Thank you!
The default CI scripts generated with conan new pkg/version -s -cilg might help. They contain something like:
linux: &linux
os: linux
dist: xenial
sudo: required
language: python
python: "3.6"
services:
- docker
matrix:
include:
- <<: *linux
env: ...
install:
- chmod +x .travis/install.sh
- ./.travis/install.sh
And the install script:
pip install conan --upgrade
pip install conan_package_tools
conan user
So it is not declared as a package, but defined at the root level, and that seems to be enough to later use it with bare pip install.
Well if I am reading it correctly python3 is not the issue here. The error is:
CertificateError("hostname 'curl.haxx.se' doesn't match 'c.sni.fastly.net'",
So something fishy with ssl.
Python2 does produce insecure platform warning when using ssl / https but it's rarely the issue.
As for python3 on Travis - I personally couldn't get conan to work in CI with python3.
But basic steps are:
apt:
packages:
- python3
- python3-pip
...
To install conan using python3:
sudo pip3 install conan
Note that in your example install you called pip - which installs conan with python3 and it will run by python2 when called from command line despite the alias. The interpreter to use is actually in the conan script.

Setting up a python environment on AWS using buildspec.yml

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