【问题标题】:Set up anaconda interpreter in PyCharm on Windows在 Windows 上的 PyCharm 中设置 anaconda 解释器
【发布时间】:2019-09-27 03:21:00
【问题描述】:

我设置了 anaconda 3 和 tensorflow,它们在 anaconda 命令行中运行良好。我想使用 PyCharm 但无法添加解释器 Conda。

我按照以下说明操作:

https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html

我尝试了不同的东西。第一个是 conda 可执行文件是 anaconda.exe 的地方:

C:\Logiciels\Anaconda3\Scripts\anaconda.exe create -p     C:\Logiciels\Anaconda3\envs\Ex_Files_TensorFlow -y python=3.7

我得到错误:

anaconda: error: argument : invalid choice: 'create' (choose from 'auth', 'label', 'channel', 'config', 'copy', 'download', 'groups', 'login', 'logout', 'move', 'notebook', 'package', 'remove', 'search', 'show', 'upload', 'whoami')

我尝试将 conda.exe 作为可执行文件:

C:\Logiciels\Anaconda3\Scripts\conda.exe create -p C:\Logiciels\Anaconda3\envs\Ex_Files_TensorFlow -y python=3.5

但是获取输出:

Collecting package metadata: ...working... failed


CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/r/noarch/repodata.json.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file a support request with your network engineering team.

SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/r/noarch/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))

我也试过了:

C:\Logiciels\Anaconda3\python.exe create -p C:\Users\hel\.conda\envs\Ex_Files_TensorFlow -y python=3.7

那么命令输出是:

C:\Logiciels\Anaconda3\python.exe: can't open file 'create': [Errno 2] No such file or directory

但是文件存在并且存在。为什么 PyCharm 看不到它?

我还尝试了 3.5 版而不是 3.7 版和一个不同的文件夹来设置环境。您有什么建议吗?

【问题讨论】:

  • 在您尝试过的三个命令中,只有 conda.exe 一个是正确的。如果您的系统受代理服务器保护,您可以在 .condarc 文件中设置代理服务器。
  • 我看不出你列出的命令与你提到的链接上所说的有什么关系。如果您有一个现有的 conda 环境,则使用该环境中 Python 解释器 (python.exe) 的位置配置 Pycharm。就这样。该链接甚至没有提及输入任何命令。
  • 感谢您的澄清。帮助页面上不清楚。

标签: python python-3.x pycharm anaconda conda


【解决方案1】:

按照 cmets 中的建议,我使用以下命令在 conda 提示符下查找现有环境:

conda info --envs

返回机器上的环境呈现 并将路径复制到 Add Interpreter > Conda > Existing Environment > Interpreter 中的解释器字段

【讨论】:

    【解决方案2】:

    我发现我的 conda.exe 埋在文件夹中

    C:\Users\MYUSER\AppData\Local\Continuum\anaconda3\Scripts

    【讨论】:

    • 它也可以在 SQL Server 的 Program Files 下找到
    猜你喜欢
    • 2018-12-22
    • 2021-06-26
    • 1970-01-01
    • 2019-09-29
    • 2022-01-11
    • 2013-11-09
    • 1970-01-01
    相关资源
    最近更新 更多