0

我已经搜索了一段时间,并尝试了http://nltk.org/install.html#source-installation-for-32-bit-or-64-bit-windows和其他网站的注册表更改(例如http ://www.comoke.com/index.php/2010/11/pyyaml-on-windows-7-64-bit-python-nltk-pyyaml-python-required-not-found-in-registry/——虽然修改为使用我的 winpython 文件夹)。

(它似乎表明我已经安装了 nltk,但是 winpython 似乎没有附带 nltk,并且“import nltk”不起作用)

我运行命令“pip install pyyaml nltk”的输出如下:

C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\Scripts>pip install pyyaml nltk
Downloading/unpacking pyyaml
  Running setup.py egg_info for package pyyaml

skipping 'ext\_yaml.c' Cython extension (up-to-date)
Requirement already satisfied (use --upgrade to upgrade): nltk in c:\winpython-6
4bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages
Installing collected packages: pyyaml
  Running setup.py install for pyyaml
    checking if libyaml is compilable
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\
pyyaml\setup.py", line 344, in <module>

--> the rest is trimmed

有什么想法吗?

编辑——这是整个错误:

C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\Scripts>pip install pyyaml nltk
Downloading/unpacking pyyaml
  Running setup.py egg_info for package pyyaml

    skipping 'ext\_yaml.c' Cython extension (up-to-date)
Requirement already satisfied (use --upgrade to upgrade): nltk in c:\winpython-6
4bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages
Installing collected packages: pyyaml
  Running setup.py install for pyyaml
    checking if libyaml is compilable
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\
pyyaml\setup.py", line 344, in <module>
        'test': test,
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\core.py"
, line 152, in setup
        dist.run_commands()
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\dist.py"
, line 953, in run_commands
        self.run_command(cmd)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\dist.py"
, line 972, in run_command
        cmd_obj.run()
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages\setu
ptools\command\install.py", line 53, in run
        return _install.run(self)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\command\
install.py", line 563, in run
        self.run_command('build')
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\cmd.py",
 line 326, in run_command
        self.distribution.run_command(command)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\dist.py"
, line 972, in run_command
        cmd_obj.run()
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\command\
build.py", line 127, in run
        self.run_command(cmd_name)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\cmd.py",
 line 326, in run_command
        self.distribution.run_command(command)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\dist.py"
, line 972, in run_command
        cmd_obj.run()
      File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\
pyyaml\setup.py", line 171, in run
        _build_ext.run(self)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages\Cyth
on\Distutils\build_ext.py", line 163, in run
        _build_ext.build_ext.run(self)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\command\
build_ext.py", line 339, in run
        self.build_extensions()
      File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\
pyyaml\setup.py", line 213, in build_extensions
        with_ext = self.check_extension_availability(ext)
      File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\
pyyaml\setup.py", line 239, in check_extension_availability
        depends=ext.depends)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\msvc9com
piler.py", line 473, in compile
        self.initialize()
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\msvc9com
piler.py", line 383, in initialize
        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\msvc9com
piler.py", line 299, in query_vcvarsall
        raise ValueError(str(list(result.keys())))
    ValueError: [u'path']
    Complete output from command C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\p
ython.exe -c "import setuptools;__file__='c:\\users\\thisis~1\\appdata\\local\\t
emp\\pip-build-thisisawittyusername\\pyyaml\\setup.py';exec(compile(open(__file_
_).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\t
hisis~1\appdata\local\temp\pip-taygji-record\install-record.txt --single-version
-externally-managed:
    running install

running build

running build_py

running build_ext

checking if libyaml is compilable

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\pyya
ml\setup.py", line 344, in <module>

    'test': test,

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\core.py", li
ne 152, in setup

    dist.run_commands()

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\dist.py", li
ne 953, in run_commands

    self.run_command(cmd)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\dist.py", li
ne 972, in run_command

    cmd_obj.run()

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages\setuptoo
ls\command\install.py", line 53, in run

    return _install.run(self)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\command\inst
all.py", line 563, in run

    self.run_command('build')

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\cmd.py", lin
e 326, in run_command

    self.distribution.run_command(command)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\dist.py", li
ne 972, in run_command

    cmd_obj.run()

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\command\buil
d.py", line 127, in run

    self.run_command(cmd_name)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\cmd.py", lin
e 326, in run_command

    self.distribution.run_command(command)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\dist.py", li
ne 972, in run_command

    cmd_obj.run()

  File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\pyya
ml\setup.py", line 171, in run

    _build_ext.run(self)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\site-packages\Cython\D
istutils\build_ext.py", line 163, in run

    _build_ext.build_ext.run(self)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\command\buil
d_ext.py", line 339, in run

    self.build_extensions()

  File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\pyya
ml\setup.py", line 213, in build_extensions

    with_ext = self.check_extension_availability(ext)

  File "c:\users\thisis~1\appdata\local\temp\pip-build-thisisawittyusername\pyya
ml\setup.py", line 239, in check_extension_availability

    depends=ext.depends)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\msvc9compile
r.py", line 473, in compile

    self.initialize()

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\msvc9compile
r.py", line 383, in initialize

    vc_env = query_vcvarsall(VERSION, plat_spec)

  File "C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\lib\distutils\msvc9compile
r.py", line 299, in query_vcvarsall

    raise ValueError(str(list(result.keys())))

ValueError: [u'path']

----------------------------------------
Command C:\WinPython-64bit-2.7.5.1\python-2.7.5.amd64\python.exe -c "import setu
ptools;__file__='c:\\users\\thisis~1\\appdata\\local\\temp\\pip-build-thisisawit
tyusername\\pyyaml\\setup.py';exec(compile(open(__file__).read().replace('\r\n',
 '\n'), __file__, 'exec'))" install --record c:\users\thisis~1\appdata\local\tem
p\pip-taygji-record\install-record.txt --single-version-externally-managed faile
d with error code 1 in c:\users\thisis~1\appdata\local\temp\pip-build-thisisawit
tyusername\pyyaml
Storing complete log in C:\Users\thisisawittyusername\pip\pip.log
4

1 回答 1

0

update--re-registered winpython(使用其内置的控制面板),从站点安装了 32 位版本的 pyyaml,然后是 nltk,它似乎正在工作(!)

于 2013-07-18T13:56:05.590 回答