Librosa installation pip fail - python

I am trying to install librosa by pip install librosa on the mac terminal, pip3 also has the same problem. It also gets stuck when I try to install scikit-learn.
Doesn't go any further than:
Collecting librosa
Using cached librosa-0.8.1-py3-none-any.whl (203 kB)
Collecting packaging>=20.0
Using cached packaging-21.0-py3-none-any.whl (40 kB)
Requirement already satisfied: numpy>=1.15.0 in /opt/homebrew/lib/python3.9/site-packages (from librosa) (1.21.0)
Requirement already satisfied: scipy>=1.0.0 in /opt/homebrew/lib/python3.9/site-packages (from librosa) (1.7.0)
Collecting numba>=0.43.0
Using cached numba-0.53.1.tar.gz (2.2 MB)
Collecting resampy>=0.2.2
Using cached resampy-0.2.2.tar.gz (323 kB)
Requirement already satisfied: soundfile>=0.10.2 in /opt/homebrew/lib/python3.9/site-packages (from librosa) (0.10.3.post1)
Collecting scikit-learn!=0.19.0,>=0.14.0
Using cached scikit-learn-0.24.2.tar.gz (7.5 MB)
Installing build dependencies ... \
I am very new at this, please help I just want to draw some spectrograms.
python --version
Python 2.7.16
python3 --version
Python 3.9.6
pip --version
pip 21.1.3 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)

It might be useful for you to work in a virtual environment. If you are trying to install with python 3.9 there may be a number of dependency issues, so using a lower version may also solve your issues. However, do try to with a conda environment as this will allow you to more easily keep track of install packages etc. Here are the install instructions:
After the install you can create a conda environment with a lower python version:
conda create -n "py38" python=3.8 ipython
Activate the environment:
conda activate py38
Install librosa:
conda install -c conda-forge librosa

Related

Setup awscli inside pipenv with python3

Summary
setup pipenv
confirm pip and python versions
install awscli
confirm aws version (fails)
Using: MacOs 10.14.6
Set up pipenv environment
$ pipenv shell
Creating a virtualenv for this project…
Pipfile: /Users/XXX/Documents/dev/2019/delete_test_boto3/Pipfile
Using /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/bin/python3.7 (3.7.4) to create virtualenv…
...
Once this finishes, the shell is automatically entered and all next commands are run from within it.
Confirming that the versions are right
$ python --version
Python 3.7.4
$ pip3 --version
pip 19.2.3 from /Users/XXX/.local/share/virtualenvs/delete_test_boto3-Dcz9_GEz/lib/python3.7/site-packages/pip (python 3.7)
Installing awscli
Note:
I didnt use --user because it doesn't work in pipenv as done in the Install the AWS CLI in a Virtual Environment
glancing over the output, there seem to be a few too many 2's compared to 3's
$ pip3 install awscli --upgrade
Collecting awscli
Using cached https://files.pythonhosted.org/packages/b6/c4/1ff0b54849991f6c8d8d1d8ab41f18a2c6f6915ecee2293ff7cc3b8c50fe/awscli-1.16.253-py2.py3-none-any.whl
Collecting botocore==1.12.243 (from awscli)
Using cached https://files.pythonhosted.org/packages/5e/0d/61f8d01ec9845f26aaf4d97ab8adf26c939c9ad2e55f4bb6b1f0cb2b4948/botocore-1.12.243-py2.py3-none-any.whl
Collecting PyYAML<=5.2,>=3.10; python_version != "2.6" (from awscli)
Collecting colorama<0.4.2,>=0.2.5; python_version != "2.6" and python_version != "3.3" (from awscli)
Using cached https://files.pythonhosted.org/packages/4f/a6/728666f39bfff1719fc94c481890b2106837da9318031f71a8424b662e12/colorama-0.4.1-py2.py3-none-any.whl
Collecting rsa<=3.5.0,>=3.1.2 (from awscli)
Using cached https://files.pythonhosted.org/packages/e1/ae/baedc9cb175552e95f3395c43055a6a5e125ae4d48a1d7a924baca83e92e/rsa-3.4.2-py2.py3-none-any.whl
Collecting docutils<0.16,>=0.10 (from awscli)
Using cached https://files.pythonhosted.org/packages/22/cd/a6aa959dca619918ccb55023b4cb151949c64d4d5d55b3f4ffd7eee0c6e8/docutils-0.15.2-py3-none-any.whl
Collecting s3transfer<0.3.0,>=0.2.0 (from awscli)
Using cached https://files.pythonhosted.org/packages/16/8a/1fc3dba0c4923c2a76e1ff0d52b305c44606da63f718d14d3231e21c51b0/s3transfer-0.2.1-py2.py3-none-any.whl
Collecting urllib3<1.26,>=1.20; python_version >= "3.4" (from botocore==1.12.243->awscli)
Using cached https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.12.243->awscli)
Using cached https://files.pythonhosted.org/packages/83/94/7179c3832a6d45b266ddb2aac329e101367fbdb11f425f13771d27f225bb/jmespath-0.9.4-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1; python_version >= "2.7" (from botocore==1.12.243->awscli)
Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli)
Using cached https://files.pythonhosted.org/packages/a1/71/8f0d444e3a74e5640a3d5d967c1c6b015da9c655f35b2d308a55d907a517/pyasn1-0.4.7-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.12.243->awscli)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: urllib3, docutils, jmespath, six, python-dateutil, botocore, PyYAML, colorama, pyasn1, rsa, s3transfer, awscli
Successfully installed PyYAML-5.1.2 awscli-1.16.253 botocore-1.12.243 colorama-0.4.1 docutils-0.15.2 jmespath-0.9.4 pyasn1-0.4.7 python-dateutil-2.8.0 rsa-3.4.2 s3transfer-0.2.1 six-1.12.0 urllib3-1.25.6
...and sure enough I checked the aws version and it's referring to python2:
$ aws --version
aws-cli/1.16.253 Python/2.7.10 Darwin/18.7.0 botocore/1.12.243
Furthermore, the version in the Install the AWS CLI in a Virtual Environment points to python3.
Expected output:
$ aws --version
aws-cli/1.16.116 Python/3.6.8 Linux/4.14.77-81.59-amzn2.x86_64 botocore/1.12.106
Edit:
I think this might be a MacOs issue since it comes pre-installed with Python 2.7.

Can't install new packages or list existing packages in virtual environment with pip

