scrapinghub / dateparser

python parser for human readable dates
BSD 3-Clause "New" or "Revised" License
2.55k stars 465 forks source link

pip upgrade problem #202

Closed spacedr closed 8 years ago

spacedr commented 8 years ago

I have been using dateparser and just tried to upgrade to the latest version with pip. However, I get the following:

~ peter$ pip install --upgrade dateparser
Collecting dateparser
  Using cached dateparser-0.4.0-py2.py3-none-any.whl
Requirement already up-to-date: jdatetime in ./anaconda/lib/python3.4/site-packages (from dateparser)
Requirement already up-to-date: umalqurra in ./anaconda/lib/python3.4/site-packages (from dateparser)
Collecting ruamel.yaml (from dateparser)
  Using cached ruamel.yaml-0.11.11.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 2621, in _dep_map
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 2696, in __getattr__
    AttributeError: _Distribution__dep_map

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/dm/_7qsdfv95sv7wcbpzbq39mph0000gn/T/pip-build-z06lm20f/ruamel.yaml/setup.py", line 712, in <module>
        main()
      File "/private/var/folders/dm/_7qsdfv95sv7wcbpzbq39mph0000gn/T/pip-build-z06lm20f/ruamel.yaml/setup.py", line 709, in main
        setup(**kw)
      File "/Users/peter/anaconda/lib/python3.4/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/setuptools/dist.py", line 272, in __init__
      File "/Users/peter/anaconda/lib/python3.4/distutils/dist.py", line 280, in __init__
        self.finalize_options()
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/setuptools/dist.py", line 326, in finalize_options
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 2395, in require
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 2640, in requires
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 2629, in _dep_map
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 1427, in is_invalid_marker
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 1552, in _markerlib_evaluate
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 1540, in _translate_metadata2
      File "/Users/peter/anaconda/lib/python3.4/site-packages/setuptools-18.7.1-py3.4.egg/pkg_resources/__init__.py", line 1540, in <genexpr>
    ValueError: too many values to unpack (expected 2)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/dm/_7qsdfv95sv7wcbpzbq39mph0000gn/T/pip-build-z06lm20f/ruamel.yaml/
~ peter$ python --version
Python 3.4.4 :: Anaconda 4.0.0 (x86_64)        
~ peter$ sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.11.5
BuildVersion:   15F34
~ peter$ 

Installing the previous version works:

~ peter$ pip install --upgrade dateparser==0.3.5
Requirement already up-to-date: dateparser==0.3.5 in ./anaconda/lib/python3.4/site-packages
Collecting pytz (from dateparser==0.3.5)
  Using cached pytz-2016.4-py2.py3-none-any.whl
Requirement already up-to-date: regex in ./anaconda/lib/python3.4/site-packages (from dateparser==0.3.5)
Requirement already up-to-date: jdatetime in ./anaconda/lib/python3.4/site-packages (from dateparser==0.3.5)
Collecting python-dateutil (from dateparser==0.3.5)
  Using cached python_dateutil-2.5.3-py2.py3-none-any.whl
Requirement already up-to-date: umalqurra in ./anaconda/lib/python3.4/site-packages (from dateparser==0.3.5)
Requirement already up-to-date: PyYAML in ./anaconda/lib/python3.4/site-packages (from dateparser==0.3.5)
Requirement already up-to-date: six>=1.5 in ./anaconda/lib/python3.4/site-packages (from python-dateutil->dateparser==0.3.5)
Installing collected packages: pytz, python-dateutil
  Found existing installation: pytz 2016.2
    DEPRECATION: Uninstalling a distutils installed project (pytz) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling pytz-2016.2:
      Successfully uninstalled pytz-2016.2
  Found existing installation: python-dateutil 2.4.2
    Uninstalling python-dateutil-2.4.2:
      Successfully uninstalled python-dateutil-2.4.2
Successfully installed python-dateutil-2.5.1 pytz-2016.4
~ peter$ 
redapple commented 8 years ago

I tested on Ubuntu 16.04 within a Python 3.5.1 virtualenv and it worked fine, but it used a .whl for ruamel.yaml and your logs (anaconda?) show that ruamel.yaml is built from source

Using cached ruamel.yaml-0.11.11.tar.gz

Can you install without cache and/or forcing wheels?

My logs:

$ mkvirtualenv --python=/usr/bin/python3 dateparser-upgrade
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/paul/.virtualenvs/dateparser-upgrade/bin/python3
Also creating executable in /home/paul/.virtualenvs/dateparser-upgrade/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/paul/.virtualenvs/dateparser-upgrade/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/paul/.virtualenvs/dateparser-upgrade/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/paul/.virtualenvs/dateparser-upgrade/bin/preactivate
virtualenvwrapper.user_scripts creating /home/paul/.virtualenvs/dateparser-upgrade/bin/postactivate
virtualenvwrapper.user_scripts creating /home/paul/.virtualenvs/dateparser-upgrade/bin/get_env_details

(dateparser-upgrade) ~$ pip install --upgrade dateparser==0.3.5
Collecting dateparser==0.3.5
  Downloading dateparser-0.3.5-py2.py3-none-any.whl (52kB)
    100% |████████████████████████████████| 61kB 594kB/s 
