Install python module using zip file

I downloaded the zip file from here , but I don’t know how to install it, and then use it in my python 2.7 they said they support both python 2 and 3

with the command: "pip install hazm" after a bunch of lines that it receives from 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 the command: "python./setup.py", these errors are displayed:

 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 
+6
source share
6 answers

This package is in PyPI, so you only need to run the following command:

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

If you really want to use this file, you need to run the setup.py , you can do this using the following command (provided that you are in the folder with the mask mask):

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

The correct way to install a zip file (at least if it was correctly designed, but I just tested it, and it is) with pip :

 pip install hazm-master.zip 

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

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

But none of them are needed, because, as in the readme file , you do not need to download it manually; just do:

 pip install hazm 
+14
source

As far as I know, hazm 0.5 uses libwapiti for its POS Tagger class, and I would likewise associate the problem with installing hazm on top of Windows 7. For Python 2.7 you should use MS VC ++ 2008 (aka 9.00) for Python 2.7 (available on Microsoft site) for some packages, including hazm . But the pain will not end here! MSVC9 does not have some C ++ header files, such as stdbool.h and several others, which you must create or copy to a folder manually in the MSVC installation folder. If you want to use hazm 0.5, the best way is to install it and use it on Linux:

 sudo pip install hazm 

or

 sudo pip3 install hazm 

But if you need to use it under Windows, you can use hazm 0.4 , which does not need a complex libwapiti module, as the creator of hazm recommended:

 pip install hazm==0.4 
+2
source

To install hazm , you need to install all its prerequisites.

If you install it using pip install hazm or pip install hazm-master.zip , pip will try to extract and install everything for you. If you unzip it and run setup.py manually, you should take care to find out and set all the prerequisites yourself (and possibly tell hazm how to find them); it will not solve anything.

Your problem is with libwapiti , which requires a C compiler and supposedly also the Wapiti C library. In fact, I'm not sure if Wapiti and libwapiti work on Windows at all. Maybe they will, but if not, all you can do is port them yourself, submit a feature request to your trackers for the problem, or use Cygwin instead of your native Windows.

Anyway, if they support Windows, then you need to:

  • Download, create and install Wapiti (see the link above and read the instructions on your website or inside the package).
  • pip install hazm again.
+1
source

I checked libwapiti and it seems to work only on Linux. because of this, I can’t install haze on the windows. finally i was able to install hazm on linux.

+1
source

Based on my experience - several times when I reinstalled Windows / Ubuntu and thus Python and its packages, including hazm , I would not look for a new version due to some of my premises, which caused me several problems before I I’ll find them out. For Ubuntu, this was normal, but for Windows I could not build and configure all the prerequisites like wapiti and libwapiti . I suggest installing and using hazm 0.4 or 0.3. Not every update makes life easier, believe me!

+1
source

Source: https://habr.com/ru/post/986908/


All Articles