Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm says "tarfile.ReadError: file could not be opened successfully"

Today I tried to create a new python project unsing Pycharm, with Python3.2. But I figured out that something is wrong.

When I tried to find the path of my python interpreter, I get that one:

Python 3.2 (r32, Apr 18 2018)
>>> import sys
>>> print(sys.executable)
/usr/local/bin/python3.2

So I put this path on the filling section Base interpreter.

Windows python interpreter Pycharm Project

But when pressing button Create project, this error occurs:

Traceback (most recent call last):
  File "/home/David/pycharm-community-2018.1.1/helpers/packaging_tool.py", line 159, in main
    retcode = do_untar(name)
  File "/home/David/pycharm-community-2018.1.1/helpers/packaging_tool.py", line 100, in do_untar
    tar = tarfile.open(name)
  File "/usr/local/lib/python3.2/tarfile.py", line 1744, in open
    raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

Could someone tell me what is wrong? Thanks.

like image 226
Dadou Avatar asked Nov 07 '22 08:11

Dadou


1 Answers

I've got stuck with exactly the same thing and found the answer here:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/206601205-Can-t-Install-setuptools-from-within-PyCharm-on-Linux?page=1

You have to compile zlib and recompile python with zlib headers path.

Here's how to compile Python (don't forget the -with-zlib part):

https://stackabuse.com/install-python-on-mac-osx/#installpythonfromsource

like image 51
Alexander Eliseyev Avatar answered Nov 14 '22 20:11

Alexander Eliseyev