經常在路徑中有空格,就會出現錯誤,比如以下:
conda create --prefix=D:\Program Files (x86)\python\Python36-32 python=3.6
在conda進行指定python環境時,由於Program Files (x86)含有空格,會出現以下錯誤:
PackagesNotFoundError: The following packages are not available from current channels: - \python\python36-32 - files Current channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/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.
但是去掉空格就可以正常創建,所以時空格原因,這里的處理辦法是:給路徑加上雙引號。如下:
conda create --prefix="D:\Program Files (x86)\python\Python36-32" python=3.6
這時候就可以順利執行了。
PackagesNotFoundError: The following packages are not available from current channels:
- \python\python36-32 - files
Current channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
To search for alternate channels that may provide the conda package you'relooking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.