Failed to conda_install "__future__" Python package

I tried to install 2 python packages: "matplotlib” and "future"

"matplotlib” installed fine, but "future" failed.

I use a Windows 10 laptop.

I tried to reproduce here the entire situation (commands I used and what the response was from RStudio).

### TRY TO INSTALLL ("matplotlib") AND SUCCEED


> py_discover_config()
about to do py_discover_config()python:         C:/Users/userXYZ/AppData/Local/r-miniconda/envs/r-reticulate/python.exe
libpython:      C:/Users/userXYZ/AppData/Local/r-miniconda/envs/r-reticulate/python36.dll
pythonhome:     C:/Users/userXYZ/AppData/Local/r-miniconda/envs/r-reticulate
version:        3.6.7 (default, Dec  6 2019, 07:03:06) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/userXYZ/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages/numpy
numpy_version:  1.17.4




> files_list_reticulate_py_packages = list.files(path = "C:/Users/userXYZ/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages")

> files_list_reticulate_py_packages[grep("matplotlib", files_list_reticulate_py_packages)]
character(0)

> packages_want = c("matplotlib")
> conda_install(envname = "r-reticulate", packages = packages_want)
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

# All requested packages already installed.

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: Path 2 ending with ~1\AppData\Local\R-MINI~1\envs\r-reticulate

  added || updated specs:
    - matplotlib
    - python


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2019.11.28         |           py36_0         148 KB  conda-forge
    cycler-0.10.0              |             py_2           9 KB  conda-forge
    freetype-2.10.0            |       h563cfd7_1         476 KB  conda-forge
    icu-64.2                   |       he025d50_1        14.1 MB  conda-forge
    jpeg-9c                    |    hfa6e2cd_1001         314 KB  conda-forge
    kiwisolver-1.1.0           |   py36he980bc4_0          61 KB  conda-forge
    libclang-9.0.1             |default_hf44288c_0        20.8 MB  conda-forge
    libpng-1.6.37              |       h7602738_0         1.3 MB  conda-forge
    matplotlib-3.1.2           |           py36_1           7 KB  conda-forge
    matplotlib-base-3.1.2      |   py36h2981e6d_1         6.6 MB  conda-forge
    pyparsing-2.4.6            |             py_0          59 KB  conda-forge
    pyqt-5.12.3                |   py36h6538335_1         4.7 MB  conda-forge
    python-dateutil-2.8.1      |             py_0         220 KB  conda-forge
    qt-5.12.5                  |       h7ef1ec2_0       104.4 MB  conda-forge
    tornado-6.0.3              |   py36hfa6e2cd_0         639 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       153.8 MB

The following NEW packages will be INSTALLED:

  cycler             conda-forge||noarch::cycler-0.10.0-py_2
  freetype           conda-forge||win-64::freetype-2.10.0-h563cfd7_1
  icu                conda-forge||win-64::icu-64.2-he025d50_1
  jpeg               conda-forge||win-64::jpeg-9c-hfa6e2cd_1001
  kiwisolver         conda-forge||win-64::kiwisolver-1.1.0-py36he980bc4_0
  libclang           conda-forge||win-64::libclang-9.0.1-default_hf44288c_0
  libpng             conda-forge||win-64::libpng-1.6.37-h7602738_0
  matplotlib         conda-forge||win-64::matplotlib-3.1.2-py36_1
  matplotlib-base    conda-forge||win-64::matplotlib-base-3.1.2-py36h2981e6d_1
  pyparsing          conda-forge||noarch::pyparsing-2.4.6-py_0
  pyqt               conda-forge||win-64::pyqt-5.12.3-py36h6538335_1
  python-dateutil    conda-forge||noarch::python-dateutil-2.8.1-py_0
  qt                 conda-forge||win-64::qt-5.12.5-h7ef1ec2_0
  tornado            conda-forge||win-64::tornado-6.0.3-py36hfa6e2cd_0

The following packages will be UPDATED:

  ca-certificates    pkgs||main::ca-certificates-2019.11.27~ --> conda-forge::ca-certificates-2019.11.28-hecc5488_0

The following packages will be SUPERSEDED by a higher-priority channel:

  certifi                                         pkgs||main --> conda-forge
  openssl              pkgs||main::openssl-1.1.1d-he774522_3 --> conda-forge::openssl-1.1.1d-hfa6e2cd_0
  python                pkgs||main::python-3.6.10-h9f7ef89_0 --> conda-forge::python-3.6.7-he025d50_1006



