Error in pip install datefinder

Deadly 提交于 2019-12-12 23:30:29

问题


While I was trying to pip install python package "datefinder", I met the error about regex and visual c++. I have viewed lots of Stackoverflow posts and cannot find a solution yet. One post is similar but got no reply. Any comment is appreciated!

C:\Users\sheldonc\Downloads>pip install datefinder-0.6.1-py2.py3-none-any.whl

Processing c:\users\sheldonc\downloads\datefinder-0.6.1-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil>=2.4.2 in c:\users\sheldonc\appdata\local\programs\python\python36-32\lib\site-packages (from datefinder==0.6.1)
Collecting regex==2016.01.10 (from datefinder==0.6.1)
  Using cached regex-2016.01.10.tar.gz
Requirement already satisfied: pytz in c:\users\sheldonc\appdata\local\programs\python\python36-32\lib\site-packages (from datefinder==0.6.1)
Requirement already satisfied: six>=1.5 in c:\users\sheldonc\appdata\local\programs\python\python36-32\lib\site-packages (from python-dateutil>=2.4.2->datefinder==0.6.1)
Installing collected packages: regex, datefinder
  Running setup.py install for regex ... error
    Complete output from command c:\users\sheldonc\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\sheldonc\\AppData\\Local\\Temp\\pip-build-iv39m2te\\regex\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\sheldonc\AppData\Local\Temp\pip-ht1mrgoz-record\install-record.txt --single-version-externally-managed --compile:
    c:\users\sheldonc\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\dist.py:334: UserWarning: Normalizing '2016.01.10' to '2016.1.10'
      normalized_version,
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.6
    copying Python3\regex.py -> build\lib.win32-3.6
    copying Python3\_regex_core.py -> build\lib.win32-3.6
    copying Python3\test_regex.py -> build\lib.win32-3.6
    running build_ext
    building '_regex' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    ----------------------------------------
Command "c:\users\sheldonc\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\sheldonc\\AppData\\Local\\Temp\\pip-build-iv39m2te\\regex\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\sheldonc\AppData\Local\Temp\pip-ht1mrgoz-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\sheldonc\AppData\Local\Temp\pip-build-iv39m2te\regex\

回答1:


There is hardcoded value of regex version in setup.py. You need to download source code from https://github.com/akoumjian/datefinder and change regex version from regex==2016.01.10 to regex>=2016.01.10 or your latest. e.g.:

line 85: install_requires=['regex>=2016.01.10', 'python-dateutil>=2.4.2', 'pytz'],

Then install with

pip install ./path_to_datefinder_source


来源:https://stackoverflow.com/questions/44016287/error-in-pip-install-datefinder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!