简体   繁体   English

将conda添加到我的环境变量或路径?

[英]Add conda to my environment variables or path?

I am having trouble adding conda to my environment variables on windows. 我在Windows上的环境变量中添加conda时遇到问题。 I installed anaconda 3 though I didn't installed python , so neither pip or pip3 is working in my prompt. 我安装了anaconda 3,尽管我没有安装python ,所以pippip3 都不在提示符下工作 I viewed a few post online but I didn't find anything regarding how to add conda to my environment variables. 我在网上查看了几篇文章,但没有找到有关如何在环境变量中添加conda的任何信息。

I tried to create a PYTHONPATH variable which contained every single folder in Anaconda 3 though it didn't worked. 我试图创建一个PYTHONPATH变量,该变量包含Anaconda 3中的每个文件夹 ,尽管它不起作用。

My anaconda prompt isn't working too. 我的anaconda提示也不起作用 :( :(

so...How do I add conda and pip to my environment variables or path ? 所以...如何将condapip添加到我的环境变量或路径中?

You can access to conda and pip directly in their directory : 您可以直接在其目录中访问conda和pip:

  • On Windows : $ANACONDA_INSTALL_DIR\\Scripts, you will find conda.exe and pip.exe Windows上 :$ ANACONDA_INSTALL_DIR \\ Scripts,您将找到conda.exe和pip.exe
  • On Linux : $ANACONDA_INSTALL_DIR/bin, there are conda and pip executable files. Linux上 :$ ANACONDA_INSTALL_DIR / bin,有conda和pip可执行文件。

Where $ANACONDA_INSTALL_DIR is the directory of your Anaconda installation. 其中$ ANACONDA_INSTALL_DIR是Anaconda安装目录。

To add Anaconda to your path, you can add this folder to your PATH. 要将Anaconda添加到路径,可以将此文件夹添加到PATH。 For Linux , you can add this line to yout .bashrc file 对于Linux ,您可以将此行添加到yout .bashrc文件中

export PATH=$ANACONDA_INSTALL_DIR/bin:$PATH

As said @BcK, reinstalling Anaconda and choosing to add Anaconda to your path is also a way to do this. 如@BcK所述,重新安装Anaconda并选择将Anaconda添加到您的路径也是一种方法。 This option makes a backup of your .bashrc file and add the export line. 此选项对.bashrc文件进行备份并添加导出行。

Thanks guys for helping me out. 谢谢你们帮我。 I solved the problem reinstalling anaconda (several times :[ ), cleaning every log and resetting the path variables via set path= in the windows power shell (since I got some problems reinstalling anaconda adding the folder to PATH[specifically "unable to load menus" or something like that]) 我解决了重新安装anaconda的问题(几次:[),清理每个日志并通过Windows Power Shell中的set path=重置路径变量(因为我在重新安装anaconda时将文件夹添加到PATH中遇到了一些问题,特别是“无法加载菜单” “ 或类似的东西])

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

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