Меню

Pip install pyminizip ошибка

Thank you so much for this wrapper. I’ve been able to use pip to install on ubuntu, but I haven’t been able to get it to install on windows due to multiple compiler errors.

I’ve tried to install the zlib library on windows (gnuwin32), but I’m not sure pyminizip/setup.py knows how to find the source files it needs from that library.

Here is one error log from Pycharm package installer:

Here’s the error log:
Install packages failed: Error occurred when installing package pyminizip.

The following command was executed:

packaging_tool.py install —build-dir C:UsersPyleeAppDataLocalTemppycharm-packaging2473906546786097704.tmp pyminizip

The error output of the command:

Downloading/unpacking pyminizip
Running setup.py egg_info for package pyminizip

Installing collected packages: pyminizip
Running setup.py install for pyminizip
building ‘pyminizip’ extension
C:Program Files (x86)Microsoft Visual Studio 9.0VCBINcl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc «-ID:Program Files (x86)Python27include» «-ID:Program Files (x86)Python27PC» /Tcsrc/py_minizip.c /Fobuildtemp.win32-2.7Releasesrc/py_minizip.obj
py_minizip.c
c:userspyleeappdatalocaltemppycharm-packaging2473906546786097704.tmppyminizipsrczip.h(43) : fatal error C1083: Cannot open include file: ‘zlib.h’: No such file or directory
error: command ‘»C:Program Files (x86)Microsoft Visual Studio 9.0VCBINcl.exe»‘ failed with exit status 2
Complete output from command «D:Program Files (x86)Python27python.exe» -c «import setuptools;file=’C:UsersPyleeAppDataLocalTemppycharm-packaging2473906546786097704.tmppyminizipsetup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record c:userspyleeappdatalocaltemppip-d5vjjc-recordinstall-record.txt:
running install

running build

running build_ext

building ‘pyminizip’ extension

creating build

creating buildtemp.win32-2.7

creating buildtemp.win32-2.7Release

creating buildtemp.win32-2.7Releasesrc

C:Program Files (x86)Microsoft Visual Studio 9.0VCBINcl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc «-ID:Program Files (x86)Python27include» «-ID:Program Files (x86)Python27PC» /Tcsrc/py_minizip.c /Fobuildtemp.win32-2.7Releasesrc/py_minizip.obj

py_minizip.c

c:userspyleeappdatalocaltemppycharm-packaging2473906546786097704.tmppyminizipsrczip.h(43) : fatal error C1083: Cannot open include file: ‘zlib.h’: No such file or directory

error: command ‘»C:Program Files (x86)Microsoft Visual Studio 9.0VCBINcl.exe»‘ failed with exit status 2


Command «D:Program Files (x86)Python27python.exe» -c «import setuptools;file=’C:UsersPyleeAppDataLocalTemppycharm-packaging2473906546786097704.tmppyminizipsetup.py’;exec(compile(open(file).read().replace(‘rn’, ‘n’), file, ‘exec’))» install —single-version-externally-managed —record c:userspyleeappdatalocaltemppip-d5vjjc-recordinstall-record.txt failed with error code 1 in C:UsersPyleeAppDataLocalTemppycharm-packaging2473906546786097704.tmppyminizip
Storing complete log in C:UsersPyleeAppDataRoamingpippip.log

Recommend Projects

  • React photo

    React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

Project description

To create a password encrypted zip file in python.
And the zip file is able to extract in WINDOWS.

