这可能是我的错误,但是在梳理网络后,我一直找不到答案。我在Anaconda中有一个名为p36
的环境(我想像不到,很虚构),该环境应引用Python 3.6安装。但是,当我运行python
时,看不到预期的shell和提示符,而是这样:
python : Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:27:44) [MSC v.1900 64 bit (AMD64)] on win32
At line:1 char:1
+ python
+ ~~~~~~
+ CategoryInfo : NotSpecified: (Python 3.6.6 |A...MD64)] on win32:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Type
"help", "copyright", "credits" or "license" for more information.
>
>>
好像Python解释器向我抛出了RemoteException
。我的Anaconda环境是:
active environment : None
user config file : C:\Users\ME\.condarc
populated config files : C:\Users\ME\.condarc
conda version : 4.5.9
conda-build version : 3.10.5
python version : 3.6.5.final.0
base environment : C:\Users\ME\Anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/win-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/win-64
https://repo.anaconda.com/pkgs/pro/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\ME\Anaconda3\pkgs
C:\Users\ME\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\ME\Anaconda3\envs
C:\Users\ME\AppData\Local\conda\conda\envs
C:\Users\ME\.conda\envs
platform : win-64
user-agent : conda/4.5.9 requests/2.18.4 CPython/3.6.5 Windows/10 Windows/10.0.17134
administrator : True
netrc file : None
offline mode : False
正如您所看到的,我已经激活了环境
# conda environments:
#
base C:\Users\ME\Anaconda3
p36 * C:\Users\ME\Anaconda3\envs\p36
testcreate C:\Users\ME\Anaconda3\envs\testcreate
我正在Powershell ISE 5.1内部版本17134修订版165上运行所有这些
更新:当我尝试运行conda install -y scrapy
时,我再次遇到了异常,尽管它没有阻止进程继续进行。我认为Anaconda可能有问题。
更新2:我可以运行ipython
...。这是我的输出:
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
但是,我无法键入解释器,并且似乎完全没有响应(我必须CTRL+C
退出)
在解决此问题方面的任何帮助将不胜感激。
答案 0 :(得分:2)
如果我了解您的问题,则可能需要在启动ipython之前激活环境:
在命令行上:
source activate p36
(或Windows上的activate p36
?)
然后:
ipython
完成后:
source deactivate
(或Windows上的deactivate
?)
您可以通过以下方式获取conda环境的列表:
conda list
答案 1 :(得分:1)