Hello,
New release (0.11.0) is broken for Python 2.x users, below you can find steps to reproduce:
~/.virtualenvs/tmp-455f8c1518baad7 via tmp-455f8c1518baad7
โ python --version
Python 2.7.14
~/.virtualenvs/tmp-455f8c1518baad7 via tmp-455f8c1518baad7
โ pip install arrow
Collecting arrow
Collecting python-dateutil (from arrow)
Using cached python_dateutil-2.6.1-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil->arrow)
Using cached six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, arrow
Successfully installed arrow-0.11.0 python-dateutil-2.6.1 six-1.11.0
~/.virtualenvs/tmp-455f8c1518baad7 via tmp-455f8c1518baad7
โ python
Python 2.7.14 (default, Sep 25 2017, 09:53:22)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ng/.virtualenvs/tmp-455f8c1518baad7/lib/python2.7/site-packages/arrow/__init__.py", line 3, in <module>
from .arrow import Arrow
File "/Users/ng/.virtualenvs/tmp-455f8c1518baad7/lib/python2.7/site-packages/arrow/arrow.py", line 19, in <module>
from arrow import util, locales, parser, formatter
File "/Users/ng/.virtualenvs/tmp-455f8c1518baad7/lib/python2.7/site-packages/arrow/parser.py", line 12, in <module>
from backports.functools_lru_cache import lru_cache # pragma: no cover
ImportError: No module named backports.functools_lru_cache
>>>
Could you fix this please?
Yes, this is really bad. I spent the last 3 hours trying to get @platformio up and running again. Turns out, it runs against this error. @ivankravets are you already aware of this issue? I am pretty sure you will get tons of false bug reports, as this causes (yet another) Install Endless Loop in Atom....
@GrimmiMeloni I can't reproduce this issue with my default Python 2.7.10 on macOS. What are your OS and Python version?
And I found why all builds is green...
To run tests we need to install deps from requirements.txt:
build27:
virtualenv local --python=python2.7
local/bin/pip install -r requirements.txt
And as we can see requirements.txt contains backports.functools_lru_cache:
โ cat requirements.txt
python-dateutil==2.6.0
nose==1.3.0
nose-cov==1.6
chai==1.1.1
sphinx==1.3.5
simplejson==3.6.5
backports.functools_lru_cache==1.2.1
But backports.functools_lru_cache is missing in setup.py...
I hope this patch should fix issue:
diff --git a/setup.py b/setup.py
index a48aa91..00c772f 100644
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,8 @@ setup(
packages=['arrow'],
zip_safe=False,
install_requires=[
- 'python-dateutil'
+ 'python-dateutil',
+ 'backports.functools_lru_cache;python_version<"3"',
],
test_suite="tests",
classifiers=[
Tested on my local, everything works fine.
@Gr1N You are right, this is a CRITICAL issue. @crsmithdev could you make a new release of "arrow" with adding a dependency to backports.functools_lru_cache?
Thanks!
'backports.functools_lru_cache;python_version<"3"'
@Gr1N The better is to check Python version and dynamically configure install_requires. Otherwise, we will have an issue with the old version of setuptools.
Do as you think is right, I just want to get a new package with fix :)
@GrimmiMeloni temporary fixed as extra deps for @platformio https://github.com/platformio/platformio-core/commit/37a2ccedbde0332643d5cfe1904625eccf35cc86
Please remove %HOME_DIR%/.platformio/penv folder and restart PlatformIO IDE. It should work now.
Please check the PR i've created to address this issue, we need to push this asap.
Fixed on https://pypi.python.org/pypi/arrow/0.12.0 - please upgrade arrow if you're using python 2.x and arrow 0.11.0
Thank you!
Nice one, everybody! HotHotfix ๐
still have the issue with 0.12 python 2.7
same here.
Same issue under win7 python 2.7 arrow version 0.12
backports is missing a proper "__init__.py"
For anyone else arriving here, this is resolved in 0.12.1
I'm seeing this with 0.12.1 on Debian 8:
> pip list | grep arrow
arrow (0.12.1)
> python
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/arrow/__init__.py", line 3, in <module>
from .arrow import Arrow
File "/usr/local/lib/python2.7/dist-packages/arrow/arrow.py", line 19, in <module>
from arrow import util, locales, parser, formatter
File "/usr/local/lib/python2.7/dist-packages/arrow/parser.py", line 12, in <module>
from backports.functools_lru_cache import lru_cache # pragma: no cover
ImportError: No module named backports.functools_lru_cache
>>>
@rmechler This is strange. Can you try a pip install -U arrow and see if the problem persists?
I also see this error w/ arrow 0.12.1 (python 2.7.10 on Mac OS 10.11.6):
$ pip list | grep arrow
arrow (0.12.1)
$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/arrow/__init__.py", line 3, in <module>
from .arrow import Arrow
File "/Library/Python/2.7/site-packages/arrow/arrow.py", line 19, in <module>
from arrow import util, locales, parser, formatter
File "/Library/Python/2.7/site-packages/arrow/parser.py", line 12, in <module>
from backports.functools_lru_cache import lru_cache # pragma: no cover
ImportError: No module named functools_lru_cache
>>>
I am also seeing this issue on 0.12.1
I uninstalled 0.12.1, installed 0.12.0 and it worked fine.
This issue should not be closed?
I am running into this issue when installing audreyr/cookiecutter (due to cookiecutter > jinja2-time > arrow).
The issue seems to be that pip looks for backports.functools_lru_cache>=1.2.1 and not the pinned backports.functools_lru_cache==1.2.1. If I remove the 1.5 version and install the 1.2.1 it works fine.
What does needs fixing here and where does it needs to be fixed?
pip install
wilmardo@NUC-FLEX-01:/mnt/c/Users/wilmaro/Documents/Ubuntu$ pip install --user --no-cache-dir arrow
Collecting arrow
Downloading arrow-0.12.1.tar.gz (65kB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 71kB 6.5MB/s
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/dist-packages (from arrow)
Collecting backports.functools_lru_cache>=1.2.1 (from arrow)
Downloading backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Requirement already satisfied: six>=1.5 in /home/wilmardo/.local/lib/python2.7/site-packages (from python-dateutil->arrow)
Installing collected packages: backports.functools-lru-cache, arrow
Running setup.py install for arrow ... done
Successfully installed arrow-0.12.1 backports.functools-lru-cache-1.5
pip install -v
wilmardo@NUC-FLEX-01:/mnt/c/Users/wilmaro/Documents/Ubuntu$ pip install --user --no-cache-dir -v arrow
Collecting arrow
1 location(s) to search for versions of arrow:
* https://pypi.python.org/simple/arrow/
Getting page https://pypi.python.org/simple/arrow/
Starting new HTTPS connection (1): pypi.python.org
https://pypi.python.org:443 "GET /simple/arrow/ HTTP/1.1" 200 2313
Analyzing links from page https://pypi.python.org/simple/arrow/
Found link https://pypi.python.org/packages/02/44/13330b2e617cf0da9036dba69c8d6a3e30f88e94c4fce467f6ed413649a4/arrow-0.9.0.tar.gz#md5=05f77a45a263bb89b9858092e58e6dc1 (from https://pypi.python.org/simple/arrow/), version: 0.9.0
Found link https://pypi.python.org/packages/1b/a5/45309cf597c61f33e7185d06591338938eba59bffbc3e79ad4fe0ec7d3e5/arrow-0.3.4.tar.gz#md5=e560c73a1c1f0fb90a124d8ba1920232 (from https://pypi.python.org/simple/arrow/), version: 0.3.4
Found link https://pypi.python.org/packages/22/69/a8fdeb37143cbc9cf116378613a40c654e6509d243129dc7474fe93a069d/arrow-0.1.4.tar.gz#md5=dfc6d1f438ccd40d5b4b77efb04f4cc9 (from https://pypi.python.org/simple/arrow/), version: 0.1.4
Found link https://pypi.python.org/packages/35/59/e1b0eb82d635028c2013fb26ddbc62b1586a9c8cc109f0387f8a3586058c/arrow-0.4.2.tar.gz#md5=5caa8442fd3a84a5ad0155a1f626ef1d (from https://pypi.python.org/simple/arrow/), version: 0.4.2
Found link https://pypi.python.org/packages/3f/ec/888dc54d742551d18bf3762b0ca724de67f10761dbb863c85dceb394aeaf/arrow-0.1.tar.gz#md5=9e83e0ea8d4e9f585cda8dd29d0176a4 (from https://pypi.python.org/simple/arrow/), version: 0.1
Found link https://pypi.python.org/packages/44/9b/e8a2aa0958a04b395b4abe9852af512b851fd11c6449b7192b57dd32f36a/arrow-0.4.1.tar.gz#md5=bbcd88f2105d4644730d2199d4e29953 (from https://pypi.python.org/simple/arrow/), version: 0.4.1
Found link https://pypi.python.org/packages/4d/31/d9bae9763b669a8948107777339cdf0b49c89b4dd17a1a45a933148932ca/arrow-0.5.0.tar.gz#md5=fb8592d3097d23bcf550810ade774346 (from https://pypi.python.org/simple/arrow/), version: 0.5.0
Found link https://pypi.python.org/packages/52/22/90c0488c0c673637276775fcea9fce94b421c12b3520b9632c31022ba64d/arrow-0.1.2.tar.gz#md5=c3c195c9b5f7753671f15072138455ae (from https://pypi.python.org/simple/arrow/), version: 0.1.2
Found link https://pypi.python.org/packages/54/db/76459c4dd3561bbe682619a5c576ff30c42e37c2e01900ed30a501957150/arrow-0.10.0.tar.gz#md5=5d00592200050ad58284d45a4ee147c6 (from https://pypi.python.org/simple/arrow/), version: 0.10.0
Found link https://pypi.python.org/packages/57/be/db25f7bd8f0e40cd57d80497c0cc298b50e24b3160f5bdf1a5ac4b2e448a/arrow-0.7.0.tar.gz#md5=1597108362c5fa675dc5e0524ece4451 (from https://pypi.python.org/simple/arrow/), version: 0.7.0
Found link https://pypi.python.org/packages/58/91/21d65af4899adbcb4158c8f0def8ce1a6d18ddcd8bbb3f5a3800f03b9308/arrow-0.8.0.tar.gz#md5=4dd7534cf32bc9e4fd8d8ab2f7401363 (from https://pypi.python.org/simple/arrow/), version: 0.8.0
Found link https://pypi.python.org/packages/60/a6/e121f2cdee2766e187bb9daa0fb5702083a54d2d97b4ee72530956955779/arrow-0.2.0.tar.gz#md5=875ee5e21b61f88e92bd5379a3d2dc97 (from https://pypi.python.org/simple/arrow/), version: 0.2.0
Found link https://pypi.python.org/packages/73/61/b4881060a60491441700a9b93ff8c3c9501ffa8d4705c63ef810d62ff141/arrow-0.4.4.tar.gz#md5=8ea354c168fdf0a65a048ac665168d68 (from https://pypi.python.org/simple/arrow/), version: 0.4.4
Found link https://pypi.python.org/packages/90/48/7ecfce4f2830f59dfacbb2b5a31e3ff1112b731a413724be40f57faa4450/arrow-0.12.0.tar.gz#md5=fafb41dadf2134688797bf1102eebeb6 (from https://pypi.python.org/simple/arrow/), version: 0.12.0
Found link https://pypi.python.org/packages/9d/65/5ec9771df5db3db88ac6ce95148f6900a0127a190a373b3bd2dfd8fbc9c2/arrow-0.3.1.tar.gz#md5=c34127ae9da57e6dbdd233a817d10773 (from https://pypi.python.org/simple/arrow/), version: 0.3.1
Found link https://pypi.python.org/packages/a4/dc/b9dd92a8a7085d91a560cb7d4931ce3ba299cdab248f8f1c9bab66b8b88d/arrow-0.2.1.tar.gz#md5=683e270fa139f4c969e5e36ed3428d3b (from https://pypi.python.org/simple/arrow/), version: 0.2.1
Found link https://pypi.python.org/packages/a6/36/6b39562621c9d5025175db4c19a3e0c9df08270dfd27e8a75351852ff5b5/arrow-0.1.5.tar.gz#md5=a74c113613b2dd99640fae59d9da6e90 (from https://pypi.python.org/simple/arrow/), version: 0.1.5
Found link https://pypi.python.org/packages/ab/e1/0e3b915ceef2c1123978f57167f53cee829ca9ce1f66f4e635cee63e2ea6/arrow-0.3.5.tar.gz#md5=b6ffcc19a8f5a67fb8d18e3b80878137 (from https://pypi.python.org/simple/arrow/), version: 0.3.5
Found link https://pypi.python.org/packages/b8/17/90660f5f594f6bb698d1d4a238bf05daf05acebb2b6dacbb15fffa008cff/arrow-0.1.1.tar.gz#md5=359f36ace04fdee41f551cf1012c0832 (from https://pypi.python.org/simple/arrow/), version: 0.1.1
Found link https://pypi.python.org/packages/bf/fd/4e179c4c575be8d9e289e7962760bec6637f5f8e8984935a9b76f069a5ce/arrow-0.3.2.tar.gz#md5=9a4d35818ca5fd9d7be50512976f3feb (from https://pypi.python.org/simple/arrow/), version: 0.3.2
Found link https://pypi.python.org/packages/c8/1c/cbe0c43f9072e026800094d374a181f9b98d744193d0db55db3f449c50e1/arrow-0.1.6.tar.gz#md5=de16da2a01454750bd7ac236fdd39f83 (from https://pypi.python.org/simple/arrow/), version: 0.1.6
Found link https://pypi.python.org/packages/cf/cb/f935b978dbd768bf14ba8cb84add7e86a1fda079f18746f1dc7e36f6e04f/arrow-0.6.0.tar.gz#md5=8ae050225d46a079b0bc038a81fea2ba (from https://pypi.python.org/simple/arrow/), version: 0.6.0
Found link https://pypi.python.org/packages/d9/e7/8e2752def6e66cf4a7dc94a0d1a2c20082a962260e6d5a977d96166edb6e/arrow-0.3.0.tar.gz#md5=43048c10fa54b4dace276e9b2803619e (from https://pypi.python.org/simple/arrow/), version: 0.3.0
Found link https://pypi.python.org/packages/db/12/9e0b9a78a7fe64f3638300009e43bff474ce3469b084553b37ff6140d203/arrow-0.5.4.tar.gz#md5=92c69f04a05c5fb03d43597833dcd5fb (from https://pypi.python.org/simple/arrow/), version: 0.5.4
Found link https://pypi.python.org/packages/dc/33/41e768a0ce11cf22b63145f72a113b6d34758b55ea67100ea00fbe275cbb/arrow-0.4.6.tar.gz#md5=e073bdf6a3852558adcaeb42aeba2296 (from https://pypi.python.org/simple/arrow/), version: 0.4.6
Found link https://pypi.python.org/packages/e0/86/4eb5228a43042e9a80fe8c84093a8a36f5db34a3767ebd5e1e7729864e7b/arrow-0.12.1.tar.gz#md5=73ad9f1841a1277acc9b915838165c7b (from https://pypi.python.org/simple/arrow/), version: 0.12.1
Found link https://pypi.python.org/packages/e2/94/e99df2c68c316608336530abc2d38be6c26fe27ba088f7d03643ed86f7e4/arrow-0.3.3.tar.gz#md5=74042d50f253eafd69b94cea3cc9494f (from https://pypi.python.org/simple/arrow/), version: 0.3.3
Found link https://pypi.python.org/packages/eb/0f/64c1f723808f47e0569bb3b807a5045c4332c7601fbc489afd11d946c609/arrow-0.11.0.tar.gz#md5=ad60ca7fa6efccd7d45212f3a3c2cc6b (from https://pypi.python.org/simple/arrow/), version: 0.11.0
Found link https://pypi.python.org/packages/eb/eb/6591192dd6ed861a01aaa4d3ddd8a2bdf44406077a29aadf05b16b038ac1/arrow-0.4.0.tar.gz#md5=a3275a1fd50c94a983b6fe949d5c1082 (from https://pypi.python.org/simple/arrow/), version: 0.4.0
Found link https://pypi.python.org/packages/ed/4c/de43c83576b91899105981d7d46014469140aeec0cbfbe1075d014e9e6ba/arrow-0.4.3.tar.gz#md5=0caed6c28e4c48582bd4556aaefba352 (from https://pypi.python.org/simple/arrow/), version: 0.4.3
Found link https://pypi.python.org/packages/f2/4a/fabc7e78e9af8f04281db5122d173cd4e679208c5c3afbb0467ae9f353c7/arrow-0.1.3.tar.gz#md5=8aaace219714230ff874a0677652bc4f (from https://pypi.python.org/simple/arrow/), version: 0.1.3
Using version 0.12.1 (newest of versions: 0.1, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.6, 0.5.0, 0.5.4, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.12.1)
https://pypi.python.org:443 "GET /packages/e0/86/4eb5228a43042e9a80fe8c84093a8a36f5db34a3767ebd5e1e7729864e7b/arrow-0.12.1.tar.gz HTTP/1.1" 200 65356
Downloading arrow-0.12.1.tar.gz (65kB)
Downloading from URL https://pypi.python.org/packages/e0/86/4eb5228a43042e9a80fe8c84093a8a36f5db34a3767ebd5e1e7729864e7b/arrow-0.12.1.tar.gz#md5=73ad9f1841a1277acc9b915838165c7b (from https://pypi.python.org/simple/arrow/)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 71kB 10.6MB/s
Running setup.py (path:/tmp/pip-build-tJ08XH/arrow/setup.py) egg_info for package arrow
Running command python setup.py egg_info
running egg_info
creating pip-egg-info/arrow.egg-info
writing requirements to pip-egg-info/arrow.egg-info/requires.txt
writing pip-egg-info/arrow.egg-info/PKG-INFO
writing top-level names to pip-egg-info/arrow.egg-info/top_level.txt
writing dependency_links to pip-egg-info/arrow.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/arrow.egg-info/SOURCES.txt'
reading manifest file 'pip-egg-info/arrow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pip-egg-info/arrow.egg-info/SOURCES.txt'
Source in /tmp/pip-build-tJ08XH/arrow has version 0.12.1, which satisfies requirement arrow from https://pypi.python.org/packages/e0/86/4eb5228a43042e9a80fe8c84093a8a36f5db34a3767ebd5e1e7729864e7b/arrow-0.12.1.tar.gz#md5=73ad9f1841a1277acc9b915838165c7b
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/dist-packages (from arrow)
Collecting backports.functools_lru_cache>=1.2.1 (from arrow)
1 location(s) to search for versions of backports.functools-lru-cache:
* https://pypi.python.org/simple/backports-functools-lru-cache/
Getting page https://pypi.python.org/simple/backports-functools-lru-cache/
https://pypi.python.org:443 "GET /simple/backports-functools-lru-cache/ HTTP/1.1" 200 1384
Analyzing links from page https://pypi.python.org/simple/backports-functools-lru-cache/
Found link https://pypi.python.org/packages/00/9c/70c865c629d406531d05f46a5c5f68874f186bcc0424ed3bd7cbe54bfe7d/backports.functools_lru_cache-1.3.tar.gz#md5=b26a223250bd24ea2e0ad6ce47b19084 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.3
Found link https://pypi.python.org/packages/02/0b/91573feec859f794689fa46a62240526f4f1db829271ac2d98cf04a8efa2/backports.functools_lru_cache-1.4-py2.py3-none-any.whl#md5=6496f96517b2b0d22175e9f193664bc3 (from https://pypi.python.org/simple/backports-functools-lru-cache/) (requires-python:>=2.6), version: 1.4
Found link https://pypi.python.org/packages/03/8e/2424c0e65c4a066e28f539364deee49b6451f8fcd4f718fefa50cc3dcf48/backports.functools_lru_cache-1.5-py2.py3-none-any.whl#md5=5a93b4dac0cc414ceff28ff678713e31 (from https://pypi.python.org/simple/backports-functools-lru-cache/) (requires-python:>=2.6), version: 1.5
Found link https://pypi.python.org/packages/08/f7/2d48c54e0583197f6f953f9dca6356c966ee9edae45fcaf847cadae67651/backports.functools_lru_cache-1.1.tar.gz#md5=1c31e26546e12366608ca385e9cd9ffb (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.1
Found link https://pypi.python.org/packages/37/89/1eea4455e28c2b61818eccbf0a9d3d32cc5c6d190bf8ba64fbdd2ce3674d/backports.functools_lru_cache-1.0.1.zip#md5=c789ef439d189330b99872746a6d9e85 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.0.1
Found link https://pypi.python.org/packages/3f/b8/e1a790a5b4f47bd09505975193b3d34f7091cbdc92902196cb96e1efb154/backports.functools_lru_cache-1.0.2.tar.gz#md5=8213ec0264ce9dd554693e5f21e5c3d3 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.0.2
Found link https://pypi.python.org/packages/4e/91/0e93d9455254b7b630fb3ebe30cc57cab518660c5fad6a08aac7908a4431/backports.functools_lru_cache-1.4.tar.gz#md5=b954e7d5e2ca0f0f66ad2ed12ba800e5 (from https://pypi.python.org/simple/backports-functools-lru-cache/) (requires-python:>=2.6), version: 1.4
Found link https://pypi.python.org/packages/57/d4/156eb5fbb08d2e85ab0a632e2bebdad355798dece07d4752f66a8d02d1ea/backports.functools_lru_cache-1.5.tar.gz#md5=20f53f54cd3f04b3346ce75a54959754 (from https://pypi.python.org/simple/backports-functools-lru-cache/) (requires-python:>=2.6), version: 1.5
Found link https://pypi.python.org/packages/62/cc/f75ba5dedd1aa23bfd867eb3b3a7305000edeaf7febf61ea1982e9661b6b/backports.functools_lru_cache-1.0.zip#md5=304542b708222e85e33a2fa7306243bd (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.0
Found link https://pypi.python.org/packages/69/a0/23a679f5ff08f7b5496c508a6deb7e1145be81cad959c1536f48046ac2d5/backports.functools_lru_cache-1.0.3.tar.gz#md5=3d373b365c143bccf04eadea6e19171c (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.0.3
Found link https://pypi.python.org/packages/7f/a2/ae29dd42ac013a49446a5ec60f4357469b340430b5b9f4aa0aa362f8a1c4/backports.functools_lru_cache-1.2.tar.gz#md5=641ced3d7973b88cc5a89f37bad66a26 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.2
Found link https://pypi.python.org/packages/87/77/5b2fd33e46c8ed4d67b45337d9f7bb27d1a1d577536470b39c267b5ce093/backports.functools_lru_cache-1.2.1.tar.gz#md5=ce4b68c8a170ee4fc3abc0ab52296a03 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.2.1
Found link https://pypi.python.org/packages/ac/e7/d774d773d105dd726d2a530b10ef0d534b231d95058c31109564a7a90b28/backports.functools_lru_cache-1.2-py2.py3-none-any.whl#md5=b289a0e9674c426c3f08553da64a0e22 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.2
Found link https://pypi.python.org/packages/d1/0e/c473e3c37c34fea699d85d5b9e3caf712813c4cd2dcc0a5a64ec2a6867f7/backports.functools_lru_cache-1.2.1-py2.py3-none-any.whl#md5=d7258feba9addcafbd6647249477d5e2 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.2.1
Found link https://pypi.python.org/packages/d4/40/0b1db94fdfd71353ae67ec444ff28e0a7ecc25212d1cb94c291b6cd226f9/backports.functools_lru_cache-1.3-py2.py3-none-any.whl#md5=bf15e14320b577810100338e2fb94303 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.3
Found link https://pypi.python.org/packages/ee/0b/3f1b22b5b8b9246202f92f73e841ce1c45871e7a878a9c12f2fb613282a7/backports.functools_lru_cache-1.1-py2.py3-none-any.whl#md5=7d3f4be70b3ad775ac989ae4064ad075 (from https://pypi.python.org/simple/backports-functools-lru-cache/), version: 1.1
Using version 1.5 (newest of versions: 1.2.1, 1.3, 1.4, 1.5)
https://pypi.python.org:443 "GET /packages/03/8e/2424c0e65c4a066e28f539364deee49b6451f8fcd4f718fefa50cc3dcf48/backports.functools_lru_cache-1.5-py2.py3-none-any.whl HTTP/1.1" 200 7007
Downloading backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Downloading from URL https://pypi.python.org/packages/03/8e/2424c0e65c4a066e28f539364deee49b6451f8fcd4f718fefa50cc3dcf48/backports.functools_lru_cache-1.5-py2.py3-none-any.whl#md5=5a93b4dac0cc414ceff28ff678713e31 (from https://pypi.python.org/simple/backports-functools-lru-cache/) (requires-python:>=2.6)
Requirement already satisfied: six>=1.5 in /home/wilmardo/.local/lib/python2.7/site-packages (from python-dateutil->arrow)
Installing collected packages: backports.functools-lru-cache, arrow
Running setup.py install for arrow ... Running command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tJ08XH/arrow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ALHDyg-record/install-record.txt --single-version-externally-managed --compile --user --prefix=
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/arrow
copying arrow/__init__.py -> build/lib.linux-x86_64-2.7/arrow
copying arrow/api.py -> build/lib.linux-x86_64-2.7/arrow
copying arrow/arrow.py -> build/lib.linux-x86_64-2.7/arrow
copying arrow/factory.py -> build/lib.linux-x86_64-2.7/arrow
copying arrow/formatter.py -> build/lib.linux-x86_64-2.7/arrow
copying arrow/locales.py -> build/lib.linux-x86_64-2.7/arrow
copying arrow/parser.py -> build/lib.linux-x86_64-2.7/arrow
copying arrow/util.py -> build/lib.linux-x86_64-2.7/arrow
running install_lib
creating /home/wilmardo/.local/lib/python2.7/site-packages/arrow
copying build/lib.linux-x86_64-2.7/arrow/__init__.py -> /home/wilmardo/.local/lib/python2.7/site-packages/arrow
copying build/lib.linux-x86_64-2.7/arrow/api.py -> /home/wilmardo/.local/lib/python2.7/site-packages/arrow
copying build/lib.linux-x86_64-2.7/arrow/arrow.py -> /home/wilmardo/.local/lib/python2.7/site-packages/arrow
copying build/lib.linux-x86_64-2.7/arrow/factory.py -> /home/wilmardo/.local/lib/python2.7/site-packages/arrow
copying build/lib.linux-x86_64-2.7/arrow/formatter.py -> /home/wilmardo/.local/lib/python2.7/site-packages/arrow
copying build/lib.linux-x86_64-2.7/arrow/locales.py -> /home/wilmardo/.local/lib/python2.7/site-packages/arrow
copying build/lib.linux-x86_64-2.7/arrow/parser.py -> /home/wilmardo/.local/lib/python2.7/site-packages/arrow
copying build/lib.linux-x86_64-2.7/arrow/util.py -> /home/wilmardo/.local/lib/python2.7/site-packages/arrow
byte-compiling /home/wilmardo/.local/lib/python2.7/site-packages/arrow/__init__.py to __init__.pyc
byte-compiling /home/wilmardo/.local/lib/python2.7/site-packages/arrow/api.py to api.pyc
byte-compiling /home/wilmardo/.local/lib/python2.7/site-packages/arrow/arrow.py to arrow.pyc
byte-compiling /home/wilmardo/.local/lib/python2.7/site-packages/arrow/factory.py to factory.pyc
byte-compiling /home/wilmardo/.local/lib/python2.7/site-packages/arrow/formatter.py to formatter.pyc
byte-compiling /home/wilmardo/.local/lib/python2.7/site-packages/arrow/locales.py to locales.pyc
byte-compiling /home/wilmardo/.local/lib/python2.7/site-packages/arrow/parser.py to parser.pyc
byte-compiling /home/wilmardo/.local/lib/python2.7/site-packages/arrow/util.py to util.pyc
running install_egg_info
running egg_info
writing requirements to arrow.egg-info/requires.txt
writing arrow.egg-info/PKG-INFO
writing top-level names to arrow.egg-info/top_level.txt
writing dependency_links to arrow.egg-info/dependency_links.txt
reading manifest file 'arrow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'arrow.egg-info/SOURCES.txt'
Copying arrow.egg-info to /home/wilmardo/.local/lib/python2.7/site-packages/arrow-0.12.1-py2.7.egg-info
running install_scripts
writing list of installed files to '/tmp/pip-ALHDyg-record/install-record.txt'
done
Removing source in /tmp/pip-build-tJ08XH/arrow
Successfully installed arrow-0.12.1 backports.functools-lru-cache-1.5
Cleaning up...
test import
wilmardo@NUC-FLEX-01:/mnt/c/Users/wilmaro/Documents/Ubuntu$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wilmardo/.local/lib/python2.7/site-packages/arrow/__init__.py", line 3, in <module>
from .arrow import Arrow
File "/home/wilmardo/.local/lib/python2.7/site-packages/arrow/arrow.py", line 19, in <module>
from arrow import util, locales, parser, formatter
File "/home/wilmardo/.local/lib/python2.7/site-packages/arrow/parser.py", line 12, in <module>
from backports.functools_lru_cache import lru_cache # pragma: no cover
ImportError: No module named functools_lru_cache
>>>
pip install --user backports.functools_lru_cache==1.2.1
wilmardo@NUC-FLEX-01:/mnt/c/Users/wilmaro/Documents/Ubuntu$ pip install --user backports.functools_lru_cache==1.2.1
Collecting backports.functools_lru_cache==1.2.1
Using cached backports.functools_lru_cache-1.2.1-py2.py3-none-any.whl
Installing collected packages: backports.functools-lru-cache
Found existing installation: backports.functools-lru-cache 1.5
Uninstalling backports.functools-lru-cache-1.5:
Successfully uninstalled backports.functools-lru-cache-1.5
Successfully installed backports.functools-lru-cache-1.2.1
test import with 1.2.1
wilmardo@NUC-FLEX-01:/mnt/c/Users/wilmaro/Documents/Ubuntu$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
>>>
Is this due to https://github.com/crsmithdev/arrow/blob/master/setup.py#L44 in the setup.py file?
@systemcatch Good catch! ๐
Opened the PR to hotfix this for now, also reopened the issue over at jaraco/backports.functools_lru_cache
In the upstream ticket, I've responded that I'm unable to replicate the issue. We need to determine what is unique about the environments in which this issue is still present.
I notice in your logs, @wilmardo, that you are using --user to install. Perhaps that's related. Still, I tried it without replicating the issue:
$ PYTHONUSERBASE=/tmp/userenv python2.7 -m pip install --user arrow
Collecting arrow
Collecting backports.functools-lru-cache>=1.2.1; python_version == "2.7" (from arrow)
Using cached backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Collecting python-dateutil (from arrow)
Using cached python_dateutil-2.7.2-py2.py3-none-any.whl
Requirement already satisfied: six>=1.5 in /usr/local/lib/python2.7/site-packages (from python-dateutil->arrow)
Installing collected packages: backports.functools-lru-cache, python-dateutil, arrow
Successfully installed arrow-0.12.1 backports.functools-lru-cache-1.5 python-dateutil-2.7.2
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ PYTHONUSERBASE=/tmp/userenv python2.7 -c "import arrow.parser; print('worked!')"
worked!
Others have reported that when it's installed that the __init__.py is missing, but that's not what I see:
$ cat /tmp/userenv/lib/python/site-packages/backports/__init__.py
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
What do you see when you install for --user? What version of pip do you have? What do you see when you look at __path__ for backports?
$ PYTHONUSERBASE=/tmp/userenv python2.7 -c "import backports; print(backports.__path__)"
['/tmp/userenv/lib/python/site-packages/backports']
@jaraco I see the issue with replicating, I did a reset of my WSL and the issue was gone!
But to get to the bottom of this I tried to replicate my installation steps and had to do the following to get the error to pop up, each python command is a test if it is working:
bash history
5 pip install arrow
6 python
7 pip uninstall arrow
8 pip freeze
9 pip uninstall arrow backports.functools-lru-cache python-dateutil six
10 pip uninstall backports.functools-lru-cache python-dateutil six
11 pip install --upgrade pip
12 sudo -H pip install --upgrade pip
13 pip --version
14 pip install arrow
15 pip --user install arrow
16 pip install --user arrow
17 python
18 pip uninstall backports.functools-lru-cache python-dateutil six
19 pip uninstall arrow backports.functools-lru-cache python-dateutil six
20 sudo -H pip install arrow
21 python
22 pip uninstall arrow backports.functools-lru-cache python-dateutil six
23 sudo -H pip uninstall arrow backports.functools-lru-cache python-dateutil six
24 pip freeze
25 sudo pip install arrow
26 python
27 sudo pip uninstall arrow backports.functools-lru-cache python-dateutil six
34 sudo pip install arrow
35 python
36 sudo pip uninstall arrow
37 pip --user install arrow
38 pip install --user arrow
39 python
40 sudo pip install cookiecutter
41 python
42 pip freeze
43 sudo pip uninstall cookiecutter arrow backports.functools-lru-cache
44 pip install --user cookiecutter
45 python < broken!
I have no more time at the moment to retrace and find out which one of the command/combination of commands caused the issue.
Others have reported that when it's installed that the __init__.py is missing, but that's not what I see
I think this is the main issue, but it might be a permission issue in my case. If I remember correctly I installed with --user because cookiecutter advised it so and I got a permission error when installing without the --user flag. That is why in the log above I tried sudo, sudo -H, --user with pip to try and break it again.
What version of pip do you have?
``pip --version
pip 9.0.3 from /home/wilmardo/.local/lib/python2.7/site-packages (python 2.7)
> What do you see when you look at __path__ for backports?
python -c "import backports; print(backports.__path__)"
['/usr/local/lib/python2.7/dist-packages/backports']
```
Yep, there's a lot going on in that bash history, including installing and uninstalling of various packages to two different locations (system and user-local). And it seems likely there's a permissions issue if some files/packages/directories are installed sudo but then uninstalled without sudo. I think what I'd recommend at this point, if you wish to dig deeper, is to use Docker (or some other virtualization) to create an environment and replicate the failure... and share that Dockerfile or repo with the Dockerfile... if it's in a repo, we can trim it down until we find a minimal use case that replicates the issue, at which point we can assess if there's a defect in pip or backports that can be addressed.
It's interesting that you see 'backports' in the system site packages. I would have expected that to have been removed in line 43... so it may be worthwhile to trace how Python thinks there's a backports there. But even so that may be insufficient given how much state had to be mutated to get there. The Docker replication would probably still be needed.
This is still an issue on python 2.6 since the current setup.py require only covers 2.7:
Python 2.6.9 (unknown, Nov 9 2016, 21:08:27)
[GCC 4.8.4] on linux3
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow.parser
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/arrow/__init__.py", line 3, in <module>
from .arrow import Arrow
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/arrow/arrow.py", line 19, in <module>
from arrow import util, locales, parser, formatter
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/arrow/parser.py", line 12, in <module>
from backports.functools_lru_cache import lru_cache # pragma: no cover
ImportError: No module named backports.functools_lru_cache
I guess currently in the setup.py file the require is defined as -
":python_version=='2.7'": ['backports.functools_lru_cache>=1.2.1'],
but should be -
":python_version<='2.7'": ['backports.functools_lru_cache>=1.2.1'],
or using a fixed backports version as suggested above.
python2.7ไธ
pip install arrow==0.12.0 ,over~~!! ไธ่ฆๆๆฐ็ๆฌ ๆๆฐ็ๆฌๆ้ฎ้ข
FWIW, I just ran into this error when installing aws-sam-cli, which depends on arrow. In my case, the issue was indeed related to installing in the user scheme. This caused pip to install backports.functools_lru_cache in my home directory site-packages, but I _also_ have backports.configparser installed globally. It seems as if the presence of the 'backports' module in global prevents python from seeing the one in my user directory. This problem seems to be specific to 'backports' for some reason.
I was able to temporarily work around the problem by globally installing backports_functools_lru_cache.
@bgruber that's useful to know, what version of python were you using?
@bgruber that's useful to know, what version of python were you using?
2.7.15 on ubuntu 18.10.
Is this issue still occurring for people? I am unable to reproduce this on the latest arrow version and python 2.17.16.
Here are the dependencies (and their respective versions) that are installed when I run pip install -U arrow in a fresh virtual environment: arrow-0.13.2 backports.functools-lru-cache-1.5 python-dateutil-2.8.0 six-1.12.0.
If anyone is still having issues, feel free to report it here. For now, we will close this issue as it seems to be an issue with either backports or pip.
my issue does appear to be resolved on ubuntu 19.04 with python 2.7.16.
Thanks for letting us know!
I think it is worth compiling a list of solutions to try if this issue occurs again for someone in the future:
pip install --upgrade pip2.7.16Hi,
Details follow:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
$ pip -V
pip 19.1.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
$ python -V
Python 2.7.15+
$ pip list | grep arrow
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.
arrow 0.14.2
$ pip list | grep back
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.
backports.functools-lru-cache 1.5
$ python
Python 2.7.15+ (default, Nov 27 2018, 23:36:35)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/arrow/__init__.py", line 2, in <module>
from .api import get, now, utcnow
File "/usr/local/lib/python2.7/dist-packages/arrow/api.py", line 10, in <module>
from arrow.factory import ArrowFactory
File "/usr/local/lib/python2.7/dist-packages/arrow/factory.py", line 17, in <module>
from arrow import parser
File "/usr/local/lib/python2.7/dist-packages/arrow/parser.py", line 14, in <module>
from backports.functools_lru_cache import lru_cache # pragma: no cover
ImportError: No module named functools_lru_cache
>>>
Has this been RCA-ed as fixed if I upgrade to 2.7.16? As you can see I'm an LTS kind of person - prefer stuff to just work, not keen to diverge from the standard install if I can avoid it.
@timothycdbarnes thanks for the detailed feedback. Think you can answer a couple of follow up questions for me?
I am beginning to suspect that this error may be caused by either pip or setuptools version discrepancies. Although we are unable to reproduce this issue, we are attempting a possible fix in this PR: https://github.com/crsmithdev/arrow/pull/620.
We have attempted a fix for this in arrow 0.14.4. Please try this new release and report back if this still occurs. Thanks.
hi @jadchaar
unfortunately I am faced with the same issue, here are my details:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
$ pip -V
pip 20.1.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
$ python -V
Python 2.7.16
$ pip list | grep arrow
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
arrow 0.15.7
$ pip list | grep back
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
backports.functools-lru-cache 1.6.1
$ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/arrow/__init__.py", line 3, in <module>
from .api import get, now, utcnow
File "/usr/local/lib/python2.7/dist-packages/arrow/api.py", line 10, in <module>
from arrow.factory import ArrowFactory
File "/usr/local/lib/python2.7/dist-packages/arrow/factory.py", line 18, in <module>
from arrow import parser
File "/usr/local/lib/python2.7/dist-packages/arrow/parser.py", line 15, in <module>
from backports.functools_lru_cache import lru_cache # pragma: no cover
ImportError: No module named functools_lru_cache
>>>
Hi @mkumar118, I recommend removing arrow, backports and backports.functools_lru_cache globally and installing them in a virtual environment. This issue seems to stem from having backports installed globally and this conflicts with the local usage in a venv.
Hi @jadchaar
thanks for your input. In my case, setting up a virtual env wouldn't work because these modules are used by a web2py application. If I set up a virtual env, I'll have to modify the entire framework.
For now, my issue is resolved by uninstalling the latest versions of arrow and backports and installing version 0.12.0 of arrow globally.
thank you,
Most helpful comment
I am running into this issue when installing audreyr/cookiecutter (due to cookiecutter > jinja2-time > arrow).
The issue seems to be that pip looks for
backports.functools_lru_cache>=1.2.1and not the pinnedbackports.functools_lru_cache==1.2.1. If I remove the 1.5 version and install the 1.2.1 it works fine.What does needs fixing here and where does it needs to be fixed?
pip install
pip install -v
test import
pip install --user backports.functools_lru_cache==1.2.1
test import with 1.2.1