0

I have a problem with pip. I have created my enviroment by miniconda. I have run this command

conda env create --file enviroment.yml

enviroment.yml

name: data-science-handbook
channels:
  - conda-forge
dependencies:
  - python=3.10

requirements.txt

numpy==1.11.1
pandas==0.18.1
scipy==0.17.1
scikit-learn==0.17.1
scikit-image==0.12.3
pillow==3.4.2
matplotlib==1.5.1
seaborn==0.7.0
jupyter
notebook
line_profiler
memory_profiler
numexpr
pandas-datareader
netcdf4

I have searched google for a couple of hours, but I have not solved.

After run pip install -r requirements.txt

Collecting numpy==1.11.1
  Downloading numpy-1.11.1.zip (4.7 MB)
     ---------------------------------------- 4.7/4.7 MB 6.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting pandas==0.18.1
  Downloading pandas-0.18.1.zip (8.5 MB)
     ---------------------------------------- 8.5/8.5 MB 9.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting scipy==0.17.1
  Downloading scipy-0.17.1.zip (13.8 MB)
     ---------------------------------------- 13.8/13.8 MB 9.8 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting scikit-learn==0.17.1
  Downloading scikit-learn-0.17.1.tar.gz (7.9 MB)
     ---------------------------------------- 7.9/7.9 MB 10.1 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting scikit-image==0.12.3
  Downloading scikit-image-0.12.3.tar.gz (20.7 MB)
     ---------------------------------------- 20.7/20.7 MB 8.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [5 lines of output]
      To install scikit-image from source, you will need numpy.
      Install numpy with pip:
      pip install numpy
      Or use your operating system package manager. For more
      details, see http://scikit-image.org/docs/stable/install.html
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I tried install with conda. conda install --file requirements.txt and still error

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - matplotlib==1.5.1
  - scikit-image==0.12.3
  - pandas==0.18.1
  - scikit-learn==0.17.1
  - numpy==1.11.1
  - pillow==3.4.2
  - scipy==0.17.1
  - seaborn==0.7.0

Current channels:

  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.


How can i fix it? please help me. Thanks

Manh Do
  • 111
  • 8
  • 3
    "To install scikit-image from source, you will need numpy… Install numpy with pip: pip install numpy"—have you done this, as the error message tells you to do? – ChrisGPT was on strike Dec 11 '22 at 18:48
  • (Side note, I wouldn't recommend mixing `conda` and `pip`. Pick one tool and use it consistently.) – ChrisGPT was on strike Dec 11 '22 at 18:48
  • @Chris, tks, first I tried **conda install --file requirements.txt** but error that I have not resolved. then i use pip – Manh Do Dec 11 '22 at 18:52
  • I dont understand message, ple explain for me – Manh Do Dec 11 '22 at 18:55
  • 1
    @MạnhĐỗ Your first error mentions a dependency for scikit-image. You must install numpy first before installing scikit-image. Either add this library manually via pip command line or add it to your requirements.txt file. | VIA PIP: pip install numpy | VIA REQUIREMENTS.TXT: add "numpy" before "scikit-learn" on its own line – poiboi Dec 11 '22 at 21:26
  • @poiboi, is not it okay to write it in order one and two?, it has to be installed manually like that? – Manh Do Dec 11 '22 at 22:01
  • You can put the `pip` list into `environment.yml`, under the `pip` key, see [here](https://stackoverflow.com/a/35245610/8508004) and [simpler example here](https://discourse.jupyter.org/t/how-to-launch-binder-with-python-3-8/9380/2?u=fomightez). – Wayne Dec 12 '22 at 20:33

0 Answers0