Update / Solution:
Found a fix/workaround in the answer to this question:
Pip installing packages to global site-packages when inside virtual environment.
Like the OP of that question, I'm also running Manjaro Linux with the latest updates.
When trying to install the django import_export module with pip install django-import-export into my virtual environment, it indicates that it was successfully installed, however, when I try to use the import_export module in my project, I receive an error: ModuleNotFoundError: No module named 'import_export'. I'm also unable to list any previously installed apps with pip list or pip freeze, and trying to upgrade the pip version using pip install --upgrade pip also says the new version is successfully installed, but isn't installed within my virtual environment.
I've made sure to activate my virtual environment with source /home/travis/Documents/Python/Django/Projects/issuetracker/.env/bin/activate.
Output from pip install django-import-export:
(.env) [travis#spooky issuetracker]$ pip install django-import-export
Collecting django-import-export
Using cached https://files.pythonhosted.org/packages/62/7a/ddd9aef718243504e7715bda9bb5a100cfc353be37dc819d9914a7073cba/django_import_export-1.2.0-py2.py3-none-any.whl
Collecting tablib (from django-import-export)
Using cached https://files.pythonhosted.org/packages/7b/c7/cb74031b330cd94f3580926dc707d148b4ba9138449fc9f433cb79e640d8/tablib-0.13.0-py3-none-any.whl
Collecting diff-match-patch (from django-import-export)
Using cached https://files.pythonhosted.org/packages/f0/2a/5ba07def0e9107d935aba62cf632afbd0f7c723a98af47ccbcab753d2452/diff-match-patch-20181111.tar.gz
Requirement already satisfied: django>=1.8 in ./.env/lib/python3.7/site-packages (from django-import-export) (2.2.4)
Collecting openpyxl>=2.4.0 (from tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/f5/39/942a406621c1ff0de38d7e4782991b1bac046415bf54a66655c959ee66e8/openpyxl-2.6.3.tar.gz
Collecting xlwt (from tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/44/48/def306413b25c3d01753603b1a222a011b8621aed27cd7f89cbc27e6b0f4/xlwt-1.3.0-py2.py3-none-any.whl
Collecting xlrd (from tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/b0/16/63576a1a001752e34bf8ea62e367997530dc553b689356b9879339cf45a4/xlrd-1.2.0-py2.py3-none-any.whl
Collecting backports.csv (from tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/8e/26/a6bd68f13e0f38fbb643d6e497fc3462be83a0b6c4d43425c78bb51a7291/backports.csv-1.0.7-py2.py3-none-any.whl
Collecting odfpy (from tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/85/7d/8f6d1f2a4683be362b101c00232b4c3839e4e4a90e0945d8d43ec6aa671d/odfpy-1.4.0.tar.gz
Collecting pyyaml (from tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz
Requirement already satisfied: sqlparse in ./.env/lib/python3.7/site-packages (from django>=1.8->django-import-export) (0.3.0)
Requirement already satisfied: pytz in ./.env/lib/python3.7/site-packages (from django>=1.8->django-import-export) (2019.2)
Collecting jdcal (from openpyxl>=2.4.0->tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/f0/da/572cbc0bc582390480bbd7c4e93d14dc46079778ed915b505dc494b37c57/jdcal-1.4.1-py2.py3-none-any.whl
Collecting et_xmlfile (from openpyxl>=2.4.0->tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/22/28/a99c42aea746e18382ad9fb36f64c1c1f04216f41797f2f0fa567da11388/et_xmlfile-1.0.1.tar.gz
Collecting defusedxml (from odfpy->tablib->django-import-export)
Using cached https://files.pythonhosted.org/packages/06/74/9b387472866358ebc08732de3da6dc48e44b0aacd2ddaa5cb85ab7e986a2/defusedxml-0.6.0-py2.py3-none-any.whl
Installing collected packages: jdcal, et-xmlfile, openpyxl, xlwt, xlrd, backports.csv, defusedxml, odfpy, pyyaml, tablib, diff-match-patch, django-import-export
Running setup.py install for et-xmlfile ... done
Running setup.py install for openpyxl ... done
Running setup.py install for odfpy ... done
Running setup.py install for pyyaml ... done
Running setup.py install for diff-match-patch ... done
Successfully installed backports.csv-1.0.7 defusedxml-0.6.0 diff-match-patch-20181111 django-import-export-1.2.0 et-xmlfile-1.0.1 jdcal-1.4.1 odfpy-1.4.0 openpyxl-2.6.3 pyyaml-5.1.2 tablib-0.13.0 xlrd-1.2.0 xlwt-1.3.0
WARNING: You are using pip version 19.2.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Python version:
(.env) [travis#spooky issuetracker]$ python -V
Python 3.7.4
Pip version:
(.env) [travis#spooky issuetracker]$ pip -V
pip 19.2.2 from /home/travis/Documents/Python/Django/Projects/issuetracker/.env/lib/python3.7/site-packages/pip (python 3.7)
.env/bin/pip:
#!/home/travis/Documents/Python/Django/Projects/issuetracker/.env/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
I'm not sure when this stopped working, since I was previously able to successfully install other packages into the same virtual environment. How can I ensure that pip is installing packages correctly into my virtual environment?
Update:
It seems that pip is installing into the .local/lib/python3.7/site-packages directory instead of .env/lib/python3.7/site-packages.
Found a fix/workaround in the answer to this question:
Pip installing packages to global site-packages when inside virtual environment
Like the OP of that question, I'm also running Manjaro Linux with the latest updates.

Could not find a version that satisfies the requirement menuinst (from conda)

I am using Windows 10 with python version 3.7 installed. Now I need to use the command pip install conda but it is showing an error. I searched for it but couldn't find a suitable answer. Please help.
C:\Users\ATech>pip install conda
Collecting conda
Using cached https://files.pythonhosted.org/packages/74/4e/c533c3136427be62c38cc0e038cabf167bb54489c2ced2f6df903c456861/conda-4.3.16.tar.gz
Collecting pycosat>=0.6.1 (from conda)
Using cached https://files.pythonhosted.org/packages/c0/fd/e38d68774c0a345b0090d608a90f1fbf423970d812f7ec7aef9ac024e648/pycosat-0.6.3.zip
Collecting requests>=2.12.4 (from conda)
Using cached https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl
Collecting ruamel.yaml>=0.11.14 (from conda)
Using cached https://files.pythonhosted.org/packages/ae/84/bcd094e5e1c0bfdfc87e31ecb9505b8d46998a9ab3eefc6a7183be3db84d/ruamel.yaml-0.15.88-cp37-cp37m-win32.whl
Collecting menuinst (from conda)
Could not find a version that satisfies the requirement menuinst (from conda) (from versions: )
No matching distribution found for menuinst (from conda)
Checking the PyPi conda project it seems python 3.7 is not supported (check the bottom left of the page).The package only looks to support up to python 3.6.
Edit
Though I posted a comment to this effect on your post, in case you missed it you should note that using pip install conda or easy_install conda will not give you conda as a standalone application.

Install Mayavi for Python 3.7.1 in Windows 10

Under Windows 10, I'm trying to run a Python script which contains the line
from mayavi import mlab
Therefore I'm trying to install Mayavi by running
pip install mayavi
from the Windows PowerShell. I then get
Collecting mayavi
Using cached https://files.pythonhosted.org/packages/83/9e/293ba57353ed258c2f64d54bf00ca1447c1f38f4eb60d0e762ddec57bf51/mayavi-4.6.2.tar.bz2
Collecting apptools (from mayavi)
Using cached https://files.pythonhosted.org/packages/78/84/64764e2c87fcb7ad7521bdabc7c44c109b80691f94218cbddd5df2ee682c/apptools-4.4.0.tar.bz2
Collecting envisage (from mayavi)
Using cached https://files.pythonhosted.org/packages/ea/2a/7efcd2c44a638a5e3e65e39f7e5bd4cf952ef4ffc71768730cf19fef1e4e/envisage-4.7.0-py3-none-any.whl
Requirement already satisfied: numpy in c:\users\adria\appdata\local\programs\python\python37-32\lib\site-packages (from mayavi) (1.15.4)
Collecting pyface>=6.0.0 (from mayavi)
Using cached https://files.pythonhosted.org/packages/45/fe/7150742f7053cb5082f15704c064a5c683f42dfc00411ce173287651e33a/pyface-6.0.0.tar.gz
Collecting pygments (from mayavi)
Using cached https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl
Collecting traits>=4.6.0 (from mayavi)
Using cached https://files.pythonhosted.org/packages/56/47/03f50e82e1ff1e8a602c5f2cf12f08675f79a7169629fe4ce521e59d265f/traits-4.6.0.tar.bz2
Collecting traitsui>=6.0.0 (from mayavi)
Using cached https://files.pythonhosted.org/packages/f2/06/3ad35a78e1ca82d762e2d9ffe9ed6c9dd405caa340066052d7ec186b9b1b/traitsui-6.0.0.tar.gz
Collecting vtk (from mayavi)
Could not find a version that satisfies the requirement vtk (from mayavi) (from versions: )
No matching distribution found for vtk (from mayavi)
Running pip install vtk gives
Collecting vtk
Could not find a version that satisfies the requirement vtk (from versions: )
No matching distribution found for vtk
I installed VTK manually with https://www.vtk.org/files/release/7.1/vtkpython-7.1.1-Windows-64bit.exe but it does not solve the problem.
Running python --version returns Python 3.7.1 and running pip --version or pip3 --version returns pip 18.1 from c:\users\adria\appdata\local\programs\python\python37-32\lib\site-packages\pip (python 3.7).
How do I solve this problem?
Go to anaconda cloud then search mayavi then, in the python console, tape
conda install -c conda-forge mayavi
Perhaps before you have to install VTK module with
conda install -c conda-forge vtk
Then restart the console, and enjoy!

In Amazon Linux, unable to install pandas and numpy in virtualenv

I have been trying to install pandas and numpy in my virtualenv. The box is an Amazon Linux AMI instance. This is my command log:
Activate venv and check packages
[ec2-user#ip-0-0-0-0 www]$ source datasci_venv/bin/activate
(datasci_venv) [ec2-user#ip-0-0-0-0 www]$ pip freeze
Django==1.11
requests==2.20.1
Then using pip install to install pandas and numpy. Note that when installing Django and requests, they were successfully installed:
(datasci_venv) [ec2-user#ip-0-0-0-0 www]$ pip install pandas && pip install numpy
Collecting pandas
Using cached https://files.pythonhosted.org/packages/e1/d8/feeb346d41f181e83fba45224ab14a8d8af019b48af742e047f3845d8cff/pandas-0.23.4-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied: pytz>=2011k in ./datasci_venv/lib/python3.6/dist-packages (from pandas) (2018.7)
Collecting numpy>=1.9.0 (from pandas)
Using cached https://files.pythonhosted.org/packages/ff/7f/9d804d2348471c67a7d8b5f84f9bc59fd1cefa148986f2b74552f8573555/numpy-1.15.4-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied: python-dateutil>=2.5.0 in ./datasci_venv/lib/python3.6/dist-packages (from pandas) (2.7.5)
Requirement already satisfied: six>=1.5 in ./datasci_venv/lib/python3.6/dist-packages (from python-dateutil>=2.5.0->pandas) (1.11.0)
Installing collected packages: numpy, pandas
Successfully installed numpy-1.15.4 pandas-0.23.4
Collecting numpy
Using cached https://files.pythonhosted.org/packages/ff/7f/9d804d2348471c67a7d8b5f84f9bc59fd1cefa148986f2b74552f8573555/numpy-1.15.4-cp36-cp36m-manylinux1_x86_64.whl
tabula-py 1.3.0 requires pandas, which is not installed.
Installing collected packages: numpy
Successfully installed numpy-1.15.4
So it seems that they are correctly installed, since there are no error messages. However, when I check my packages again, they are not there:
(datasci_venv) [ec2-user#ip-0-0-0-0 www]$ pip freeze
Django==1.11
requests==2.20.1
And hence I decided to check which command I am using but it says I'm using the programs in the venv:
(datasci_venv) [ec2-user#ip-0-0-0-0 www]$ which pip
/var/www/datasci_venv/bin/pip
(datasci_venv) [ec2-user#ip-0-0-0-0 www]$ which python
/var/www/datasci_venv/bin/python
(datasci_venv) [ec2-user#ip-0-0-0-0 www]$
Hence, I'm kinda lost on what to do and check. Any help or solution is appreciated.
I had the same issue, it appears that pip is installing the package in the lib64 folder of your virtualenv rather than on the lib folder. You need to force the target folder by doing this:
pip install --target datasci_venv/lib/python3.6/dist-packages/ numpy
Hope this help!

Categories

Resources