Downloading and Extracting Packages
certifi-2019.11.28   | 148 KB    | ########## | 100% 
freetype-2.10.0      | 476 KB    | ########## | 100% 
libclang-9.0.1       | 20.8 MB   | ########## | 100% 
matplotlib-3.1.2     | 7 KB      | ########## | 100% 
pyqt-5.12.3          | 4.7 MB    | ########## | 100% 
tornado-6.0.3        | 639 KB    | ########## | 100% 
cycler-0.10.0        | 9 KB      | ########## | 100% 
qt-5.12.5            | 104.4 MB  | ########## | 100% 
kiwisolver-1.1.0     | 61 KB     | ########## | 100% 
python-dateutil-2.8. | 220 KB    | ########## | 100% 
matplotlib-base-3.1. | 6.6 MB    | ########## | 100% 
libpng-1.6.37        | 1.3 MB    | ########## | 100% 
jpeg-9c              | 314 KB    | ########## | 100% 
icu-64.2             | 14.1 MB   | ########## | 100% 
pyparsing-2.4.6      | 59 KB     | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done



> files_list_reticulate_py_packages = list.files(path = "C:/Users/userXYZ/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages")


> files_list_reticulate_py_packages[grep("matplotlib", files_list_reticulate_py_packages)]
[1] "matplotlib"                       "matplotlib-3.1.2-py3.6-nspkg.pth"
[3] "matplotlib-3.1.2.dist-info"


### TRY TO INSTALLL ("__future__") AND FAIL
      
> files_list_reticulate_py_packages[grep("future", files_list_reticulate_py_packages)]
character(0)
> packages_want = c("__future__")
> 
> 
> conda_install(envname = "r-reticulate", packages = packages_want)
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\USERXYZ~1\AppData\Local\R-MINI~1\envs\r-reticulate

  added / updated specs:
    - python


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2019.11.28         |           py36_0         154 KB
    ------------------------------------------------------------
                                           Total:         154 KB

The following packages will be UPDATED:

  openssl            conda-forge::openssl-1.1.1d-hfa6e2cd_0 --> pkgs/main::openssl-1.1.1d-he774522_3
  python             conda-forge::python-3.6.7-he025d50_10~ --> pkgs/main::python-3.6.10-h9f7ef89_0

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates    conda-forge::ca-certificates-2019.11.~ --> pkgs/main::ca-certificates-2019.11.27-0
  certifi                                       conda-forge --> pkgs/main



Downloading and Extracting Packages
certifi-2019.11.28   | 154 KB    | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.

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

  - __future__

Current channels:

  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/noarch
  - 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.


Error: one or more Python packages failed to install [error code 1]
> 
> files_list_reticulate_py_packages = list.files(path = "C:/Users/userXYZ/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages")
> 
> files_list_reticulate_py_packages[grep("future", files_list_reticulate_py_packages)]
character(0)


To overcome this issue, and make your post more readable, post your console output as "formatted code", here is how to do it.

Hi andresrcs.
Thank you. Live and learn!

Unfortunately, the site does not allow me to edit the post itself, only its title.

studiosa

Actually, you can, just look for the pencil icon at the bottom of your post

image

You can find more instructions here:

Thank you very much. I was looking for the editing pencil on the page, but somehow failed to see it yesterday. My apologies! I must have been totally befuddled from staring at the screen for too long.

I edited my question.

For the future, I will try to remember to 1) use the code symbol to format the code 2) take a break after staring at the screen for too long!

Hi @studiosa,

I think the solution here is getting rid of those underscores on the package name.

Try conda_install(envname = "r-reticulate", packages = c("matplotlib", "future")). That works for me, but let me know if it doesn't for you. I'm on a Mac laptop, so it's possible there's something else at play.

Thanks!

Hi Alex,
Thank you very much!

Success!

> files_list_reticulate_py_packages = list.files(path = "C:/Users/userXYZ/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages")
> 
> files_list_reticulate_py_packages[grep("future", files_list_reticulate_py_packages)]
[1] "future"                  "future-0.18.2.dist-info"

Studiosa

Just for future reference, the reason this happened was that future is a python package you can install, while __future__ is a part of the base python install. Pretty confusing :slight_smile: Glad it worked!

I appreciate the clarification. I was a bit confused. But now it is all crystal clear

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.