PackageNotFoundError: แพ็คเกจต่อไปนี้ไม่สามารถใช้งานได้จากช่องทางปัจจุบัน วิธีแก้ปัญหา?

เนื่องจากฉันยังใหม่กับสาขานี้ ฉันจึงตั้งคำถามนี้ แม้ว่าจะมีคำตอบบางส่วนอยู่แล้วก็ตาม ฉันไม่ทราบวิธีแก้ปัญหาที่เป็นรูปธรรมสำหรับปัญหาของฉัน ฉันกำลังพยายามติดตั้งการขึ้นต่อกันสำหรับการรันโค้ดที่ส่งโดยหัวหน้ามหาวิทยาลัยของฉันโดยการรัน

conda install --yes --file requirements.txt

จากนั้นฉันได้รับข้อความแสดงข้อผิดพลาดต่อไปนี้:

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:

  - click-default-group==1.2.2
  - profiling==0.1.3
  - jupyter-console==6.1.0
  - mypy-extensions==0.4.3
  - tables==3.6.1
  - numpy==1.18.3
  - ipython-genutils==0.2.0
  - jupyter-core==4.6.3
  - prometheus-client==0.7.1
  - torch==1.4.0
  - torchvision==0.5.0
  - opencv-python==4.2.0.34
  - jupyter-client==6.1.2
  - valuedispatch==0.0.1
  - nbformat==5.0.5

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch 

มีวิธีแก้ไขที่แนะนำโดยใช้ไฟล์ YAML แทน .txt แต่ฉันไม่แน่ใจว่าจะนำไปใช้อย่างไร

ดีที่สุด

แก้ไข: เนื้อหาของข้อกำหนด txt คือ (แม้ว่าจะค่อนข้างยาว):

appdirs==1.4.4
astroid==2.3.3
attrs==19.3.0
autopep8==1.5.2
backcall==0.1.0
black==19.10b0
bleach==3.1.4
certifi==2019.11.28
chardet==3.0.4
click==7.1.2
click-default-group==1.2.2
ConfigArgParse==1.2.3
configparser==5.0.0
cycler==0.10.0
Cython==0.29.17
decorator==4.4.2
deepdish==0.3.6
defusedxml==0.6.0
entrypoints==0.3
faiss-cpu==1.6.3
faiss-gpu==1.6.3
h5py==2.10.0
hdbscan==0.8.26
idna==2.9
ipykernel==5.2.0
ipython==7.13.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
isort==4.3.21
jedi==0.16.0
Jinja2==2.11.1
joblib==0.14.1
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.2
jupyter-console==6.1.0
jupyter-core==4.6.3
kiwisolver==1.2.0
lazy-object-proxy==1.4.3
llvmlite==0.31.0
MarkupSafe==1.1.1
matplotlib==3.2.1
mccabe==0.6.1
mistune==0.8.4
mypy==0.770
mypy-extensions==0.4.3
nbconvert==5.6.1
nbformat==5.0.5
notebook==6.0.3
numba==0.48.0
numexpr==2.7.1
numpy==1.18.3
opencv-python==4.2.0.34
pandas==1.0.3
pandocfilters==1.4.2
parso==0.6.2
pathspec==0.8.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.1.1
profiling==0.1.3
prometheus-client==0.7.1
prompt-toolkit==3.0.5
protobuf==3.11.3
ptyprocess==0.6.0
pycodestyle==2.5.0
Pygments==2.6.1
pylint==2.4.4
pyparsing==2.4.6
pyrsistent==0.16.0
python-dateutil==2.8.1
pytz==2019.3
PyYAML==5.3.1
pyzmq==19.0.0
qtconsole==4.7.2
QtPy==1.9.0
regex==2020.5.7
requests==2.23.0
scikit-learn==0.22.2.post1
scipy==1.4.1
seaborn==0.10.0
Send2Trash==1.5.0
six==1.14.0
tables==3.6.1
tensorboardX==2.0
terminado==0.8.3
testpath==0.4.4
toml==0.10.0
torch==1.4.0
torchvision==0.5.0
tornado==6.0.4
tqdm==4.45.0
traitlets==4.3.3
typed-ast==1.4.1
typing-extensions==3.7.4.2
umap-learn==0.3.10
urllib3==1.25.8
urwid==2.1.0
valuedispatch==0.0.1
wcwidth==0.1.9
webencodings==0.5.1
widgetsnbextension==3.5.1
wrapt==1.11.2

person kallikles    schedule 23.12.2020    source แหล่งที่มา
comment
คุณช่วยโพสต์เนื้อหาของไฟล์ข้อความได้ไหม?   -  person James    schedule 23.12.2020
comment
ไฟล์ข้อกำหนด Pip เข้ากันไม่ได้กับสภาพแวดล้อม Conda ในทันที   -  person merv    schedule 23.12.2020


คำตอบ (1)


