简体   繁体   English

Anaconda,spyder和python路径

[英]Anaconda, spyder and python path

I have an installation of python 3.6.2 on Windows 10 in : 我在Windows 10上的以下位置安装了python 3.6.2:

D:\Program Files\Python36

I recently installed Anaconda, but I did not add the new version to the path, because I wanted to keep my installation and libraries. 我最近安装了Anaconda,但没有将新版本添加到路径中,因为我想保留我的安装和库。

On spyder (launch from Anaconda), in Tools, and PYTHONPATH gestionnary, I can see 在spyder(从Anaconda启动),“工具”和PYTHONPATH gestationnary中,我可以看到

在此处输入图片说明

with PATH being: 路径为:

['C:\\Anaconda', 'C:\\Anaconda\\Library\\mingw-w64\\bin', 'C:\\Anaconda\\Library\\usr\\bin', 'C:\\Anaconda\\Library\\bin', 'C:\\Anaconda\\Scripts', '%USERPROFILE%\\AppData\\Local\\Microsoft\\WindowsApps']

Yet, if I start IDLE (old installation), I can import OpenCV (import cv2), but not from spyder.... How could I fix this? 但是,如果我开始IDLE(旧安装),则可以导入OpenCV(导入cv2),但不能从spyder导入。...如何解决此问题?

Thanks ! 谢谢 !

You have two versions of python on your computer, so packages installed using your older version of pip won't show up for the anaconda installation. 您的计算机上有两个版本的python,因此使用较早版本的pip安装的软件包不会在anaconda安装中显示。

Chances are you may want to keep both installs, so you could just install desired anaconda packages by running conda install packageName from your command prompt or terminal. 您可能希望同时保留两个安装,因此可以通过从命令提示符或终端运行conda install packageName来安装所需的anaconda软件包。 However, these newly installed packages will only be available in anaconda/python, not your IDLE/python. 但是,这些新安装的软件包仅在anaconda / python中可用,而在您的IDLE / python中不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM