Can't install MatPlotLib for python 3 Mac OSX El Capitan - python

I am very new to coding and don't understand install processes. I am using Python 3.7.0 on Max OSX El Capitan. I want to install matplotlib but I tried this in terminal :
$ pip install matplotlib
and it gave me an error that :
192-168-1-107:~ Ada1$ pip install matplotlib Requirement already satisfied: matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requirement already satisfied: numpy>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib)
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib)
Collecting tornado (from matplotlib) Could not fetch URL https://pypi.python.org/simple/tornado/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping Could not find a version that satisfies the requirement tornado (from matplotlib) (from versions: ) No matching distribution found for tornado (from matplotlib)
I also tried :
$ sudo pip install matplotlib
but same error and python gives the error it is not installed. Help?

Basically there are 3 possible causes I can see:
conflict of python 3 or 2 versions (most liekly)
OSX-specific bugs (needs a newer pip version as discussed here),
you are behind firewal (you can disable SSL by adding flags to pip command)
To make sure you are installing to python 3 you can use:
pip3 install -U matplotlib
Vertual environments and pipenv, conda and possibly poetry are your friends to achive greater isolation of python project setups in the future.

Related

tensorfow addon problems while downloading rasa on my mac os

I tried downgrading python to 3.6 and upgraded pip yet no changes. This error shows up while downloading Rasa.
ERROR: Could not find a version that satisfies the requirement tensorflow-addons<=0.12,>=0.10 (from rasa) (from versions: none)
ERROR: No matching distribution found for tensorflow-addons<=0.12,>=0.10 (from rasa)
As the error suggests, you have to manually install the correct version of tensorflow-addons before installing rasa.
Try
pip install tensorflow-addons==0.11.2
and then install rasa again

Unable to install openAI-gym on python for windows

it's giving me an error when I'm trying to pip install gym,
please help
I'm installing on my windows 7
This is the Error:
spyder 3.3.2 requires pyqt5<5.10; python_version >= "3", which is not installed.
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\cloudpickle-0.6.1.dist-info\\installer'
Consider using the `--user` option or check the permissions.
Full Excerpt Follows:
!pip install gym
Downloading https://files.pythonhosted.org/packages/9d/38/87aefd5388f6062267384b7e8f97dbc27c54b3e6137a5148b43d5c10890c/gym-0.13.1.tar.gz (1.6MB)
Requirement already satisfied: scipy in c:\programdata\anaconda3\lib\site-packages (from gym) (1.1.0)
Requirement already satisfied: numpy>=1.10.4 in c:\programdata\anaconda3\lib\site-packages (from gym) (1.15.4)
Requirement already satisfied: six in c:\programdata\anaconda3\lib\site-packages (from gym) (1.12.0)
Collecting pyglet<=1.3.2,>=1.2.0 (from gym)
Downloading https://files.pythonhosted.org/packages/1c/fc/dad5eaaab68f0c21e2f906a94ddb98175662cc5a654eee404d59554ce0fa/pyglet-1.3.2-py2.py3-none-any.whl (1.0MB)
Collecting cloudpickle~=1.2.0 (from gym)
Using cached https://files.pythonhosted.org/packages/09/f4/4a080c349c1680a2086196fcf0286a65931708156f39568ed7051e42ff6a/cloudpickle-1.2.1-py2.py3-none-any.whl
Requirement already satisfied: future in c:\programdata\anaconda3\lib\site-packages (from pyglet<=1.3.2,>=1.2.0->gym) (0.17.1)
Building wheels for collected packages: gym
Running setup.py bdist_wheel for gym: started
Running setup.py bdist_wheel for gym: finished with status 'done'
Stored in directory: C:\Users\INTEL\AppData\Local\pip\Cache\wheels\95\14\8e\b4f5c72600f654312b40c0844d4c23f146f291c48ac7a5df62
Successfully built gym
Installing collected packages: pyglet, cloudpickle, gym
Found existing installation: pyglet 1.4.1
Uninstalling pyglet-1.4.1:
Successfully uninstalled pyglet-1.4.1
Found existing installation: cloudpickle 0.6.1
Uninstalling cloudpickle-0.6.1:
spyder 3.3.2 requires pyqt5<5.10; python_version >= "3", which is not installed.
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\cloudpickle-0.6.1.dist-info\\installer'
Consider using the `--user` option or check the permissions.```
You have two issues reported:
spyder 3.3.2 requires pyqt5<5.10; python_version >= "3", which is not installed.
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site- packages\\cloudpickle-0.6.1.dist-info\\installer'
Consider using the `--user` option or check the permissions.
1) Access Denied: It is having trouble accessing the packages under your Aanaconda directory.
Try running from an Administrative Command Prompt, If you are not logged in as an admin on the system also do that.
2) Python Version: The script says that one of the components needs Python Version Greater than or equal to 3 and that it was not found
Make sure you are on the correct version of Python.

Can't upgrade python-dateutil in OSX

I am trying to install Sphinx on OSX, with the hopes of eventually making it into a website, following this guide :
I have been macporting, homebrewing, python wheelin', figuring out what a virtualenv is... figuring out if I should use python 2.7 or 3.X (which I couldn't figure out)
I added this to my bash profile :
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
When I run this :
python -c "import sys; print('\n'.join(sys.path))"
I had expected it to return simply /usr/local/lib/python2.7/site-packages
but it says the following :
/Library/Python/2.7/site-packages/pip-10.0.0b2-py2.7.egg
/Library/Python/2.7/site-packages/virtualenv-15.2.0-py2.7.egg
/Users/nook
/usr/local/lib/python2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Users/nook/Library/Python/2.7/lib/python/site-packages
/Library/Python/2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Anyway, I finally got a virtualenv set-up, and ran the following command:
pip install sphinx
I sorted out a NumPy error, and another error with six. But I am unable to get rid of the following error :
jupyter-client 5.2.3 has requirement python-dateutil>=2.1,
but you'll have python-dateutil 1.5 which is incompatible.
When I run the following command :
pip install python-dateutil --upgrade --ignore-installed
I get
Collecting python-dateutil
Using cached python_dateutil-2.7.2-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil)
Using cached six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil`
That seems good...
But when I try to install sphinx again I get the same
jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have
python-dateutil 1.5 which is incompatible.
So I went in and tried the following command :
sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/python_dateutil-1.5-py2.7.egg-info/
I want to remove that directory, to NumPy directories, and another dateutil directory...but can't ! I don't have the permissions.
If anyone has a pro-tip on what version of python to use for my sphinx site (the latest version ?), and how set up a virtual environment with **that version of python, figure out Numpty and dateutil... I will be forever in your debt !
EDIT : Just tried the following :
sudo pip install python-dateutil
Password:
The directory '/Users/nick/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/nick/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: python-dateutil in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
(1.5)
pandas 0.22.0 has requirement numpy>=1.9.0, but you'll have numpy 1.8.0rc1
which is incompatible.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1
which is incompatible.
jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have
python-dateutil 1.5 which is incompatible.
You can see my numpy is totally budget too, at 1.8.0rc1. Thanks.

