简体   繁体   中英

How to access the Anaconda base environment in Pycharm when I cannot import C:\Users\username\Anaconda3\python.exe?

Apologies if this question has been repetitive. I've looked up all the similar posts on stackoverflow but none really helped in my case.

Background:

  • I am absolutely new to Pycharm and Anaconda, both of which I've installed and un-installed multiple times due to different problems each time.

  • After a fresh installation, the new conda environments that I've created in Pycharm has only a few packages. I checked in Anaconda Navigator, and other than the base/root environment that has the standard Anaconda library of hundreds of packages, all the new conda environments created by me only had the same 12 packages.

-- These new Pycharm conda environments also had the same conda excutable:

C:\\Users\\username\\Anaconda3\\Scripts\\conda.exe

  • I didn't want to install the same packages for the different conda environments - it defeats the purpose of Anaconda, isn't it? As I sought to use the base/root Anaconda environment by adding C:\\Users\\username\\Anaconda3\\python.exe as the conda executable in new conda environments, I kept getting tbe same error:

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

Once I clicked 'Makee available to all projects', however, PyCharm allowed it, but the package list displayed on PyCharm with this conda executable still only has the same 12 packages.

  • I tried to look for the base Anaconda environment in C:\\Users\\username\\Anaconda3\\bin\\conda , but the folder C:\\Users\\username\\Anaconda3\\bin that I have seen everywhere else doesn't exist.

  • I used PyCharm 2019.3.1(Professional Version) and Anaconda3-2019.10-Windows-x86_64.

PS Would greatly appreciate if someone can recommend some beginner-friendly tutorial on PyCharm and Anaconda. I don't learn about these in school, unfortunately.

the new conda environments ... has only a few packages

That's by design, environments don't inherit base packages by default.

As I sought to use the base/root Anaconda environment by adding C:\\Users\\username\\Anaconda3\\python.exe as the conda executable

Conda executable != python.exe

Try adding new system interpreter pointing to python executable inside Anaconda installation. This should do the trick.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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