且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

与Anaconda一起安装了一个软件包,无法在Python中导入

更新时间:2021-12-13 10:45:32

可能是由于您在计算机上安装了多个python env. 当您执行which python时,您可能会在计算机中安装本机python.那是/usr/bin/python

Probably due to the fact you have multiply python envs installed in your computer. when you do which python you will probably get the native python installed in your computer. that is /usr/bin/python

您想使用安装Anaconda时随附的Python. 只需将Anaconda路径添加到$PATH的开头即可. (为此,您可能需要先编辑~/.bashrc文件(或外壳程序的等效文件),然后再编辑source ~/.bashrc.

You want to use the Python that came when you installed Anaconda. Just add Anaconda path to the beginning of your $PATH. (In order to do this you probably need to edit your ~/.bashrc file (or the equivalent file for your shell) then source ~/.bashrc.

下一次您将要运行pythonimport theano时,您将成功.

Next time you will go to will run python and import theano you'll succeed.