如果直接从命令行启动,则识别出python:
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\%USER%>conda info --envs
# conda environments:
#
root * C:\Users\%USER%\Miniconda
和
C:\Users\%USER%>python
Python 2.7.10 |Continuum Analytics, Inc.| (default, May 28 2015, 17:02:00) [MSC
v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import os
>>> import sys
>>> os.path
<module 'ntpath' from 'C:\Users\%USER%\Miniconda\Lib\ntpath.pyc'>
>>> sys.path
['', 'C:\\Users\\%USER%\\Miniconda\\Lib', 'C:\\Users\\%USER%\\Minico
nda\\python27.zip', 'C:\\Users\\%USER%\\Miniconda\\DLLs', 'C:\\Users\\%USER%\\Miniconda\\lib\\plat-win', 'C:\\Users\\%USER%\\Miniconda\\lib\\l
ib-tk', 'C:\\Users\\%USER%\\Miniconda', 'C:\\Users\\%USER%\\Minicond
a\\lib\\site-packages']
>>>
我的cmd文件位于:
C:\finished projects\run_aum_insertion.bat
其中包含:
python C:\Users\%USER$\PycharmProjects\upload_acct_value\Main.py
然而,当我运行它时,我收到以下错误:
C:\finished projects>python C:\Users\%USER%\PycharmProjects\upload_acct_va
lue\Main.py
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\finished projects>pause
Press any key to continue . . .
手动添加暂停以查看错误。
我的PATH
变量如下:
C:\Users\%USER%\Miniconda;C:\Users\%USER%\Miniconda\Scripts;
这对我来说很奇怪,因为cmd / bat应该只是我可以直接在命令行手动执行的自动化。
有什么想法吗?