问题
I am new to Python, now I am using Anaconda Spyder as my main Python distribution. I am learning how to use conda to install/update packages. When I read relevant books and searched online, it seemed that All I need to do is to type "conda install " or type "conda update ". When I typed so in my spyder console, I found error message as follows. Where am I wrong here? Thanks for help.
Someone suggested me to run it in cmd not in Spyder. Here is my output when I run it in cmd. The update of my pandas also fails in cmd line.
回答1:
You are trying to use a Python console to update your conda distribution when you have to update it from your local console.
I guess you're using Windows, just open the command prompt (cmd.exe), and from there update the conda distribution with the commands you already know:
conda update conda
conda update anaconda
conda install <package>
Update:
Conda commands have to be used directly in the command prompt:
回答2:
I started exploring Python on Spyder(Anaconda) and faced these issues. Though late, but this could help someone facing similar issues. I performed these on Windows7 and Anaconda3(64bit).
Step1: Identify the location where you installed your Anaconda.
Windows > All Programs > Anaconda3(64 bit) > Right Click on Spyder > Properties.
It shows Spyder target location, say, "C:\bla\bla\anaconda3\Scripts\spyder-script.py"
Step2: Now through folder explorer navigate to identified path as in Step1 i.e. "C:\bla\bla\anaconda3\Scripts\"
Here you will see many exe files including conda.exe and pip.exe
Step3: Open Windows Command prompt
C:\>cd C:\bla\bla\anaconda3\Scripts
C:\bla\bla\anaconda3\Scripts>
Step4: Now simply type all your pip or conda commands. It will install these libraries
C:\bla\bla\anaconda3\Scripts>pip install pandas
C:\bla\bla\anaconda3\Scripts>conda update conda
Step5: Now you can import the installed libraries directly in Spyder. It won't complain.
来源:https://stackoverflow.com/questions/33897860/python-spyder-conda-install-failure