0

I have a question here, and then I have followed this answer https://stackoverflow.com/a/43756412/12375559 to download the file and installed from my windows prompt, and it seems the python-snappy has been installed

C:\Users\xxxx\IdeaProjects\xxxx\venv>pip install python_snappy-0.5.4-cp38-cp38-win32.whl
Processing c:\users\xxxxxx\ideaprojects\xxxxxx\venv\python_snappy-0.5.4-cp38-cp38-win32.whl
Installing collected packages: python-snappy
Successfully installed python-snappy-0.5.4

WARNING: You are using pip version 20.2.2; however, version 20.3 is available.
You should consider upgrading via the 'c:\users\xxxxxx\appdata\local\programs\python\python38-32\python.exe -m pip install --upgrade pip' command.

But when I tried to run my script in Pycharm it's still not working, I still got the error File "C:\Users\xxxx\venv\lib\site-packages\fastparquet\compression.py", line 143, in decompress_data raise RuntimeError("Decompression '%s' not available. Options: %s" % RuntimeError: Decompression 'SNAPPY' not available. Options: ['GZIP', 'UNCOMPRESSED']

Then I tried the process to install the wheel inside Pycharm terminal, but it doesn't work:

(venv) C:\Users\xxx\IdeaProjects\xxx\venv>pip install python_snappy-0.5.4-cp38-cp38-win32.whl
python_snappy-0.5.4-cp38-cp38-win32.whl is not a supported wheel on this platform.

(venv) C:\Users\xxx\IdeaProjects\xxx\venv>python.exe -c "import distutils.util; print(distutils.util.get_platform())"
win32

(venv) C:\Users\xxx\IdeaProjects\xxx\venv\Scripts>pip install python_snappy-0.5.4-cp38-cp38-win32.whl
Requirement 'python_snappy-0.5.4-cp38-cp38-win32.whl' looks like a filename, but the file does not exist
python_snappy-0.5.4-cp38-cp38-win32.whl is not a supported wheel on this platform.

(venv) C:\Users\xxx\IdeaProjects\xxx\venv\Scripts>pip install C:\Users\xxx\IdeaProjects\xxx\venv\Scripts\python_snappy-0.5.4-cp38-cp38-win32.whl
python_snappy-0.5.4-cp38-cp38-win32.whl is not a supported wheel on this platform.

(venv) C:\Users\xxx\IdeaProjects\xxx\venv\Scripts>activate

(venv) C:\Users\xxx\IdeaProjects\xxx\venv\Scripts>pip install C:\Users\xxx\IdeaProjects\xxx\venv\Scripts\python_snappy-0.5.4-cp38-cp38-win32.whl
python_snappy-0.5.4-cp38-cp38-win32.whl is not a supported wheel on this platform.

(venv) C:\Users\xxx\IdeaProjects\xxx\venv\Scripts>pip install python_snappy-0.5.4-cp38-cp38-win32.whl
python_snappy-0.5.4-cp38-cp38-win32.whl is not a supported wheel on this platform.

(venv) C:\Users\x\IdxxeaProjects\xxx\venv\Scripts>cd ..

(venv) C:\Users\x\IdeaxxProjects\xxx\venv>pip install python_snappy-0.5.4-cp38-cp38-win32.whl
python_snappy-0.5.4-cp38-cp38-win32.whl is not a supported wheel on this platform.

I tried different directory, it can't install the wheel, why I installed it from my local prompt but in Pycharm, it still indicates that the package 'python-snappy' in not installed? Am I missing something? Please help me.....

wawawa
  • 2,835
  • 6
  • 44
  • 105
  • Even if `distutils.util.get_platform()` print `win32`, did you try the amd64 version ? – Frodon Dec 02 '20 at 13:57
  • yeah I tried, it gave me `python_snappy-0.5.4-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.`, and I installed `win32` version from my prompt, it's just not working in Pycharm, don't know why – wawawa Dec 02 '20 at 14:04
  • Use `python -m pip debug --verbose` to get the list of wheel tags compatible with your interpreter. – sinoroc Dec 02 '20 at 14:15
  • Maybe you can try [this procedure (see part 3)](https://www.dev2qa.com/pycharm-project-add-external-library-pymysql-path-example/) by adapting it to Windows ? – Frodon Dec 02 '20 at 14:15
  • @sinoroc Hi, this is the output: `pip version: pip 20.2.2 from C:\Users\x\IdeaProjects\x\venv\lib\site-packages\pip (python 3.8) sys.version: 3.8.0 Compatible tags: 30 cp38-cp38-win32 cp38-abi3-win32 cp38-none-win32 cp37-abi3-win32 cp36-abi3-win32 cp35-abi3-win32 cp34-abi3-win32 cp33-abi3-win32 cp32-abi3-win32 py38-none-win32 py3-none-win32 py37-none-win32 py36-none-win32 py35-none-win32 py34-none-win32 cp38-none-any py38-none-any py37-none-any ` – wawawa Dec 02 '20 at 14:47
  • @Frodon Weirdly, there's no `Install to user’s site packages directory checkbox,` option on my Pycharm..... – wawawa Dec 02 '20 at 14:52
  • 1
    `cp38-cp38-win32` is in the list so that _wheel_ you have should be compatible. Are you 100% sure you are calling the right _pip_ for the right _python_? Make sure to always call `path/to/pythonX.Y -m pip install` (and not just `pip`). – sinoroc Dec 02 '20 at 14:57
  • @Cecilia, the Python interpreter must not be a venv one. When it is a System interpreter, the checkbox "Install to user's site packages directory" appear. To add a System interpreter: Click Gear > Show All > Click "+" > System interpreter – Frodon Dec 02 '20 at 15:06
  • @sinoroc Oh I've managed to install it in the Pycharm console, but when I looked in `Project Interpreter`, `python-snappy`package is still not there, I don't understand why... – wawawa Dec 02 '20 at 15:07
  • @sinoroc but the script runs successfully now!!!!! Thank you so much ! – wawawa Dec 02 '20 at 15:09
  • @Frodon Thank you, I didn't got chance to try this method, but with sinoroc 's method I'm able to install the package and fix the error! Many thanks! – wawawa Dec 02 '20 at 15:10
  • 1
    Yeah I just also managed to install the wheel file using the full path to python.exe. And the snappy package appears in the pycharm packages list. – Frodon Dec 02 '20 at 15:13
  • 1
    This is a very common mistake. I wish people simply stopped calling _pip_ directly, ever. For reference: https://snarky.ca/why-you-should-use-python-m-pip/ – sinoroc Dec 02 '20 at 15:33

1 Answers1

1

Using the full path to the correct Python interpreter does the job:

\path\to\python.exe -m pip install --upgrade pip
\path\to\python.exe -m pip install \path\to\python_snappy-0.5.4-cp38-cp38-win32.whl
Frodon
  • 3,684
  • 1
  • 16
  • 33