Python新手-PIP/无效语法错误 [英] Python newbie - PIP / invalid syntax error

查看:801
本文介绍了Python新手-PIP/无效语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,编程和python完全是新手.运行Windows 7,python 2.7 x64. 我正在尝试使用pip安装dateutil软件包.

Ok, totally newbie to programming and python. Running Windows 7, python 2.7 x64. I am trying in install dateutil package using pip.

我安装了pipnumpypandas ...,它们非常简单,因为它们是exe文件.

I installed pip, numpy and pandas... which were pretty straightforward as they are exe files.

我现在正在尝试使用pip安装dateutil.在Python Shell中,我输入了:

I am now trying to use pip to install dateutil. In the Python Shell, I have typed:

pip install dateutil 

pip install python-dateutil

在安装命令中继续出现"Invalid Syntax"错误.我在这里做错了什么?我也在python命令行中尝试过此操作.

I continue to get "Invalid Syntax" errors at the install command. What am I doing wrong here? I have also tried this in the python command line.

我已经检查了安装的模块,并且同时拥有pipeasy_install.现在真的很困惑...我也尝试过运行dateutil的安装脚本,但出现此错误:

I have checked my modules installed and I have both pip and easy_install. Really confused right now...I also have tried running the setup script for dateutil and I get this error:

Traceback (most recent call last):
  File "C:\Python27\Scripts\python-dateutil-1.5.tar\python-dateutil-1.5\setup.py", line 14, in <module>
    TOPDIR = os.path.dirname(__file__) or "."
NameError: name '__file__' is not defined

请帮助!预先感谢您的帮助.

Help please! Thanks in advance for any help.

推荐答案

您不要在Python shell中键入它.您可以在命令提示符下键入它(已经有好几年没有使用Windows了,但是它以前被称为cmd).

You don't type that in the Python shell. You type it in the command prompt (haven't used Windows for years, but it used to be called cmd).

这篇关于Python新手-PIP/无效语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