Cannot use conda-forge to install psycopg2 library

89 Views Asked by At

Up until last week, I was running a powershell script to install python libraries on a server. I first install miniconda and then use conda to install my libraries like this:

Start-Process "$condaInstaller" -argumentlist "/InstallationType=AllUsers /RegisterPython=0 /S /D=d:\miniconda3" -wait
Start-Sleep -Seconds 30
log ("$(Get-Date) --- installing conda packages")

invoke-expression 'd:\miniconda3\shell\condabin\conda-hook.ps1'

conda activate base
conda install -y -c conda-forge GDAL=3.6.4
conda install -y -c conda-forge geopandas=0.12.2
conda install -y -c conda-forge boto3
conda install -y -c conda-forge psycopg2
conda install -y -c conda-forge pytest
conda install -y -c conda-forge requests

Set-Location d:\my-repo
python -m pip install .
conda deactivate

After the script runs, all the libraries are installed in the newly created base environment, except psycopg2. When I try to run conda install -y -c conda-forge psycopg2 from my terminal, it returns this:

(base) D:\my-repo>conda install -y -c conda-forge psycopg2
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.

ResolvePackageNotFound:
  - conda==23.3.1

Whats going on here? This was working fine up until last week and now it won't install. I don't see any deprecation messages in the psycopg2 or conda-forge reference pages. Could there be some firewall rule or security patch that might be causing this? Any clue how to resolve this?

0

There are 0 best solutions below