Collecting pytz (from dateparser==0.3.5)
  Using cached pytz-2016.4-py2.py3-none-any.whl
Collecting regex (from dateparser==0.3.5)
Collecting umalqurra (from dateparser==0.3.5)
Collecting PyYAML (from dateparser==0.3.5)
  Downloading PyYAML-3.11.zip (371kB)
    100% |████████████████████████████████| 378kB 508kB/s 
Collecting python-dateutil (from dateparser==0.3.5)
  Using cached python_dateutil-2.5.3-py2.py3-none-any.whl
Collecting jdatetime (from dateparser==0.3.5)
Collecting six>=1.5 (from python-dateutil->dateparser==0.3.5)
  Using cached six-1.10.0-py2.py3-none-any.whl
Building wheels for collected packages: PyYAML
  Running setup.py bdist_wheel for PyYAML ... done
  Stored in directory: /home/paul/.cache/pip/wheels/4a/bf/14/d79994d19a59d4f73efdafb8682961f582d45ed6b459420346
Successfully built PyYAML
Installing collected packages: pytz, regex, umalqurra, PyYAML, six, python-dateutil, jdatetime, dateparser
Successfully installed PyYAML-3.11 dateparser-0.3.5 jdatetime-1.8.1 python-dateutil-2.5.3 pytz-2016.4 regex-2016.6.24 six-1.10.0 umalqurra-0.2

(dateparser-upgrade) :~$ pip install --upgrade dateparser
Collecting dateparser
  Using cached dateparser-0.4.0-py2.py3-none-any.whl
Requirement already up-to-date: umalqurra in ./.virtualenvs/dateparser-upgrade/lib/python3.5/site-packages (from dateparser)
Requirement already up-to-date: jdatetime in ./.virtualenvs/dateparser-upgrade/lib/python3.5/site-packages (from dateparser)
Requirement already up-to-date: regex in ./.virtualenvs/dateparser-upgrade/lib/python3.5/site-packages (from dateparser)
Requirement already up-to-date: python-dateutil in ./.virtualenvs/dateparser-upgrade/lib/python3.5/site-packages (from dateparser)
Collecting ruamel.yaml (from dateparser)
  Using cached ruamel.yaml-0.11.11-cp35-cp35m-manylinux1_x86_64.whl
Requirement already up-to-date: pytz in ./.virtualenvs/dateparser-upgrade/lib/python3.5/site-packages (from dateparser)
Requirement already up-to-date: six>=1.5 in ./.virtualenvs/dateparser-upgrade/lib/python3.5/site-packages (from python-dateutil->dateparser)
Installing collected packages: ruamel.yaml, dateparser
  Found existing installation: dateparser 0.3.5
    Uninstalling dateparser-0.3.5:
      Successfully uninstalled dateparser-0.3.5
Successfully installed dateparser-0.4.0 ruamel.yaml-0.11.11
waqasshabbir commented 8 years ago

@spacedr I tested on Mac OS X 10.10.5 with latest miniconda, seems to work fine for me.

Also, did you try installing ruamel.yaml prior to upgrading dateparser?

(myenv)archer:~ waqas$ pip install -U dateparser
Collecting dateparser
  Using cached dateparser-0.4.0-py2.py3-none-any.whl
Requirement already up-to-date: regex in ./miniconda3/envs/myenv/lib/python3.5/site-packages (from dateparser)
Collecting ruamel.yaml (from dateparser)
Requirement already up-to-date: jdatetime in ./miniconda3/envs/myenv/lib/python3.5/site-packages (from dateparser)
Requirement already up-to-date: python-dateutil in ./miniconda3/envs/myenv/lib/python3.5/site-packages (from dateparser)
Requirement already up-to-date: umalqurra in ./miniconda3/envs/myenv/lib/python3.5/site-packages (from dateparser)
Requirement already up-to-date: pytz in ./miniconda3/envs/myenv/lib/python3.5/site-packages (from dateparser)
Requirement already up-to-date: six>=1.5 in ./miniconda3/envs/myenv/lib/python3.5/site-packages (from python-dateutil->dateparser)
Installing collected packages: ruamel.yaml, dateparser
  Found existing installation: dateparser 0.3.5
    Uninstalling dateparser-0.3.5:
      Successfully uninstalled dateparser-0.3.5
Successfully installed dateparser-0.4.0 ruamel.yaml-0.11.11
(myenv)archer:~ waqas$ which python
/Users/waqas/miniconda3/envs/myenv/bin/python
(myenv)archer:~ waqas$ python --version
Python 3.5.1 :: Continuum Analytics, Inc.
spacedr commented 8 years ago

Yes, the problem arises when trying to install ruamel.yaml. I found another having the same problem: https://bitbucket.org/ruamel/yaml/issues/37/osx-not-able-to-install-using-pip#comment-None

I also tried to install with the --no-cache-diroption (if that was the suggestion) and with --only-binary ruamel.yaml, but no success.

spacedr commented 8 years ago

After upgrading python to version 3.5.1 it now works to install dateparser-0.4.0.

waqasshabbir commented 8 years ago

Alright, I'll close this issue then. Thanks for reporting this @spacedr!