使用zip文件安装python模块 [英] install python module using a zip file

查看:540
本文介绍了使用zip文件安装python模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从此处下载了一个zip文件,但我不知道如何安装它,然后在我的python 2.7中使用它 他们说它同时支持python 2和3

I have downloaded a zip file from here but I don't know how to install it and then use it in my python 2.7 they said it supports both python 2 and 3

在几行代码后使用命令:"pip install hazm"会出现以下错误:

using command: "pip install hazm" after bunch of lines it gets to these errors:

creating build\temp.win-amd64-2.7\Release\libwapiti\src
C:\Users\Mohammad\AppData\Local\Programs\Common\Microsoft\Visual C++ for Pyt
hon\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Icwapiti/src -
Ilibwapiti -IC:\Python27\include -IC:\Python27\PC /Tccwapiti/src/bcd.c /Fobuild\
temp.win-amd64-2.7\Release\cwapiti/src/bcd.obj -std=c99
cl : Command line warning D9002 : ignoring unknown option '-std=c99'
bcd.c
cwapiti/src/bcd.c(30) : fatal error C1083: Cannot open include file: 'stdboo
l.h': No such file or directory
error: command '"C:\Users\Mohammad\AppData\Local\Programs\Common\Microsoft\V
isual C++ for Python\9.0\VC\Bin\amd64\cl.exe"' failed with exit status 2

----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:
\\users\\mohammad\\appdata\\local\\temp\\pip-build-y3whx6\\libwapiti\\setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\
n'), __file__, 'exec'))" install --record c:\users\mohammad\appdata\local\temp\p
ip-m_wrwt-record\install-record.txt --single-version-externally-managed --compil
e" failed with error code 1 in c:\users\mohammad\appdata\local\temp\pip-build-y3
whx6\libwapiti

当我使用命令:"python ./setup.py"时,出现以下错误:

and when I use command:"python ./setup.py" these errors show up:

C:\Users\Mohammad\Desktop\Term 6\AI\AI Project\OPERATE\hazm-master\hazm-master>p
ython ./setup.py
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option:
'install_requires'
 warnings.warn(msg)
 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

推荐答案

此软件包位于PyPI上,因此您所要做的就是运行以下命令:

This package is on PyPI, so all you have to do is run the following command:

pip install hazm
pip2 install hazm #Explicit python 2 selection
pip3 install hazm #Explicit python 3 selection

如果您确实要使用该文件,则必须运行setup.py文件,可以使用以下命令执行此操作(假设您位于hazm-master文件夹中):

If you really want to use that file, you have to run the setup.py file, you can do this using the following command (assuming you are in the hazm-master folder):

python ./setup.py
python2 ./setup.py #Explicit python 2 selection
python3 ./setup.py #Explicit python 3 selection

这篇关于使用zip文件安装python模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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