Updates of pyOpenSSL and pandas using 'pip' fail with “TypeError: resolve() got an unexpected keyword argument 'replace_conflicting'”

前端 未结 2 1122
北恋
北恋 2021-01-14 10:50

When I attempt to update or install any version of pandas or pyOpenSSL(with any instance of sudo pip --[un]install|update [--no-use-wheel] [p

相关标签:
2条回答
  • 2021-01-14 11:03

    If you are on OSX, the easiest solution in my opinion to avoid errors like you are having is to use Homebrew to manage the installation of Python, pip and libraries like pandas.

    If you are already using Homebrew (it was unclear from your question). Try running brew doctor and see if there are any reported errors.

    To get pip working in concert with Homebrew:

    • ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" to install Homebrew.

    • brew doctor and make sure you get no errors from running this command. Follow what it recommends, especially concerning the $PATH environment variable.

    • brew install python to install Python 2.7 (and pip)

    • pip install pandas

    0 讨论(0)
  • 2021-01-14 11:10

    A likely cause is the presence of multiple versions of setuptools, with an older version earlier on the Python path than the newer one. This can be temporarily overcome for the purposes of installation by beginning your invocations of pip with

    PYTHONPATH=/PATH_TO_YOUR_CURRENT_PACKAGES/site-packages pip ...
    

    You can confirm that this is the case by executing

    import pkg_resources
    pkg_resources.__file__
    

    in Python and noting that the pkg_resources.pyc returned is not in the location of your current site packages.

    In some cases this can also be corrected by ensuring that the pkg_resources.pyc in your site packages directory in executed, rather than the one in your system packages directory (e.g., by deleting the latter).

    0 讨论(0)
提交回复
热议问题