Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install python module using a zip file

Tags:

python

module

pip

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

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

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
like image 609
mohammad eslahi sani Avatar asked May 10 '15 06:05

mohammad eslahi sani


People also ask

Can you pip install a zip file?

The pip install command can accept a URL to a zip file or tarball.

Can you manually install Python modules?

Download the package and extract it into a local directory. If the package includes its own set of installation instructions, they should be followed. Otherwise, the most common method for manually installing a package is to implement setup.py.

How do I install a Python module?

The best and recommended way to install Python modules is to use pip, the Python package manager. Otherwise: Download get-pip.py from https://bootstrap.pypa.io/get-pip.py. Run python get-pip.py.


1 Answers

The right way to install a zipfile (at least if it's properly designed, but I just tested this one, and it is) is with pip:

pip install hazm-master.zip

Or, if you prefer, you can unzip it and use pip from within the directory:

unzip hazm-master.zip
cd hazm-master
pip install .

But neither of these is really necessary, because, as the project's readme says, you don't need to download it manually; just do:

pip install hazm
like image 147
abarnert Avatar answered Oct 25 '22 00:10

abarnert