问题
I am trying to install packages in a python 3.6.3 virtual environment. I keep getting errors.
I have tried pip with --ignore-installed
flag like: pip install -I -r package-list.txt
.
Here is part of what I have in package-list.txt
.
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
_libgcc_mutex==0.1==main
appdirs==1.4.3==pypi_0
asn1crypto==0.24.0==py36_0
beautifulsoup4==4.7.1==py36_1
blas==1.0==mkl
bzip2==1.0.6==h14c3975_5
ca-certificates==2019.6.16==hecc5488_0
cairo==1.14.12==h8948797_3
certifi==2019.6.16==py36_1
cffi==1.12.1==py36h2e261b9_0
chardet==3.0.4==py36_1
cloudpickle==0.8.0==pypi_0
cryptography==2.5==py36h1ba5d50_0
cycler==0.10.0==pypi_0
dask==1.1.4==pypi_0
decorator==4.4.0==pypi_0
ffmpeg==4.0==hcdf2ecd_0
fontconfig==2.13.0==h9420a91_0
freeglut==3.0.0==hf484d3e_5
freetype==2.9.1==h8a8886c_1
fuzzywuzzy==0.17.0==py_0
glib==2.56.2==hd408876_0
graphite2==1.3.13==h23475e2_0
harfbuzz==1.8.8==hffaf4a1_0
hdf5==1.10.2==hba1933b_1
icu==58.2==h9c2bf20_1
idna==2.8==py36_0
intel-openmp==2019.3==199
jasper==2.0.14==h07fcdf6_1
jpeg==9b==h024ee3a_2
kiwisolver==1.0.1==pypi_0
libedit==3.1.20181209==hc058e9b_0
libffi==3.2.1==hd88cf55_4
libgcc-ng==8.2.0==hdf63c60_1
libgfortran-ng==7.3.0==hdf63c60_0
libglu==9.0.0==hf484d3e_1
...
With first package _libgcc_mutex==0.1==main
I get this error:
Ignoring pip: markers 'python_version < "3"' don't match your environment
ERROR: Invalid requirement: '_libgcc_mutex==0.1==main' (from line 4 of package-list3.txt)
Without _libgcc_mutex==0.1==main
I get:
Ignoring pip: markers 'python_version < "3"' don't match your environment
Looking in links: /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/avx2, /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/generic
Collecting appdirs==1.4.3==pypi_0 (from -r package-list2.txt (line 4))
ERROR: Could not find a version that satisfies the requirement appdirs==1.4.3==pypi_0 (from -r package-list2.txt (line 4)) (from versions: 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.4.3)
ERROR: No matching distribution found for appdirs==1.4.3==pypi_0 (from -r package-list2.txt (line 4))
回答1:
Your file states in the comment section that it is supposed to be used with conda
, it is not a requirements.txt
but a yml
file. Try using the command listed in the file:
conda create --name <env> --file <this file>
If you want to modify your current environment based on that file, try (while inside of your environment):
conda env update --file <your file>
来源:https://stackoverflow.com/questions/58369759/pip-install-packages-failing-invalid-requirement-no-matching-distribution