ดูเหมือนว่าการโค่นล้มของแพ็คเกจบางส่วนในไฟล์ข้อกำหนดนั้นถูกสร้างขึ้นสำหรับการแจกจ่าย PyPi แต่ไม่ใช่ conda นอกจากนี้ ชื่อแพ็คเกจบางส่วนสำหรับ PyPi ยังใช้เครื่องหมายขีดกลาง แต่ใช้ขีดล่างบน conda

ซึ่งสามารถแก้ไขได้โดยการคลายการโค่นล้มในไฟล์ข้อกำหนดและแทนที่ขีดกลางบางส่วนด้วยขีดล่าง

แพ็คเกจบางส่วนก็มีชื่อที่แตกต่างกันเช่นกัน เช่น Torch เรียกว่า pytorch นอกจากนี้ คุณจะต้องรวมช่อง pytorch ไว้ด้วย

สุดท้ายนี้ แพ็คเกจ valuedispatch มีเฉพาะใน PyPi เท่านั้น และจะต้องติดตั้งโดยใช้ PIP

แทนที่ไฟล์ข้อกำหนดด้วย on ด้านล่าง จากนั้นรันคำสั่งต่อไปนี้:

conda conda install -y --file requirements.txt -c defaults -c conda-forge -c pytorch
pip install valuedispatch
pip install profiling

ข้อกำหนด.txt:

appdirs==1.4.*
astroid==2.3.*
attrs==19.3.*
autopep8==1.5.*
backcall==0.1.*
black==19.*
bleach==3.1.*
certifi==2019.11.*
chardet==3.0.*
click==7.1.*
click-default-group==1.2.*
ConfigArgParse==1.2.*
configparser==5.0.*
cycler==0.10.*
Cython==0.29.*
decorator==4.4.*
deepdish==0.3.*
defusedxml==0.6.*
entrypoints==0.*
faiss-cpu==1.6.*
faiss-gpu==1.6.*
h5py==2.10.*
hdbscan==0.8.*
idna==2.*
ipykernel==5.2.*
ipython==7.13.*
ipython_genutils==0.2.*
ipywidgets==7.5.*
isort==4.3.*
jedi==0.16.*
Jinja2==2.11.*
joblib==0.14.*
jsonschema==3.2.*
jupyter==1.0.*
jupyter_client==6.1.*
jupyter_console==6.1.*
jupyter_core==4.6.*
kiwisolver==1.2.*
lazy-object-proxy==1.4.*
llvmlite==0.31.*
MarkupSafe==1.1.*
matplotlib==3.2.*
mccabe==0.6.*
mistune==0.8.*
mypy==0.*
mypy_extensions==0.4.*
nbconvert==5.6.*
nbformat==5.0.*
notebook==6.0.*
numba==0.48.*
numexpr==2.7.*
numpy==1.18.*
opencv==4.2.*
pandas==1.0.*
pandocfilters==1.4.*
parso==0.6.*
pathspec==0.8.*
pexpect==4.8.*
pickleshare==0.7.*
Pillow==7.1.*
prometheus_client==0.7.*
prompt_toolkit==3.0.*
protobuf==3.11.*
ptyprocess==0.6.*
pycodestyle==2.5.*
Pygments==2.6.*
pylint==2.4.*
pyparsing==2.4.*
pyrsistent==0.16.*
python-dateutil==2.8.*
pytz==2019.*
PyYAML==5.3.*
pyzmq==19.0.*
qtconsole==4.7.*
QtPy==1.9.*
regex==2020.5.*
requests==2.23.*
scikit-learn==0.22.*
scipy==1.4.*
seaborn==0.10.*
Send2Trash==1.5.*
six==1.14.*
pytables==3.6.*
tensorboardX==2.*
terminado==0.8.*
testpath==0.4.*
toml==0.10.*
pytorch==1.4.*
torchvision==0.5.*
tornado==6.0.*
tqdm==4.45.*
traitlets==4.3.*
typed-ast==1.4.*
typing-extensions==3.7.*
umap-learn==0.3.*
urllib3==1.25.*
urwid==2.1.*
wcwidth==0.1.*
webencodings==0.5.*
widgetsnbextension==3.5.*
wrapt==1.11.*

หรือคุณสามารถติดตั้งทุกอย่างโดยใช้ PIP และไฟล์ต้นฉบับผ่าน:

pip install -r requirements.txt

แต่ดังที่ @merv กล่าวไว้ เป็นการดีที่สุดที่จะไม่ทำเช่นนี้ในสภาพแวดล้อมพื้นฐาน

person James    schedule 23.12.2020
comment
ทำงานได้อย่างสมบูรณ์แบบ ยกเว้นสองแพ็คเกจ กล่าวคือ - การทำโปรไฟล์=0.1 - ตาราง=3.6 - person kallikles; 23.12.2020
comment
ตารางกลายเป็น pytable การจัดทำโปรไฟล์ก็มีเฉพาะใน PyPi เท่านั้น ฉันอัปเดตคำตอบแล้ว - person James; 23.12.2020
comment
ฉันทราบว่าไม่ควร pip install -r requirements.txt ในสภาพแวดล้อม ฐาน - person merv; 23.12.2020