5

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.

Dadou
  • 175
  • 1
  • 13
  • What is the file referred to by the variable `name`? Is it a gzipped tar? Does your Python have support for zlib? [The search for the error](https://www.google.com/search?q=raise+ReadError("file+could+not+be+opened+successfully")) – Dan D. Apr 18 '18 at 15:29
  • 1
    narrowed down the problem, i have installed python 3.6.5 in ubuntu in usr/local/lib and inbuilt python 3.5 is in usr/bin, if i use 3.5 i got no erorrs, but if i use 3.6.5 i got the same error – Kanishk Tanwar May 18 '18 at 11:03
  • 1
    I have the same problem with Python 3.7 in Ubuntu. Has anybody solved this issue? – franchb Sep 14 '18 at 07:23
  • I had a similar problem. It turned out that the file was an html page (with the extension .xz), not an actual archive. – Yaroslav Nikitenko Apr 02 '20 at 13:16

1 Answers1

1

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