I have a conda environment set up with all of the packages I need (currently), and I wanted to make a new one from the requirements.txt file (formatted for conda, not pip) to make sure that someone else can use my project. This requirements file was generated from the other environment that I already have set up. Thus, I am confused when it fails to install with
conda install --file "requirements.txt"
and
conda install -c conda-forge --file "requirements.txt"
I made sure to specify the proper python version when creating the new environment. Here's what's in my requirements.txt file:
requirements.txt
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: win-64
arrow=1.2.3=pyhd8ed1ab_0
asgiref=3.6.0=pyhd8ed1ab_0
async-timeout=4.0.2=pyhd8ed1ab_0
backports.zoneinfo=0.2.1=py39hcbf5309_7
beautifulsoup4=4.12.2=pyha770c72_0
binaryornot=0.4.4=py_1
brotlipy=0.7.0=py39hb82d6ee_1004
ca-certificates=2022.12.7=h5b45459_0
certifi=2022.12.7=pyhd8ed1ab_0
cffi=1.15.1=py39h0878f49_0
chardet=5.1.0=py39hcbf5309_0
charset-normalizer=3.1.0=pyhd8ed1ab_0
click=8.1.3=win_pyhd8ed1ab_2
colorama=0.4.6=pyhd8ed1ab_0
cookiecutter=2.1.1=pyh6c4a22f_0
cryptography=40.0.1=pypi_0
defusedxml=0.7.1=pypi_0
django=4.2=pyhd8ed1ab_0
django-allauth=0.54.0=pypi_0
django-autoslug=1.9.8=pypi_0
django-bootstrap4=23.1=pypi_0
django-crispy-forms=1.9.2=pyhd8ed1ab_1
django-debug-toolbar=4.0.0=pypi_0
django-environ=0.4.5=pypi_0
django-extensions=3.2.1=pypi_0
idna=3.4=pyhd8ed1ab_0
importlib-metadata=2.0.0=py_1
itunespy=1.6.0=pypi_0
jinja2=2.11.3=pyhd8ed1ab_2
jinja2-time=0.2.0=pyhd8ed1ab_3
markupsafe=1.1.1=py39hb82d6ee_4
oauthlib=3.2.2=pypi_0
openssl=1.1.1t=h2bbff1b_0
pillow=9.5.0=pypi_0
pip=23.0.1=pypi_0
pycountry=22.3.5=pypi_0
pycparser=2.21=pyhd8ed1ab_0
pyjwt=2.6.0=pypi_0
pyopenssl=20.0.1=pyhd8ed1ab_0
pysocks=1.7.1=pyh0701188_6
python=3.9.16=h6244533_2
python-dateutil=2.8.2=pyhd8ed1ab_0
python-slugify=4.0.1=pypi_0
I've tried installing with no channel specified as well as with "-c conda-forge" as a param. Each yields a slightly different list of missing packages. When I ran conda install -c conda-forge --file requirements.txt after creating an env, it yielded this output:
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:
- soupsieve==2.4=pypi_0
- itunespy==1.6.0=pypi_0
- unidecode==1.1.1=pypi_0
- python-slugify==4.0.1=pypi_0
- django-extensions==3.2.1=pypi_0
- whitenoise==5.2.0=pypi_0
- pyjwt==2.6.0=pypi_0
- python3-openid==3.2.0=pypi_0
- django-debug-toolbar==4.0.0=pypi_0
- oauthlib==3.2.2=pypi_0
- pillow==9.5.0=pypi_0
- django-bootstrap4==23.1=pypi_0
- pip==23.0.1=pypi_0
- zlib-state==0.1.5=pypi_0
- defusedxml==0.7.1=pypi_0
- django-environ==0.4.5=pypi_0
- pytz==2020.1=pypi_0
- requests-oauthlib==1.3.1=pypi_0
- tzdata==2023.3=pypi_0
- django-autoslug==1.9.8=pypi_0
- pycountry==22.3.5=pypi_0
- cryptography==40.0.1=pypi_0
- django-allauth==0.54.0=pypi_0
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.
I've also tried to reference this file upon creation of the environment, and that does not work either. I have a feeling django might be causing some issues with how it names certain packages, as I had to manually install a lot of these packages when building the original environment. If anyone has any ideas, I would greatly appreciate them!
It looks like you've used conda list --export to generate the list of packages. Unfortunately, when some packages are installed from PyPI using pip, this command isn't helpful.
The command you need to export your environment is:
conda env export > environment.yml
Then to create a new environment from that spec:
conda env create -n new-env-name -f environment.yml
The conda environment management commands have gradually changed, and the documentation hasn't really kept up. The conda list --export doesn't work correctly when packages have been installed from PyPI using pip, and result in an export that can't be re-loaded. The package versions have pypi_0 at the end of them, and conda doesn't know what to make of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With