Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
5660 Vistas
i want to install module "printer_zpl2"  but it shows the error "NameError: name 'zpl2' is not defined" . When i open the code i saw this 
try:
    import zpl2
except ImportError:
    _logger.debug('Cannot `import zpl2`.')

My question is how to get or download or install "zpl2" ?? i have executed the command "pip install zpl2" but nothing change . Any help please??
Avatar
Descartar
Mejor respuesta

Hi Dhouha, The package name is pyzpl2. 

try : sudo pip install pyzpl2

I have tried it and installed pyzpl2-0.1 in my machine.

UPDATE

You can check the list of python packages installed in  your machine by doing : pip freeze
your package would be installed to the site-packages directory of your python installation.
You can check your site-packages directory(s) like this : 

$ ipython
>>> import site
>>> site.getsitepackages()

you get a list like this : ['<path>', ...]

go to the path and check your package.

I hope this helps.

Avatar
Descartar
Autor

thanks for your answer , i have verified my site-packages directory it containes a directory named "pyzpl2-0.1-py2.7.egg-info" but when tried to reinstall the module "printer_zpl2" it shows always the same error "NameError: name 'zpl2' is not defined"

Autor

Do you install this module and it works in your machine ??

Please check https://pypi.org/search/?q=Zpl

And tell me if you still have a problem.

Thank you.

i think simple_zpl2 is what you are looking for ( please read the doc, you will find a function print_zpl that sends formatted text to a network label printer. It is already included)

Autor

the probleme is the directory zpl2 exist in my computer with "zpl2.py" and "__init__.py" but it seems that during the installation it doesn't see it

Publicaciones relacionadas Respuestas Vistas Actividad
0
may 25
165
2
abr 25
2412
1
feb 25
755
2
feb 25
1274
2
ene 25
1376