Questions tagged [bz2]

For issues relating to bz2 which is the file extension of compressed files by bzip2.

Files compressed with bzip2 are frequently given the bz2 extension. bunzip2 should be used to decompress these files.

tar supports bzip2 with the -j option, which can be used to extract or create archives that are also compressed with bzip2.

Also see tag bzip2

106 questions
1
vote
1 answer

how to decompress .tar.bz2 in memory with python

How to decompress *.bz2 file in memory with python? The bz2 file comes from a csv file. I use the code below to decompress it in memory, it works, but it brings some dirty data such as filename of the csv file and author name of it, is there any…
buxizhizhoum
  • 1,719
  • 1
  • 23
  • 32
1
vote
1 answer

Getting error while encrypting password using Python

I am getting the following error while encrypting the password using bz2 module using Python. Here I am saving that encrypted value inside DB. Error: ProgrammingError at /signsave/ You must not use 8-bit bytestrings unless you use a text_factory…
satya
  • 3,508
  • 11
  • 50
  • 130
1
vote
2 answers

Python3: write string into .txt.bz2 file

I want to write the join result by two list into the txt.bz2 file(the file name is named by code, not exist at the beginning). like the following form in txt file. 1 a,b,c 0 d,f,g ....... But there is error. My code is following, please give me…
tktktk0711
  • 1,656
  • 7
  • 32
  • 59
1
vote
3 answers

tarfile compressionerror bz2 module is not available

I'm trying to install twisted pip install https://pypi.python.org/packages/18/85/eb7af503356e933061bf1220033c3a85bad0dbc5035dfd9a97f1e900dfcb/Twisted-16.2.0.tar.bz2#md5=8b35a88d5f1a4bfd762a008968fddabf This is for a django-channels project and…
copser
  • 2,523
  • 5
  • 38
  • 73
1
vote
1 answer

Reading a large compressed file using Apache Commons Compress

I'm trying to read a bz2 file using Apache Commons Compress. The following code works for a small file. However for a large file (over 500MB), it ends after reading a few thousands lines without any error. try { InputStream fin = new…
Benben
  • 1,355
  • 5
  • 18
  • 31
1
vote
1 answer

Create a .tar.bz2 file given an array of files

In a Bash script, I have an array that contains a list of files (in the form of their complete file paths): declare -a individual_files=("/path/to/a" "/path/to/b" "/path/to/c") I want to create a compressed file in tar.bz2 which contains all the…
skyork
  • 7,113
  • 18
  • 63
  • 103
1
vote
1 answer

python bz2 compression of string

>>> import bz2 >>> bz2.compress('hi') Traceback (most recent call last): File "", line 1, in File "/Users/ryan/anaconda/lib/python3.4/bz2.py", line 498, in compress return comp.compress(data) + comp.flush() TypeError: 'str' does not…
Ryan Halabi
  • 95
  • 4
  • 17
0
votes
0 answers

Pyinstaller creating exe, but DLL load failure importing bz2

I have the following two lines of code which I’m trying to turn into an executable using pyinstaller. import pandas as pd print('hello') I’m using the command pyinstaller --onefile hello.py and the executable is created without exception. However,…
0
votes
2 answers

Using pandas library without bz2 (No root access, can't install bz2)

I am trying to run a python code which uses pandas library. I am getting an error saying that bz2 can not be found. I do not have root access and can not install anything. Is there a way to use pandas in another way? There are similar questions to…
SMMousaviSP
  • 624
  • 7
  • 23
0
votes
0 answers

ModuleNotFoundError: No module named '_bz2' in Google Cloud Workstation

I launched a new Google Cloud Workstation and create a single python file with these contents: import bz2 import binascii original_data = 'This is the original text.' print ('Original :', len(original_data), original_data) compressed =…
0
votes
1 answer

Receiving 403 Forbidden Error when uploading certain bz2 files as Block Blob through Azure Portal

I am using Azure Portal to upload a bunch of bz2 files manually as block blobs with 4MB block size to a single container. I am the owner of the container. I am able to upload bz2 files as block blobs that range from 2 MB to 75MB. However, there…
0
votes
0 answers

How to extract "wikibase_item" from wikipedia dump?

Hi everyone I'm looking to extract the value of "wikibase_item" for every article in Wikipedia by using wiki dump via bz2 (that I already downloaded). example for what value I want to achieve…
0
votes
1 answer

Incorrect CSV parsing when reading in BZ2 file

I'm trying to read in a BZ2 file from the Reddit Politosphere dataset (specifically the "comments_2008-01.bz2" file). The dataset contains, among other things, the body of a Reddit comment. If I read the file in using read.csv, it works well for the…
0
votes
1 answer

How to BZ2Decompress file containing multiple files?

I'm trying to unzip a zipfile (compressed with BZ2) into a directory. The zipfile contains multiple files. All (and I've seen quite a few already...) of the examples show how to decompress the zipfile into one file. This is what I have so far: def…
BertC
  • 2,243
  • 26
  • 33
0
votes
1 answer

Python ijson - parse error: trailing garbage // bz2.decompress()

I have come across an error while parsing json with ijson. Background: I have a series(approx - 1000) of large files of twitter data that are compressed in a '.bz2' format. I need to get elements from the file into a pd.DataFrame for further…
James
  • 15
  • 4