This is a simple Minizip wrapper of python.
(http://www.winimage.com/zLibDll/minizip.html)

This software uses zlib.
License: zlib/libpng License.

Install

$ pip install pyminizip

Install zlib

# linux
$ sudo apt-get install zlib
# mac
$ xcode-select --install
$ brew install zlib

How to use

This package just provides three functions.

pyminizip.compress("/srcfile/path.txt", "file_path_prefix", "/distfile/path.zip", "password", int(compress_level))

Args:

  1. src file path (string)
  2. src file prefix path (string) or None (path to prepend to file)
  3. dst file path (string)
  4. password (string) or None (to create no-password zip)
  5. compress_level(int) between 1 to 9, 1 (more fast) <—> 9 (more compress) or 0 (default)

Return value:

  • always returns None
pyminizip.compress_multiple([u'pyminizip.so', 'file2.txt'], [u'/path_for_file1', u'/path_for_file2'], "file.zip", "1233", 4, progress)

Args:

  1. src file LIST path (list)
  2. src file LIST prefix path (list) or []
  3. dst file path (string)
  4. password (string) or None (to create no-password zip)
  5. compress_level(int) between 1 to 9, 1 (more fast) <—> 9 (more compress)
  6. optional function to be called during processing which takes one argument, the count of how many files have been compressed

Return value:

  • always returns None
pyminizip.uncompress("/srcfile/path.zip", "password", "/dirtoextract", int(withoutpath))

Args:

  1. src file path (string)
  2. password (string) or None (to unzip encrypted archives)
  3. dir path to extract files or None (to extract in a specific dir or cwd)
  4. withoutpath (exclude path of extracted)

Return value:

  • always returns None

Download files

Download the file for your platform. If you’re not sure which to choose, learn more about installing packages.

Source Distribution

Когда я пытаюсь установить pyminzip, я вижу это

C:UsersUser>pip install pyminizip
Collecting pyminizip
  Downloading pyminizip-0.2.4.tar.gz (258 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 258.7/258.7 kB 155.4 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyminizip
  Building wheel for pyminizip (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [5 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'pyminizip' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyminizip
  Running setup.py clean for pyminizip
Failed to build pyminizip
Installing collected packages: pyminizip
  Running setup.py install for pyminizip ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pyminizip did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      running install
      C:UsersUserAppDataLocalProgramsPythonPython38libsite-packagessetuptoolscommandinstall.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      building 'pyminizip' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pyminizip

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

1 ответ

Прямо сказано:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

Пожалуйста, установите компилятор Microsoft Visual C++, чтобы он работал


0

TNtube
2 Авг 2022 в 17:39

mfrlin

This is the error when you do pip install pyminizip

In file included from src/zip.c:66:0:
    src/crypt.h:34:23: error: conflicting types for ‘z_crc_t’
     typedef unsigned long z_crc_t;
                           ^
    In file included from /usr/include/zlib.h:34:0,
                     from src/zip.c:36:
    /usr/include/x86_64-linux-gnu/zconf.h:406:17: note: previous declaration of ‘z_crc_t’ was here
        typedef Z_U4 z_crc_t;
                     ^
    src/zip.c:201:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     local linkedlist_datablock_internal* allocate_new_datablock OF(());
     ^
    src/zip.c:202:38: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     local linkedlist_datablock_internal* allocate_new_datablock()
                                          ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

This is on Debian Jessie. I’ve also tried to install zlib1g package and it was the same.

lohr-ti

File «buildbdist.win32eggpyminizip.py», line 7, in
File «buildbdist.win32eggpyminizip.py», line 6, in bootstrap
ImportError: DLL load failed: The specified module could not be found.
Failed to execute script app

Any glue?

ppawiggers

This works fine (it creates a password protected ZIP):

pyminizip.compress('file1.docx', 'files.zip', 'password', 5)

But this doesn’t (it creates a ZIP without password protection):

pyminizip.compress_multiple(['file1.docx', 'file2.docx'], 'files.zip', 'password', 5)

tpost

Only the source is available on pypi.python.org, so users must first install ‘zlib’ before running pip install pyminizip. If pyminizip were also distributed as a binary wheel package, then that extra manual step would be eliminated. This would be helpful for people installing pyminizip in a virtualenv or for downstream PIP projects that depend on pyminizip.

This could be done by running the following on a system with zlib already installed:

pip install twine
pip install wheel
python setup.py sdist bdist_wheel
twine upload dist/*

ericpyle

as far as I can tell, in both the compress and compress_multiple api there is no way to copy source files into subfolders in the destination zip. One side-effect of this, is that different files having duplicate names can result in multiple entries in the archive, but extracts only to one file (race condition).

Some possible implementations:

  1. have compress and compress_multiple take a dictionary argument that maps from source path-name to destination path name
  2. in compress_multiple, use subfolder structure if all the src directories have a common base directory

Я пытаюсь установить модуль pyminizip python на моем ПК, но у меня есть ошибка:

C:Python27Scripts>pip install pyminizip
Collecting pyminizip
Using cached pyminizip-0.2.1.tar.gz
Installing collected packages: pyminizip
Running setup.py install for pyminizip ... error
Complete output from command c:python27python.exe -u -c "import setuptools
, tokenize;__file__='c:\users\andrei~1.gug\appdata\local\temp\pip-build-mb
aaft\pyminizip\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.re
ad().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" inst
all --record c:usersandrei~1.gugappdatalocaltemppip-9hqnfh-recordinstall-
record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyminizip' extension
creating build
creating buildtemp.win32-2.7
creating buildtemp.win32-2.7Release
creating buildtemp.win32-2.7Releasesrc
C:UsersAndrei-Cristian.GUGIAppDataLocalProgramsCommonMicrosoftVisual
C++ for Python9.0VCBincl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc -Ic
:python27include -Ic:python27PC /Tcsrc/py_minizip.c /Fobuildtemp.win32-2.7
Releasesrc/py_minizip.obj
py_minizip.c
c:usersandrei-cristian.gugiappdatalocaltemppip-build-mbaaftpyminizip
srczip.h(43) : fatal error C1083: Cannot open include file: 'zlib.h': No such f
ile or directory
error: command 'C:\Users\Andrei-Cristian.GUGI\AppData\Local\Programs\C
ommon\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit
status 2

----------------------------------------
Command "c:python27python.exe -u -c "import setuptools, tokenize;__file__='c:
users\andrei~1.gug\appdata\local\temp\pip-build-mbaaft\pyminizip\setup.p
y';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n
');f.close();exec(compile(code, __file__, 'exec'))" install --record c:usersan
drei~1.gugappdatalocaltemppip-9hqnfh-recordinstall-record.txt --single-vers
ion-externally-managed --compile" failed with error code 1 in c:usersandrei~1.
gugappdatalocaltemppip-build-mbaaftpyminizip

Я также попытался установить zlib.dll → скопирован из Интернета в C:WindowsSysWOW64 → тот же результат

Может кто-то, пожалуйста, помогите мне с этой вершиной?

Я пытаюсь установить pyminizip с помощью OS X El Capitan и получаю следующую ошибку:

Failed with error code 1 in
/private/var/folders/l9/n4qbh8w554qcqlq88wkvn1ph0000gn/T/pip-install-bc9ds31c/pyminizip

Пожалуйста, постарайтесь изложить свой вопрос так, чтобы люди могли его прочитать.


— Dragonthoughts

25.05.2018 10:36

Я внес некоторые изменения. По сути удалил всю лишнюю информацию.


— Munu

25.05.2018 13:54

Как вы пытаетесь его установить?


— AKX

04.06.2018 12:31

14 Задание: Типы данных и структуры данных Python для DevOps

Python PyPDF2 - запись метаданных PDF

Переменные, типы данных и операторы в Python

Почему Python - идеальный выбор для проекта AI и ML

Как автоматически добавлять котировки в заголовки запросов с помощью PyCharm

Анализ продукта магазина на Tokopedia

Анализ продукта магазина на Tokopedia

Tokopedia — это место, где продавцы могут продавать свои товары. Товар должен быть размещен на витрине, чтобы покупателям было легче найти товар…

Другие вопросы по теме

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Pip install pygame ошибка
  • Pip install pyautogui ошибка