简体   繁体   中英

Python and Conda not recognized in Ubuntu for Windows, although in PATH

I've installed Anaconda on my Windows machine, and made sure to add it to PATH.
Ubuntu for Windows will not recognize conda and python although they are in PATH

dean@DESKTOP-GJ4INGE:~$echo $PATH
...
/mnt/c/ProgramData/Anaconda3
/mnt/c/ProgramData/Anaconda3/Library/mingw-w64/bin
/mnt/c/ProgramData/Anaconda3/Library/usr/bin
/mnt/c/ProgramData/Anaconda3/Library/bin
/mnt/c/ProgramData/Anaconda3/Scripts
...

I've wanted to make sure They actually exists in PATH, so I opened Anaconda prompt

(base) C:\Windows\system32>where conda
C:\ProgramData\Anaconda3\Library\bin\conda.bat
C:\ProgramData\Anaconda3\Scripts\conda.exe

(base) C:\Windows\system32>where python
C:\ProgramData\Anaconda3\python.exe

Seems as if they are in the correct locations yet not recognized by Ubuntu.

I think it would be a better and more useful idea to install python directly on WSL via sudo apt install python3 python3-pip and manually install the ubuntu package for conda.

If you want to preserve your current WSL configuration, the output from which python , which python and which conda and the complete echo $PATH would be needed to help you more. (All the commands in WSL)

From what you have submited I think your PATH is bad written because instead of newline the separator character between directories should be ':'.

显然,Ubuntu正在寻找整个文件名,因此命令conda.exepython.exe工作。

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