尝试安装pyjaco时出错

时间:2014-02-20 01:48:37

标签: javascript python git python-3.x

我正在尝试在教程here上安装pyjaco(我正在尝试进行标准安装)我从cmd做了git clone https://github.com/chrivers/pyjaco,然后我{{1} }}。接下来,我cd pyjaco它给了我这个错误:python setup.py install。所以我打开文件资源管理器,在IDLE中打开setup.py:

'python' is not recognized as a internal or external command, operable program or batch file

我在python shell中运行它时出现此错误:

from distutils.core import setup
try:
        from setuptools import setup
except:
        pass

setup(
    name = "pyjaco",
    version = "1.0.0",
    author = "Pyjaco development team",
    author_email = "developer@pyjaco.org",
    description = ("Python to JavaScript translator"),
    scripts = ["pyjs.py"],
    url = "http://pyjaco.org",
    keywords = "python javascript translator compiler",
    packages=["pyjaco", "pyjaco.compiler"],
    package_data={"pyjaco": ["stdlib/*.js"]}
)

我认为因为:Traceback (most recent call last): File "C:\Users\iFunny\pyjaco\setup.py", line 17, in <module> package_data={"pyjaco": ["stdlib/*.js"]} File "C:\Program Files (x86)\python32\lib\distutils\core.py", line 137, in setup raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg) SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ... ] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: no commands supplied

而导致distutils.core导入错误

我做了一些googleing,发现我需要运行ez_setup.py(你可以找到它here)。 所以我运行它,并在它安装的C:\ Program Files(x86)\ python32 \ Lib \ site-packages中:

setuptools-2.2-py3.2.egg,setuptools.pth和easy-install.pth。如何正确安装?

1 个答案:

答案 0 :(得分:0)

安装任何python模块最直接的方法是使用pip或easy_install。 pip install pyjaco

所以,首先你需要安装pip。要安装pip,请运行此处提供的python脚本:get-pip.py

我还尝试通过下载tar文件并运行setup.py来安装它,它运行得很好。

enter image description here