why is the pip install process stuck on ''Installing collected packages" step?

12,442

I see this may be a problem other users are having. Here is a github link describing the same problem. There are a few others on the Conda GitHub page. Some of the answers that come from that post are:

  • Make sure you are up to date on your root conda environment. try: conda upgrade conda

  • Create a brand new virtual env

Micheal Grant, who is a Director for Technical Consulting at Anaconda replied to that thread with this:

That said, when I look at the debug output, I'm finding that it's not able to prune back the package list very well. The more "old" packages it has to consider the higher the likelihood that this kind of solver stall happens. Thankfully it is a lot less likely than it used to be.

Share:
12,442
Chenlu
Author by

Chenlu

Curious about Data Science and Computer Science problems.

Updated on June 04, 2022

Comments

  • Chenlu
    Chenlu almost 2 years

    I'm trying to pip install some python libraries in a virtual environment created by conda create, but for some packages, the installation were stuck on the step "Installing collected packages: . Take pandas as an example: My command and output are as follows:

    pip install pandas --no-cache-dir
    Collecting pandas
      Downloading https://files.pythonhosted.org/packages/99/12/bf4c58eea94cea4f91ff931f284146337814fb8546e6eb0b52584446fd52/pandas-0.24.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (16.3MB)
    100% |████████████████████████████████| 16.3MB 11.4MB/s 
    Requirement already satisfied: numpy>=1.12.0 in /anaconda/envs/testctds2/lib/python3.6/site-packages (from pandas) (1.16.1)
    Requirement already satisfied: pytz>=2011k in /anaconda/envs/testctds2/lib/python3.6/site-packages (from pandas) (2018.9)
    Requirement already satisfied: python-dateutil>=2.5.0 in /anaconda/envs/testctds2/lib/python3.6/site-packages (from pandas) (2.8.0)
    Requirement already satisfied: six>=1.5 in /anaconda/envs/testctds2/lib/python3.6/site-packages (from python-dateutil>=2.5.0->pandas) (1.12.0)
    Installing collected packages: pandas
    

    The process just hang there (at least for 30 min) until I control+z to quit (control+c got no response).

    What I have tried:

    1. conda install pandas worked well, which is also the recommended way to install pandas. I just don't understand why pip install didn't work, as it's assumed to and this situation also happened to some other libraries such as numpy, scipy, and scikit-learn.

    2. I also tried without --no-cache-dir or -vvv to see more details, but in either case there were no more information or error code after the line "Installing collected packages: pandas"

    3. I tried the command in a new terminal window. Magically numpy can be installed very quickly by "pip install numpy", but it didn't work with pandas or scipy.

    • Hamid
      Hamid about 5 years
      use conda install pandas, works better
    • MattR
      MattR about 5 years
      I believe pandas comes with Anacoda, right?
    • Chenlu
      Chenlu about 5 years
      @Hamid, thanks. I mentioned conda install worked well in the question. In fact I have a reason to use pip install in my case which is hidden in the question. Pandas and many other libraries come as the dependencies of my own python package and I have to use pip install for my package as there are no public distributions. So I would like to understand what went wrong with pip install.
    • Chenlu
      Chenlu about 5 years
      @MattR, thanks. pandas comes with anaconda, but not in anaconda virtual envs, although you can pre install pandas together with anaconda virtual envs. My purpose is to understand the situation, not to install pandas, since pandas was not the only package that got stuck.