Error: Failed building wheel for wxpython-phoenix while installing wx

I am trying to install wxpython (I have python 3.5.2(32Bit) and Windows 10(64Bit))
I tried :pip install wx and i get: Failed building wheel for wxpython-phoenix 2 times and then a big error line-->
I also tried installing Anaconda, but it did not help.How can I overcome the problem ?
There's a lot of questions about failed installations on windows, probably because the packages are compiled when installed, and sometimes the compilation fail when the compiler is not properly configured. I admit I decided to let the specialized people handle it.
As a nice workaround, you can grab the already built distribution at the official wxpython website located here:
Python 3.5 32/64 bit windows:
https://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev2700+c524ed1-cp35-cp35m-win_amd64.whl
https://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev2700+c524ed1-cp35-cp35m-win32.whl
just download the .whl file and do for example:
C:\python35\scripts\pip install wxPython_Phoenix-3.0.3.dev2700+c524ed1-cp35-cp35m-win_amd64.whl
For linux you need to go here first
https://extras.wxpython.org/wxPython4/extras/linux/gtk3/
Then grab your linux version and do the install.
(base) fsdfsdfd#linux:~/Downloads$ pip install wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
Processing ./wxPython-4.1.1-cp38-cp38-linux_x86_64.whl
Requirement already satisfied: pillow in /home/orangel/miniconda3/lib/python3.8/site-packages (from wxPython==4.1.1) (8.1.2)
Requirement already satisfied: numpy; python_version >= "3.0" in /home/orangel/miniconda3/lib/python3.8/site-packages (from wxPython==4.1.1) (1.20.1)
Requirement already satisfied: six in /home/orangel/miniconda3/lib/python3.8/site-packages (from wxPython==4.1.1) (1.15.0)
Installing collected packages: wxPython
Successfully installed wxPython-4.1.1
if does not works, please try this
sudo apt install libwxgtk3.0-gtk3-dev

Python jira is not upgraded by pip

I am using python jira package installed using PIP in a virtual environment. Recently my script started to complain about jira package version:
$ ./my_script.sh
jira/client.py:282: UserWarning: You are running an outdated version of JIRA Python 1.0.3. Current version is 1.0.6.dev20160420173258. Do not file any bugs against older versions.
I tried upgrade using pip like:
$ pip install --upgrade --no-cache-dir jira
Collecting jira
Downloading jira-1.0.3-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB 175kB/s
Requirement already up-to-date: requests>=2.6.0 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: requests-oauthlib>=0.3.3 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: six>=1.9.0 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: requests-toolbelt in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: tlslite>=0.4.4 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from jira)
Requirement already up-to-date: oauthlib>=0.6.2 in <...>/.virtualenvs/jira/lib/python3.4/site-packages (from requests-oauthlib>=0.3.3->jira)
Installing collected packages: jira
Successfully installed jira-1.0.3
I tried to remove installed jira package and install it freshly with same result. Pip always installs only version 1.0.3 but scripts complain about newer version.
My assumption is that 1.0.6 is marked as released (the check is inside the package itself) but not published (I don´t know if this is the right word) for pip to download.
Any clue?
Regards,
JrBenito
It appears there is a 1.0.6.dev20160420173258 version but this isn't being downloaded when using pip install jira. It can be installed by using the workaround found on the issue #156 for this new version. pip install https://pypi.python.org/packages/f6/ea/2535e412ff76d85da20d2be6d1eaf9aa5de49481da94f2fe7e8830eedd35/jira-1.0.6.dev20160420173258-py2.py3-none-any.whl Which it appears you have already commented on, so hopefully they resolve the issue permanently.
I had this same issue, even after specifically downloading the 1.0.6.dev20160420173258 version. When the client.py file gets the version information, it doesn't get the git changeset correctly and so returns 1.0.6 instead of 1.0.6.dev20160420173258.
For now I made a workaround by hardcoding the version number pulled from https://pypi.python.org/pypi/jira/json
In /usr/lib/python2.7/site-packages/jira/client.py:
released_version = "1.0.6" # data['info']['version']
This is admittedly not a fix but lets hope it gets fixed.
It worked for me only after changed it to
/usr/lib/python2.7/site-packages/jira/client.py:
with
released_version = "1.0.6" # data['info']['version']

Categories