couldbejake / spotify2mp3

Simple free and unlimited Spotify playlist downloads. Spotify2mp3 - Spotify Downloader
MIT License
269 stars 42 forks source link

Debian Linux conda Python 3.11 issues and missing inport os issue #37

Closed bradsec closed 11 months ago

bradsec commented 11 months ago

FYI - In case it helps. This relates to install issues I had using a conda environment on Debian Linux - Tried with Python 3.11 environment. However, had all sort of issues with pip install requirements.txt failing -

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for lxml
  Running setup.py clean for lxml
  Building wheel for python-Levenshtein (setup.py) ... done
  Created wheel for python-Levenshtein: filename=python_Levenshtein-0.12.2-cp311-cp311-linux_x86_64.whl size=79926 sha256=e69a83d9feb6068b08c36444b35be3d8cd453fe2af27429ec506f507bc4a4ffd
  Stored in directory: .../.cache/pip/wheels/08/39/17/367da5b72aee88c27ba574660010188efcad074dc4d02060ed
Successfully built bs4 coverage moviepy numpy python-Levenshtein
Failed to build Pillow lxml
ERROR: Could not build wheels for Pillow, lxml, which is required to install pyproject.toml-based projects

Changed conda environment to Python 3.10.9 and all requirements installed without a problem. However, I still needed to add import os to the imports in const.py - otherwise it would not run. Here is the error -

# python spotify2mp3.py
Traceback (most recent call last):
  File "/spotify2mp3/spotify2mp3.py", line 10, in <module>
    import utils
  File "/spotify2mp3/utils.py", line 1, in <module>
    from const import colours, BASE62
  File "/spotify2mp3/const.py", line 11, in <module>
    class colours:
  File "/spotify2mp3/const.py", line 25, in colours
    SPOTIFYGREEN = '\033[38;2;30;215;96m' if supports_24bit_color() else '\033[92m'
  File "/spotify2mp3/const.py", line 7, in supports_24bit_color
    return os.getenv("COLORTERM") == "truecolor"
NameError: name 'os' is not defined
couldbejake commented 11 months ago

Hi there @bradsec, it looks like we had a missing import statement for os.

I've now updated the code, it should now work correctly.

Thanks for using spotify2mp3