I am experiencing the same problem as described in import matplotlib.pyplot hangs after updating my matplotlib version import matplotlib.pyplot as plt hangs while executing fc-list.
However, the proposed solution does not work for me; running fc-list in ~/.matplotlib takes 100% CPU and does not finish within 15 minutes.
I have the following configuration:
Mac, running OS 10.10.5 (OS X Yosemite)
Python 2.7.5
matplotlib 1.4.3 (was 1.3.1, no problems with that version)
To update my matplotlib version, I used:
sudo pip install matplotlib
If I re-run this command now, I get
Requirement already satisfied (use --upgrade to upgrade): matplotlib in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pytz in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.0,>=1.5.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): nose>=0.11.1 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): mock in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): funcsigs in /Library/Python/2.7/site-packages (from mock->matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pbr>=0.11 in /Library/Python/2.7/site-packages (from mock->matplotlib)
and sudo pip install --upgrade matplotlib:
Requirement already up-to-date: matplotlib in /Library/Python/2.7/site-packages
Requirement already up-to-date: numpy>=1.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: pytz in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: pyparsing!=2.0.0,>=1.5.6 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: python-dateutil in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: nose>=0.11.1 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: six>=1.4 in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: mock in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already up-to-date: funcsigs in /Library/Python/2.7/site-packages (from mock->matplotlib)
Requirement already up-to-date: pbr>=0.11 in /Library/Python/2.7/site-packages (from mock->matplotlib)
I have a fontList.cache file in ~/.matplotlib. This file is old (dating back to 2013, thus older than this update attempt).
Questions:
Despite the fontList.cache file, should I run fc-list, expecting it to finish at some point?
Is matplotlib expecting to find the fontList.cache file in a different location? Maybe my install/update of matplotlib messed up some path - but: matplotlib.get_cachedir() returns /Users/MyName/.matplotlib
Has the filename changed? Should I rename fontList.cache?
I do not have the /usr/X11/lindirectory anymore. However, could fc-list still enter an infinite loop as suggested?
I cannot reproduce the problem after posting the question.
I suspect that (re-)running
sudo pip install matplotlib
and/or
sudo pip install --upgrade matplotlib
while writing the question (to capture the on-screen output) fixed the previously existing issue.
fc-list now finished within 2 minutes; hough it did not create a new fontList.cache file.
I can now call import matplotlib.pyplot as plt as before.
Related
I'm a bit new to using pip to install modules on Python. I believe I have pip installed, however when I try to use the module I've tried to install using pip it says there is no such module. I'll post terminal response to see what happened. I'd really appreciate if somebody can let me know if I'm making a mistake installing modules, thanks for your time.
faizrahman#138-38-186-80 ~ % sudo pip install matplotlib
Password:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: The directory '/Users/faizrahman/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.3.1)
Requirement already satisfied: numpy>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.8.0rc1)
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.5)
Requirement already satisfied: tornado in /Library/Python/2.7/site-packages (from matplotlib) (5.1.1)
Requirement already satisfied: pyparsing>=1.5.6 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (2.0.1)
Requirement already satisfied: nose in /Library/Python/2.7/site-packages (from matplotlib) (1.3.7)
Requirement already satisfied: singledispatch in /Library/Python/2.7/site-packages (from tornado->matplotlib) (3.4.0.3)
Requirement already satisfied: futures in /Library/Python/2.7/site-packages (from tornado->matplotlib) (3.3.0)
Requirement already satisfied: backports-abc>=0.4 in /Library/Python/2.7/site-packages (from tornado->matplotlib) (0.5)
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from singledispatch->tornado->matplotlib) (1.12.0)
faizrahman#138-38-186-80 ~ %
You will need to call pip from python3:
sudo python3 -m pip install matplotlib
I am unable to install the python pubnub SDK on my Onion Omega 2 plus board. The installation always freezes at the following stage:
root#Omega-E5A5:/# pip3 install pubnub
Collecting pubnub
Using cached https://files.pythonhosted.org/packages/94/a4/321d50db8786e19e41be43da22fe38a03d5fc0560d9b815a8b5e11ea068e/pubnub-4.0.13.tar.gz
Collecting pycryptodomex>=3.3 (from pubnub)
Using cached https://files.pythonhosted.org/packages/6a/c4/21d55c2bf30995847406cb1a737d4ae5e19615eca39c9258f0548b5656f1/pycryptodomex-3.6.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): requests>=2.4 in /usr/lib/python3.6/site-packages (from pubnub)
Requirement already satisfied (use --upgrade to upgrade): six>=1.10 in /usr/lib/python3.6/site-packages (from pubnub)
Requirement already satisfied (use --upgrade to upgrade): idna<2.7,>=2.5 in /usr/lib/python3.6/site-packages (from requests>=2.4->pubnub)
Requirement already satisfied (use --upgrade to upgrade): urllib3<1.23,>=1.21.1 in /usr/lib/python3.6/site-packages (from requests>=2.4->pubnub)
Requirement already satisfied (use --upgrade to upgrade): certifi>=2017.4.17 in /usr/lib/python3.6/site-packages (from requests>=2.4->pubnub)
Requirement already satisfied (use --upgrade to upgrade): chardet<3.1.0,>=3.0.2 in /usr/lib/python3.6/site-packages (from requests>=2.4->pubnub)
Installing collected packages: pycryptodomex, pubnub
Running setup.py install for pycryptodomex ... /
I tried installing the pycryptodomex library manually with no success, still had the same problem. It freezes after a certain point during setup.py run.
I was able to install PubNub on my Mac.
'pip install pubnub'
ENV
what's your Python version?
python v3 got 'venv' by default,
have you tried installing 'pubnub' under a 'venv'?
Feel free to contact PubNub's support team, they are very helpful :)
I ran this command:
pip uninstall wagtail
Uninstalling wagtail: Proceed (y/n)? y
Successfully uninstalled
wagtail
However when I then ran pip install wagtail i received the following message:
root#daap:/usr/lib/python2.7# pip install wagtail
Requirement already satisfied (use --upgrade to upgrade): wagtail in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): Django<1.11,>=1.8.1 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): django-modelcluster<4.0,>=3.0 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): django-taggit<1.0,>=0.20 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): django-treebeard<5.0,>=3.0 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): djangorestframework>=3.1.3 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): Pillow>=2.6.1 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4>=4.5.1 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): html5lib<1,>=0.999 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): Unidecode>=0.04.14 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): Willow<0.5,>=0.4 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): requests<3.0,>=2.11.1 in /usr/local/lib/python2.7/dist-packages (from wagtail)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2015.2 in /usr/local/lib/python2.7/dist-packages (from django-modelcluster<4.0,>=3.0->wagtail)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from html5lib<1,>=0.999->wagtail)
Cleaning up...
I am having problems that wagtail is not found when I run my django app, so I would like to completely uninstall it, then install it again.
Why isn't it being removed when I run pip uninstall wagtail? and how can I completely remove it? thanks
pip caches the python package. If you do not want to use the cache, you should use --no-cache-dir.
like this.
pip --no-cache-dir install -I wagtail
see also https://pip.pypa.io/en/stable/reference/pip_install/#caching
The cache dir is also written in this URL:)
source your-venv\bin\activate
pip install wagtail, django
To uninstall, make sure you have your venv activated. Just being in the dir does not mean you are inside virtualenv.
System: OX E
Python source: python.org
I used pip to install matplotlib and here is the result I got
sudo pip install matplotlib
The directory '/Users/clarence/Library/Caches/pip/http' or its parent
directory is not owned by the current user and the cache has been
disabled. Please check the permissions and owner of that directory. If
executing pip with sudo, you may want sudo's -H flag. The directory
'/Users/clarence/Library/Caches/pip' or its parent directory is not
owned by the current user and caching wheels has been disabled. check
the permissions and owner of that directory. If executing pip with
sudo, you may want sudo's -H flag. Requirement already satisfied (use
--upgrade to upgrade): matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5
in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): python-dateutil in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): tornado in /Library/Python/2.7/site-packages (from
matplotlib) Requirement already satisfied (use --upgrade to upgrade):
pyparsing>=1.5.6 in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): nose in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): certifi in
/Library/Python/2.7/site-packages (from tornado->matplotlib)
Requirement already satisfied (use --upgrade to upgrade):
backports-abc>=0.4 in /Library/Python/2.7/site-packages (from
tornado->matplotlib) Requirement already satisfied (use --upgrade to
upgrade): backports.ssl-match-hostname in
/Library/Python/2.7/site-packages (from tornado->matplotlib)
Requirement already satisfied (use --upgrade to upgrade):
singledispatch in /Library/Python/2.7/site-packages (from
tornado->matplotlib) Requirement already satisfied (use --upgrade to
upgrade): six in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from singledispatch->tornado->matplotlib) Clarences-MacBook-Pro:~
clarence$ sudo -H pip install matplotlib Requirement already
satisfied (use --upgrade to upgrade): matplotlib in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5
in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): python-dateutil in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): tornado in /Library/Python/2.7/site-packages (from
matplotlib) Requirement already satisfied (use --upgrade to upgrade):
pyparsing>=1.5.6 in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from matplotlib) Requirement already satisfied (use --upgrade to
upgrade): nose in /Library/Python/2.7/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): certifi in
/Library/Python/2.7/site-packages (from tornado->matplotlib)
Requirement already satisfied (use --upgrade to upgrade):
backports-abc>=0.4 in /Library/Python/2.7/site-packages (from
tornado->matplotlib) Requirement already satisfied (use --upgrade to
upgrade): backports.ssl-match-hostname in
/Library/Python/2.7/site-packages (from tornado->matplotlib)
Requirement already satisfied (use --upgrade to upgrade):
singledispatch in /Library/Python/2.7/site-packages (from
tornado->matplotlib) Requirement already satisfied (use --upgrade to
upgrade): six in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(from singledispatch->tornado->matplotlib)
When I go ahead the import that library in python. python says it could not find the modulus.
python3.5 -c 'import matplotlib; print(matplotlib.__version__, matplotlib.__file__)'
Traceback (most recent call last): File "", line 1, in
ImportError: No module named 'matplotlib'
How can I fix this?
You need to install those libraries for the same version of python that you are using later to execute your code.
So if you want to use Python 2.7 you have to call
sudo pip2 install matplotlib
When using python 3.5 use it in a similar way
sudo pip3 install matplotlib
I'm trying to set setup Python-Eve.
Python-Eve Installation Guide
I've finished these steps:
C:\Users\Ari\Desktop\rizzla>python -m pip install eve
Requirement already satisfied (use --upgrade to upgrade): eve in c:\python34\lib
\site-packages
Requirement already satisfied (use --upgrade to upgrade): cerberus<0.9,>=0.8 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): events<0.3,>=0.2.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): simplejson<4.0,>=3.3.0
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): werkzeug<0.10,>=0.9.4
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): markupsafe<1.0,>=0.23
in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): jinja2<3.0,>=2.7.2 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): itsdangerous<1.0,>=0.2
2 in c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): flask<0.11,>=0.10.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): pymongo<3.0,>=2.7.1 in
c:\python34\lib\site-packages (from eve)
Requirement already satisfied (use --upgrade to upgrade): flask- pymongo<0.4,>=0.
3.0 in c:\python34\lib\site-packages (from eve)
But when trying to run the code on Quick Start Guide I get
Traceback (most recent call last):
File "run.py", line 1, in <module>
from eve import Eve
File "C:\Users\Ari\Desktop\rizzla\eve.py", line 1, in <module>
from eve import Eve
ImportError: cannot import name 'Eve'
My code is here:
from eve import Eve
app = Eve()
if __name__ == '__main__':
app.run()
Your script name is eve; same as the module you want to import. Rename your script name to other name to prevent the conflict.
Remove eve.pyc in the directory if there is.